kongzue пре 4 година
родитељ
комит
0e34e3e4c1
2 измењених фајлова са 189 додато и 3 уклоњено
  1. 3 3
      DialogX/build.gradle
  2. 186 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomMenu.java

+ 3 - 3
DialogX/build.gradle

@@ -6,7 +6,7 @@ def siteUrl = 'https://github.com/kongzue/DialogX' //项目在github主页地址
 def gitUrl = 'https://github.com/kongzue/DialogX.git'   //Git仓库的地址
 
 group = "com.kongzue.dialogx"
-version = "0.0.7"
+version = "0.0.8"
 
 android {
     compileSdkVersion 30
@@ -14,8 +14,8 @@ android {
     defaultConfig {
         minSdkVersion 21
         targetSdkVersion 30
-        versionCode 7
-        versionName "0.0.7"
+        versionCode 8
+        versionName "0.0.8"
 
         consumerProguardFiles "consumer-rules.pro"
 

+ 186 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomMenu.java

@@ -68,6 +68,14 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(List<CharSequence> menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu showStringList(List<String> menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.setMenuStringList(menuList);
@@ -75,6 +83,14 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu showStringList(List<String> menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.setMenuStringList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu show(String[] menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.setMenuList(menuList);
@@ -82,6 +98,14 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(String[] menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu show(CharSequence[] menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.setMenuList(menuList);
@@ -89,6 +113,14 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(CharSequence[] menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu show(CharSequence title, CharSequence message, List<CharSequence> menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.title = title;
@@ -98,6 +130,33 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(CharSequence title, CharSequence message, List<CharSequence> menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = title;
+        bottomMenu.message = message;
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
+    public static BottomMenu show(CharSequence title, List<CharSequence> menuList) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = title;
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
+    public static BottomMenu show(CharSequence title, List<CharSequence> menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = title;
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu showStringList(CharSequence title, CharSequence message, List<String> menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.title = title;
@@ -107,6 +166,16 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu showStringList(CharSequence title, CharSequence message, List<String> menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = title;
+        bottomMenu.message = message;
+        bottomMenu.setMenuStringList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu show(CharSequence title, CharSequence message, String[] menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.title = title;
@@ -116,6 +185,16 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(CharSequence title, CharSequence message, String[] menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = title;
+        bottomMenu.message = message;
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu show(CharSequence title, CharSequence message, CharSequence[] menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.title = title;
@@ -125,6 +204,16 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(CharSequence title, CharSequence message, CharSequence[] menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = title;
+        bottomMenu.message = message;
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu show(String title, String message, List<CharSequence> menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.title = title;
@@ -134,6 +223,16 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(String title, String message, List<CharSequence> menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = title;
+        bottomMenu.message = message;
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu showStringList(String title, String message, List<String> menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.title = title;
@@ -143,6 +242,16 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu showStringList(String title, String message, List<String> menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = title;
+        bottomMenu.message = message;
+        bottomMenu.setMenuStringList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu show(String title, String message, String[] menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.title = title;
@@ -152,6 +261,16 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(String title, String message, String[] menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = title;
+        bottomMenu.message = message;
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu show(String title, String message, CharSequence[] menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.title = title;
@@ -161,6 +280,16 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(String title, String message, CharSequence[] menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = title;
+        bottomMenu.message = message;
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu show(int titleResId, int messageResId, List<CharSequence> menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.title = bottomMenu.getString(titleResId);
@@ -170,6 +299,14 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(int titleResId, List<CharSequence> menuList) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = bottomMenu.getString(titleResId);
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     public static BottomMenu showStringList(int titleResId, int messageResId, List<String> menuList) {
         BottomMenu bottomMenu = new BottomMenu();
         bottomMenu.title = bottomMenu.getString(titleResId);
@@ -197,6 +334,55 @@ public class BottomMenu extends BottomDialog {
         return bottomMenu;
     }
     
+    public static BottomMenu show(int titleResId, int messageResId, List<CharSequence> menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = bottomMenu.getString(titleResId);
+        bottomMenu.message = bottomMenu.getString(messageResId);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
+    public static BottomMenu show(int titleResId, List<CharSequence> menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = bottomMenu.getString(titleResId);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
+    public static BottomMenu showStringList(int titleResId, int messageResId, List<String> menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = bottomMenu.getString(titleResId);
+        bottomMenu.message = bottomMenu.getString(messageResId);
+        bottomMenu.setMenuStringList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
+    public static BottomMenu show(int titleResId, int messageResId, String[] menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = bottomMenu.getString(titleResId);
+        bottomMenu.message = bottomMenu.getString(messageResId);
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
+    public static BottomMenu show(int titleResId, int messageResId, CharSequence[] menuList, OnMenuItemClickListener<BottomMenu> onMenuItemClickListener) {
+        BottomMenu bottomMenu = new BottomMenu();
+        bottomMenu.title = bottomMenu.getString(titleResId);
+        bottomMenu.message = bottomMenu.getString(messageResId);
+        bottomMenu.setMenuList(menuList);
+        bottomMenu.setOnMenuItemClickListener(onMenuItemClickListener);
+        bottomMenu.show();
+        return bottomMenu;
+    }
+    
     @Override
     protected void onDialogInit(final DialogImpl dialog) {
         if (dialog != null) {