kongzue 4 سال پیش
والد
کامیت
9576283778

+ 1 - 1
DialogX/src/main/java/com/kongzue/dialogx/style/MaterialStyle.java

@@ -165,7 +165,7 @@ public class MaterialStyle implements DialogXStyle {
     
             @Override
             public boolean selectionImageTint(boolean light) {
-                return true;
+                return false;
             }
     
         };

+ 2 - 1
DialogX/src/main/res/drawable/rect_dialogx_material_menu_split_divider.xml

@@ -2,7 +2,8 @@
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
 
     <item
-        android:left="55dp">
+        android:left="15dp"
+        android:right="15dp">
         <shape android:shape="rectangle" >
             <solid android:color="@color/black10" />
         </shape>

+ 2 - 1
DialogX/src/main/res/drawable/rect_dialogx_material_menu_split_divider_night.xml

@@ -2,7 +2,8 @@
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
 
     <item
-        android:left="55dp">
+        android:left="25dp"
+        android:right="25dp">
         <shape android:shape="rectangle" >
             <solid android:color="@color/white10" />
         </shape>

+ 12 - 12
DialogX/src/main/res/layout/item_dialogx_material_bottom_menu_normal_text.xml

@@ -13,31 +13,31 @@
             android:id="@+id/img_dialogx_menu_icon"
             android:layout_width="35dp"
             android:layout_height="35dp"
+            android:layout_marginLeft="-5dp"
             android:layout_marginRight="10dp"
+            android:padding="5dp" />
+
+        <ImageView
+            android:id="@+id/img_dialogx_menu_selection"
+            android:layout_width="35dp"
+            android:layout_height="35dp"
+            android:layout_centerVertical="true"
             android:layout_marginLeft="-5dp"
-            android:padding="5dp"/>
+            android:layout_marginRight="10dp"
+            android:padding="5dp"
+            android:src="@mipmap/img_dialogx_bottom_menu_material_item_selection" />
 
         <TextView
             android:id="@+id/txt_dialogx_menu_text"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:gravity="left|center_vertical"
             android:layout_weight="1"
+            android:gravity="left|center_vertical"
             android:singleLine="true"
             android:text=""
             android:textColor="@color/black90"
             android:textSize="16dp" />
 
-        <ImageView
-            android:id="@+id/img_dialogx_menu_selection"
-            android:layout_width="35dp"
-            android:layout_height="35dp"
-            android:layout_marginLeft="10dp"
-            android:layout_marginRight="-5dp"
-            android:src="@mipmap/img_dialogx_bottom_menu_material_item_selection"
-            android:layout_centerVertical="true"
-            android:padding="5dp"/>
-
     </LinearLayout>
 
 </RelativeLayout>

BIN
DialogX/src/main/res/mipmap-xxhdpi/img_dialogx_bottom_menu_material_item_selection.png


+ 25 - 8
app/src/main/java/com/kongzue/dialogxdemo/MainActivity.java

@@ -61,8 +61,8 @@ public class MainActivity extends BaseActivity {
     private TextView txtTitle;
     private LinearLayout boxBody;
     private RadioGroup grpStyle;
-    private RadioButton rdoIos;
     private RadioButton rdoMaterial;
+    private RadioButton rdoIos;
     private RadioButton rdoKongzue;
     private RadioButton rdoMiui;
     private RadioGroup grpTheme;
@@ -82,6 +82,7 @@ public class MainActivity extends BaseActivity {
     private TextView btnBottomDialog;
     private TextView btnBottomMenu;
     private TextView btnBottomReply;
+    private TextView btnBottomSelectMenu;
     private TextView btnCustomMessageDialog;
     private TextView btnCustomInputDialog;
     private TextView btnCustomBottomMenu;
@@ -99,8 +100,8 @@ public class MainActivity extends BaseActivity {
         txtTitle = findViewById(R.id.txt_title);
         boxBody = findViewById(R.id.box_body);
         grpStyle = findViewById(R.id.grp_style);
-        rdoIos = findViewById(R.id.rdo_ios);
         rdoMaterial = findViewById(R.id.rdo_material);
+        rdoIos = findViewById(R.id.rdo_ios);
         rdoKongzue = findViewById(R.id.rdo_kongzue);
         rdoMiui = findViewById(R.id.rdo_miui);
         grpTheme = findViewById(R.id.grp_theme);
@@ -120,6 +121,7 @@ public class MainActivity extends BaseActivity {
         btnBottomDialog = findViewById(R.id.btn_bottom_dialog);
         btnBottomMenu = findViewById(R.id.btn_bottom_menu);
         btnBottomReply = findViewById(R.id.btn_bottom_reply);
+        btnBottomSelectMenu = findViewById(R.id.btn_bottom_select_menu);
         btnCustomMessageDialog = findViewById(R.id.btn_customMessageDialog);
         btnCustomInputDialog = findViewById(R.id.btn_customInputDialog);
         btnCustomBottomMenu = findViewById(R.id.btn_customBottomMenu);
@@ -417,18 +419,15 @@ public class MainActivity extends BaseActivity {
                                 }
                             });
                 } else {
-                    BottomMenu.show(new String[]{"拒绝", "询问", "始终允许", "仅在使用中允许"})
-                            .setMessage("这里是权限确认的文本说明,这是一个演示菜单")
-                            .setTitle("获得权限标题")
+                    BottomMenu.show(new String[]{"新标签页中打开", "稍后阅读", "复制链接网址"})
+                            .setMessage("http://www.kongzue.com/DialogX")
                             .setOnMenuItemClickListener(new OnMenuItemClickListener<BottomMenu>() {
                                 @Override
                                 public boolean onClick(BottomMenu dialog, CharSequence text, int index) {
-                                    selectMenuIndex = index;
                                     toast(text);
                                     return false;
                                 }
-                            })
-                            .setSelection(selectMenuIndex);
+                            });
                 }
             }
         });
@@ -618,6 +617,24 @@ public class MainActivity extends BaseActivity {
                 }
             }
         });
+        
+        btnBottomSelectMenu.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                BottomMenu.show(new String[]{"拒绝", "询问", "始终允许", "仅在使用中允许"})
+                        .setMessage("这里是权限确认的文本说明,这是一个演示菜单")
+                        .setTitle("获得权限标题")
+                        .setOnMenuItemClickListener(new OnMenuItemClickListener<BottomMenu>() {
+                            @Override
+                            public boolean onClick(BottomMenu dialog, CharSequence text, int index) {
+                                selectMenuIndex = index;
+                                toast(text);
+                                return false;
+                            }
+                        })
+                        .setSelection(selectMenuIndex);
+            }
+        });
     }
     
     private void initFullScreenLoginDemo(final FullScreenDialog fullScreenDialog) {

+ 20 - 0
app/src/main/res/layout/activity_main.xml

@@ -447,6 +447,26 @@
 
                 </LinearLayout>
 
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        android:id="@+id/btn_bottom_select_menu"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:background="@drawable/rect_button"
+                        android:paddingHorizontal="15dp"
+                        android:paddingVertical="10dp"
+                        android:text="底部单选菜单"
+                        android:textColor="@color/white"
+                        android:textSize="13dp"
+                        android:textStyle="bold" />
+
+                </LinearLayout>
+
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"