Browse Source

多语言

liuzhenxing1118 2 years ago
parent
commit
65fa22b771

+ 4 - 2
.idea/misc.xml

@@ -37,6 +37,7 @@
         <entry key="app/src/main/res/layout/item_icon.xml" value="0.25" />
         <entry key="app/src/main/res/layout/item_icon_progress.xml" value="0.15865384615384615" />
         <entry key="app/src/main/res/layout/item_icon_title.xml" value="0.19300911854103345" />
+        <entry key="app/src/main/res/layout/item_icon_title_center.xml" value="0.37771739130434784" />
         <entry key="app/src/main/res/layout/item_icon_title_marquee.xml" value="0.1828774062816616" />
         <entry key="app/src/main/res/layout/item_icon_title_right.xml" value="0.1" />
         <entry key="app/src/main/res/layout/item_icon_title_subtitle.xml" value="0.1" />
@@ -45,7 +46,7 @@
         <entry key="app/src/main/res/layout/item_progress_title_subtitle.xml" value="0.1331521739130435" />
         <entry key="app/src/main/res/layout/item_refresh.xml" value="0.1" />
         <entry key="app/src/main/res/layout/item_sure.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_switch.xml" value="0.55" />
         <entry key="app/src/main/res/layout/item_textfield.xml" value="0.16236068895643363" />
         <entry key="app/src/main/res/layout/item_title.xml" value="0.25769927536231885" />
         <entry key="app/src/main/res/layout/item_title_about.xml" value="0.396875" />
@@ -53,7 +54,8 @@
         <entry key="app/src/main/res/layout/item_title_edit.xml" value="0.16236068895643363" />
         <entry key="app/src/main/res/layout/item_title_subtitle.xml" value="0.1" />
         <entry key="app/src/main/res/layout/item_wifi_switch.xml" value="0.1" />
-        <entry key="app/src/main/res/layout/item_xpstyle.xml" value="0.16055045871559634" />
+        <entry key="app/src/main/res/layout/item_xpstyle.xml" value="1.0" />
+        <entry key="app/src/main/res/layout/item_xpstyle2.xml" value="0.37771739130434784" />
         <entry key="app/src/main/res/layout/selector_seekbar_bg.xml" value="0.15896739130434784" />
         <entry key="app/src/main/res/layout/software_version_activity.xml" value="0.20199275362318841" />
         <entry key="app/src/main/res/layout/view_cancel_sure.xml" value="0.34054107666015626" />

+ 4 - 7
app/src/main/java/com/xplora/xpsettings/Adapter/ConnectionsAdapter.java

@@ -38,7 +38,6 @@ public class ConnectionsAdapter extends ArrayAdapter<BaseModel> {
         View view = LayoutInflater.from(getContext()).inflate(resourceId, null);//实例化一个对象
         TextView itemTitle = view.findViewById(R.id.item_title);
         TextView itemDetail = view.findViewById(R.id.item_detail);
-        TextView itemSwitchTV = view.findViewById(R.id.item_switchTV);
         ImageView itembackground = view.findViewById(R.id.item_background);
         ImageView itemIcon = view.findViewById(R.id.item_icon);
 
@@ -64,8 +63,6 @@ public class ConnectionsAdapter extends ArrayAdapter<BaseModel> {
                         itemIcon.setImageResource(R.drawable.connections_wifi_0);
                     } else {
                         itemIcon.setVisibility(model.subTitle.isEmpty() ? View.VISIBLE : View.GONE);
-                        if (itemSwitchTV != null)
-                            itemSwitchTV.setVisibility(model.subTitle.isEmpty() ? View.GONE : View.VISIBLE);
                         if (model.subTitle.isEmpty()) {
                             itemIcon.setImageResource(R.drawable.connections_wifi_1);
                         } else {
@@ -83,10 +80,10 @@ public class ConnectionsAdapter extends ArrayAdapter<BaseModel> {
             case 3:
                 if (itemIcon != null)
                     itemIcon.setVisibility(View.GONE);
-                if (itemSwitchTV != null) {
-                    itemSwitchTV.setVisibility(View.VISIBLE);
-                    itemSwitchTV.setText(isOpen ? R.string.data_roaming_on : R.string.data_roaming_off);
-                    itemSwitchTV.setTextColor(isOpen ? Color.GREEN : Color.RED);
+                if (itemDetail != null) {
+                    itemDetail.setVisibility(View.VISIBLE);
+                    itemDetail.setText(isOpen ? R.string.data_roaming_on : R.string.data_roaming_off);
+                    itemDetail.setTextColor(isOpen ? Color.GREEN : Color.RED);
                 }
                 break;
             default:

+ 4 - 3
app/src/main/res/layout/item_icon_title_center.xml

@@ -6,7 +6,8 @@
 
     <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="45dp"
+        android:layout_height="wrap_content"
+        android:minHeight="45dp"
         >
 
         <ImageView
@@ -25,13 +26,13 @@
             android:layout_marginStart="10dp"
             android:layout_marginEnd="8dp"
             android:layout_alignParentEnd="true"
+            android:layout_marginTop="2dp"
+            android:layout_marginBottom="2dp"
             android:fontFamily="Roboto"
             android:layout_centerVertical="true"
             android:textColor="@color/white"
             android:textAlignment="center"
             android:textSize="13sp"
-            android:singleLine="true"
-            android:maxLines="1"
             />
 
     </RelativeLayout>

+ 5 - 2
app/src/main/res/layout/item_switch.xml

@@ -2,11 +2,12 @@
 <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="40dp">
+    android:layout_height="wrap_content">
 
     <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="40dp"
+        android:layout_height="wrap_content"
+        android:minHeight="40dp"
         >
 
         <Switch
@@ -25,6 +26,8 @@
             android:layout_height="wrap_content"
             android:layout_toEndOf="@id/item_switch"
             android:layout_marginStart="0dp"
+            android:layout_marginTop="2dp"
+            android:layout_marginBottom="2dp"
             android:layout_centerVertical="true"
             android:layout_alignParentEnd="true"
             android:textAlignment="center"

+ 5 - 2
app/src/main/res/layout/item_title.xml

@@ -2,11 +2,12 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
-    android:layout_height="40dp">
+    android:layout_height="wrap_content">
 
     <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="40dp"
+        android:layout_height="wrap_content"
+        android:minHeight="40dp"
         >
 
         <TextView
@@ -14,6 +15,8 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginStart="20dp"
+            android:layout_marginTop="2dp"
+            android:layout_marginBottom="2dp"
             android:layout_centerVertical="true"
             android:fontFamily="Roboto"
             android:textColor="@color/white"

+ 7 - 19
app/src/main/res/layout/item_xpstyle.xml

@@ -23,9 +23,13 @@
             android:layout_centerVertical="true"
             android:layout_marginStart="12dp"
             android:fontFamily="Roboto"
-            android:textFontWeight="700"
             android:textColor="@color/white"
-            android:textSize="11dp" />
+            android:textFontWeight="700"
+            android:textSize="11dp"
+            android:maxWidth="80dp"
+            android:maxLines="2"
+            android:ellipsize="end"
+            />
 
         <ImageView
             android:id="@+id/item_icon"
@@ -42,7 +46,7 @@
             android:layout_height="wrap_content"
             android:layout_centerVertical="true"
             android:layout_toEndOf="@+id/item_title"
-            android:layout_marginStart="12dp"
+            android:layout_marginStart="5dp"
             android:fontFamily="Roboto"
             android:textFontWeight="700"
             android:textColor="#999999"
@@ -51,22 +55,6 @@
             android:textAlignment="textEnd"
             android:layout_alignEnd="@id/item_background"
             android:layout_marginEnd="12dp"
-            android:ellipsize="end"
-            android:visibility="gone"
-            />
-
-        <TextView
-            android:id="@+id/item_switchTV"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_centerVertical="true"
-            android:layout_marginStart="12dp"
-            android:fontFamily="Roboto"
-            android:textFontWeight="700"
-            android:textSize="10dp"
-            android:textAlignment="textEnd"
-            android:layout_alignEnd="@id/item_background"
-            android:layout_marginEnd="12dp"
             android:visibility="gone"
             />