liuzhenxing 3 lat temu
rodzic
commit
4400bc594e

+ 2 - 0
.idea/misc.xml

@@ -4,6 +4,8 @@
     <option name="filePathToZoomLevelMap">
       <map>
         <entry key="../../../.gradle/caches/transforms-3/dae954c5fd9608ef94a7528c5de015a2/transformed/xplibcommon/res/drawable/selector_switch_thumb.xml" value="0.12" />
+        <entry key="app/src/main/res/drawable/view_shape.xml" value="0.112" />
+        <entry key="app/src/main/res/drawable/xp_checkbox.xml" value="0.112" />
         <entry key="app/src/main/res/layout/activity_change_progress.xml" value="0.1" />
         <entry key="app/src/main/res/layout/activity_display.xml" value="0.25769927536231885" />
         <entry key="app/src/main/res/layout/activity_main.xml" value="0.3546195652173913" />

BIN
app/src/main/res/drawable/check_false.png


BIN
app/src/main/res/drawable/check_true.png


+ 10 - 0
app/src/main/res/drawable/xp_checkbox.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <!--    选中状态-->
+    <item android:drawable="@drawable/check_true" android:state_checked="true"/>
+    <!--    不选中状态-->
+    <item android:drawable="@drawable/check_false" android:state_checked="false"/>
+    <item android:drawable="@drawable/check_true" android:state_pressed="true"/>
+    <!--    默认状态-->
+    <item android:drawable="@drawable/check_false"/>
+</selector>

+ 6 - 4
app/src/main/res/layout/item_checkbox.xml

@@ -1,21 +1,23 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="36dp">
+    android:layout_height="40dp">
 
     <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
+        android:layout_height="40dp"
         android:layout_marginLeft="15dp"
         android:layout_marginRight="15dp"
         >
 
         <CheckBox
             android:id="@+id/item_checkbox"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="28dp"
+            android:layout_height="28dp"
             android:layout_alignParentStart="true"
             android:layout_centerVertical="true"
+            android:background="@drawable/xp_checkbox"
+            android:button="@null"
             >
         </CheckBox>