liuzhenxing 3 年之前
父节点
当前提交
176b9ef626

+ 1 - 0
.idea/misc.xml

@@ -5,6 +5,7 @@
       <map>
         <entry key="app/src/main/res/layout/activity_main.xml" value="0.3546195652173913" />
         <entry key="app/src/main/res/layout/display_activity.xml" value="0.20199275362318841" />
+        <entry key="app/src/main/res/layout/item_checkbox.xml" value="0.20199275362318841" />
         <entry key="app/src/main/res/layout/item_connections.xml" value="0.19300911854103345" />
         <entry key="app/src/main/res/layout/item_icon.xml" value="0.25" />
         <entry key="app/src/main/res/layout/item_icon_title.xml" value="0.19300911854103345" />

+ 6 - 1
app/src/main/java/com/xplora/xpsettings/Adapter/BaseListAdapter.java

@@ -8,6 +8,7 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ArrayAdapter;
+import android.widget.CheckBox;
 import android.widget.ImageView;
 import android.widget.Switch;
 import android.widget.TextView;
@@ -53,7 +54,7 @@ public class BaseListAdapter extends ArrayAdapter<BaseModel> {
             view = LayoutInflater.from(getContext()).inflate(R.layout.item_switch, null);
         }
         else if (model.cellType == Constant.CellType.CHECKBOX) {
-            view = LayoutInflater.from(getContext()).inflate(R.layout.item_switch, null);
+            view = LayoutInflater.from(getContext()).inflate(R.layout.item_checkbox, null);
         }
         else if (model.cellType == Constant.CellType.REFRESH) {
             view = LayoutInflater.from(getContext()).inflate(R.layout.item_refresh, null);
@@ -63,6 +64,7 @@ public class BaseListAdapter extends ArrayAdapter<BaseModel> {
         ImageView itembackground = view.findViewById(R.id.item_background);
         ImageView itemIcon = view.findViewById(R.id.item_icon);
         Switch itemSwitch = view.findViewById(R.id.item_switch);
+        CheckBox itemCheckbox = view.findViewById(R.id.item_checkbox);
 
 
         if (itemTitle != null) {
@@ -85,6 +87,9 @@ public class BaseListAdapter extends ArrayAdapter<BaseModel> {
 //                        mHandler.sendMessage(message);
 //                    }
 //            );
+        }
+        if (itemCheckbox != null) {
+
         }
         return view;
     }

+ 35 - 0
app/src/main/res/layout/item_checkbox.xml

@@ -0,0 +1,35 @@
+<?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="40dp">
+
+    <RelativeLayout
+        android:layout_width="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_alignParentStart="true"
+            android:layout_centerVertical="true"
+            >
+        </CheckBox>
+
+
+        <TextView
+            android:id="@+id/item_title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentEnd="true"
+            android:fontFamily="Roboto"
+            android:layout_centerVertical="true"
+            android:textColor="@color/white"
+            android:textSize="13sp" />
+
+    </RelativeLayout>
+
+</LinearLayout>