Skip to content

Commit 310a98d

Browse files
committed
opt: RecommendPreference layout
1 parent a4691a7 commit 310a98d

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

library/core/src/main/res/layout/preference_recommend.xml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,22 @@
1919
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2020
android:layout_width="match_parent"
2121
android:layout_height="wrap_content"
22-
android:background="@android:color/transparent">
22+
android:background="@android:color/transparent"
23+
android:orientation="vertical">
24+
25+
<TextView
26+
android:id="@+id/recommend_tip"
27+
android:layout_width="match_parent"
28+
android:layout_height="wrap_content"
29+
android:paddingStart="@dimen/miuix_theme_content_padding_start"
30+
android:paddingEnd="@dimen/miuix_theme_content_padding_end"
31+
android:background="?attr/preferenceCategoryBackground"
32+
android:importantForAccessibility="no"
33+
android:minHeight="1px"
34+
style="@style/TextAppearance.PreferenceCategory"
35+
android:layout_gravity="start|center"
36+
android:textAlignment="viewStart"
37+
android:text="@string/preference_recommend_tip"/>
2338

2439
<LinearLayout
2540
android:id="@+id/line_layout"
@@ -28,18 +43,7 @@
2843
android:layout_marginBottom="@dimen/preference_recommend_region_margin"
2944
android:background="@drawable/preference_recommend_background"
3045
android:orientation="vertical"
31-
android:paddingBottom="@dimen/preference_recommend_region_padding_bottom">
32-
33-
<TextView
34-
android:id="@+id/recommend_tip"
35-
android:layout_width="wrap_content"
36-
android:layout_height="wrap_content"
37-
android:layout_marginHorizontal="@dimen/preference_recommend_title_margin_horizontal"
38-
android:layout_marginTop="@dimen/preference_recommend_title_margin_top"
39-
android:layout_marginBottom="@dimen/preference_recommend_title_margin_bottom"
40-
android:text="@string/preference_recommend_tip"
41-
android:textColor="@color/preference_recommend_title_color"
42-
android:textSize="@dimen/miuix_appcompat_normal_text_size" />
46+
android:paddingVertical="@dimen/preference_recommend_region_padding_bottom">
4347

4448
</LinearLayout>
4549

library/core/src/main/res/values/dimens_app.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
<!-- Default screen margins, per the Android Design guidelines. -->
4545
<dimen name="miuix_appcompat_searchbar_result_margin_top">54dp</dimen>
46-
<dimen name="preference_recommend_radius">13.089998dp</dimen>
46+
<dimen name="preference_recommend_radius">16dp</dimen>
4747
<dimen name="preference_recommend_region_margin">12dp</dimen>
4848
<dimen name="preference_recommend_region_padding_bottom">4dp</dimen>
4949
<dimen name="preference_recommend_title_margin_top">22.549988dp</dimen>

0 commit comments

Comments
 (0)