feat: 优化代码

pull/169/head
kunfei 5 years ago
parent 9d9519d508
commit 5933e33a4c
  1. 28
      app/src/main/res/layout/view_preference.xml

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_prefs_color" android:background="@drawable/bg_prefs_color"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -11,21 +10,23 @@
android:paddingBottom="4dp" android:paddingBottom="4dp"
android:minHeight="42dp" android:minHeight="42dp"
android:clickable="true" android:clickable="true"
android:orientation="horizontal" > android:orientation="horizontal"
android:focusable="true">
<ImageView android:id="@+id/preference_icon" <ImageView
xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/preference_icon"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:visibility="visible" android:visibility="visible"
android:paddingTop="1dp" android:paddingTop="1dp"
android:layout_width="24dp" android:layout_width="24dp"
android:layout_height="24dp" /> android:layout_height="24dp"
tools:ignore="ContentDescription,RtlHardcoded" />
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_weight="1.0" android:layout_weight="1.0"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<TextView <TextView
@ -36,19 +37,16 @@
android:text="@string/title" android:text="@string/title"
android:textColor="@color/tv_text_default" android:textColor="@color/tv_text_default"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
<TextView <TextView
android:id="@+id/preference_desc" android:id="@+id/preference_desc"
android:paddingBottom="8dp" android:paddingBottom="8dp"
android:singleLine="true"
android:textSize="14sp" android:textSize="14sp"
android:textColor="@color/tv_text_summary" android:textColor="@color/tv_text_summary"
android:text="@string/default1" android:text="@string/default1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
/>
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout
@ -61,7 +59,7 @@
android:visibility="gone" android:visibility="gone"
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
</FrameLayout> tools:ignore="RtlHardcoded" />
</LinearLayout> </LinearLayout>
Loading…
Cancel
Save