liuzhenxing 3 years ago
parent
commit
3055bdecad

+ 1 - 1
.idea/misc.xml

@@ -16,7 +16,7 @@
         <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" />
         <entry key="app/src/main/res/layout/item_icon_title_right.xml" value="0.25769927536231885" />
-        <entry key="app/src/main/res/layout/item_icon_title_subtitle.xml" value="0.25769927536231885" />
+        <entry key="app/src/main/res/layout/item_icon_title_subtitle.xml" value="0.1" />
         <entry key="app/src/main/res/layout/item_refresh.xml" value="0.1" />
         <entry key="app/src/main/res/layout/item_switch.xml" value="0.20199275362318841" />
         <entry key="app/src/main/res/layout/item_title.xml" value="0.25769927536231885" />

+ 1 - 0
app/src/main/java/com/xplora/xpsettings/Activity/VolumeActivity.java

@@ -35,6 +35,7 @@ public class VolumeActivity extends BaseActivity {
             model.title = stringList[i].trim();
             model.icon = ResUtils.getImageId("volume_", i);
             model.cellType = Constant.CellType.ICON_TITLE_SUBTITLE;
+            model.isShowArrow = false;
             mData.add(model);
         }
     }

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

@@ -24,7 +24,6 @@ import java.util.ArrayList;
 import java.util.List;
 
 public class BaseListAdapter extends ArrayAdapter<BaseModel> {
-    private int selectedItem = -1;
     private Handler mHandler = null;
     List<BaseModel> mBaseObjects = new ArrayList<>();
 
@@ -69,6 +68,7 @@ public class BaseListAdapter extends ArrayAdapter<BaseModel> {
         TextView itemTitle = view.findViewById(R.id.item_title);
         ImageView itembackground = view.findViewById(R.id.item_background);
         ImageView itemIcon = view.findViewById(R.id.item_icon);
+        ImageView itemArrow = view.findViewById(R.id.item_arrow);
         Switch itemSwitch = view.findViewById(R.id.item_switch);
         CheckBox itemCheckbox = view.findViewById(R.id.item_checkbox);
 
@@ -82,6 +82,9 @@ public class BaseListAdapter extends ArrayAdapter<BaseModel> {
         if (itemIcon != null) {
             itemIcon.setImageResource(model.icon);
         }
+        if (itemArrow != null) {
+            itemArrow.setVisibility(model.isShowArrow ? View.VISIBLE : View.GONE);
+        }
         if (itemSwitch != null) {
             itemSwitch.setChecked(model.isOn);
             itemSwitch.setOnCheckedChangeListener((compoundButton, b) -> {

+ 5 - 5
app/src/main/res/layout/item_checkbox.xml

@@ -6,29 +6,29 @@
     <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="28dp"
             android:layout_height="28dp"
-            android:layout_alignParentStart="true"
+            android:layout_marginStart="20dp"
             android:layout_centerVertical="true"
             android:background="@drawable/xp_checkbox"
             android:button="@null"
             >
         </CheckBox>
 
-
         <TextView
             android:id="@+id/item_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_toEndOf="@id/item_checkbox"
+            android:layout_marginStart="0dp"
+            android:layout_centerVertical="true"
             android:layout_alignParentEnd="true"
+            android:textAlignment="center"
             android:fontFamily="Roboto"
-            android:layout_centerVertical="true"
             android:textColor="@color/white"
             android:textSize="13sp" />
 

+ 8 - 9
app/src/main/res/layout/item_icon_title_subtitle.xml

@@ -6,9 +6,7 @@
 
     <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="35dp"
-        android:layout_marginLeft="5dp"
-        android:layout_marginRight="5dp"
+        android:layout_height="40dp"
         >
 
         <ImageView
@@ -16,34 +14,35 @@
             android:layout_width="24dp"
             android:layout_height="24dp"
             android:layout_centerVertical="true"
-            android:layout_marginStart="7.5dp"
-            android:src="@drawable/settings_pulse"
+            android:layout_marginStart="20dp"
             />
 
         <LinearLayout
             android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_height="match_parent"
             android:orientation="vertical"
             android:layout_toEndOf="@+id/item_icon"
-            android:layout_marginStart="8dp"
+            android:layout_alignParentEnd="true"
             >
 
             <TextView
                 android:id="@+id/item_title"
-                android:layout_width="wrap_content"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="5dp"
                 android:fontFamily="Roboto"
+                android:textAlignment="center"
                 android:textColor="@color/white"
                 android:textFontWeight="700"
                 android:textSize="12sp" />
 
             <TextView
                 android:id="@+id/item_subtitle"
-                android:layout_width="wrap_content"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginBottom="5dp"
                 android:fontFamily="Roboto"
+                android:textAlignment="center"
                 android:layout_centerVertical="true"
                 android:textColor="@color/white"
                 android:textSize="12sp"

+ 7 - 8
app/src/main/res/layout/item_switch.xml

@@ -2,36 +2,35 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     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_marginLeft="15dp"
-        android:layout_marginRight="15dp"
+        android:layout_height="40dp"
         >
 
         <Switch
             android:id="@+id/item_switch"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_alignParentStart="true"
+            android:layout_marginStart="20dp"
             android:layout_centerVertical="true"
             android:thumb="@drawable/selector_switch_thumb"
             android:track="@drawable/selector_switch_track">
         </Switch>
 
-
         <TextView
             android:id="@+id/item_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_toEndOf="@id/item_switch"
+            android:layout_marginStart="0dp"
+            android:layout_centerVertical="true"
             android:layout_alignParentEnd="true"
+            android:textAlignment="center"
             android:fontFamily="Roboto"
-            android:layout_centerVertical="true"
             android:textColor="@color/white"
             android:textSize="13sp" />
-
     </RelativeLayout>
 
 </LinearLayout>