Skip to content

Commit cefb75a

Browse files
committed
修复部分页面rtl布局下的显示问题
1 parent d180967 commit cefb75a

13 files changed

+64
-52
lines changed

app/src/main/res/layout/adapter_eleme_secondary_grid.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,24 @@
2828
android:layout_height="100dp"
2929
android:layout_margin="10dp"
3030
android:src="@drawable/bg_food_sample"
31-
app:layout_constraintLeft_toLeftOf="parent"
32-
app:layout_constraintRight_toRightOf="parent"
31+
app:layout_constraintEnd_toEndOf="parent"
32+
app:layout_constraintStart_toStartOf="parent"
3333
app:layout_constraintTop_toTopOf="parent" />
3434

3535
<TextView
3636
android:id="@+id/iv_goods_name"
3737
style="@style/TextStyle.Title"
3838
android:layout_marginTop="@dimen/margin4"
3939
android:textStyle="bold"
40-
app:layout_constraintLeft_toLeftOf="@+id/iv_goods_img"
40+
app:layout_constraintStart_toStartOf="@+id/iv_goods_img"
4141
app:layout_constraintTop_toBottomOf="@+id/iv_goods_img"
4242
tools:text="水果" />
4343

4444
<TextView
4545
android:id="@+id/iv_goods_detail"
4646
style="@style/TextStyle.Explain"
4747
android:text="爆款"
48-
app:layout_constraintLeft_toLeftOf="@+id/iv_goods_img"
48+
app:layout_constraintStart_toStartOf="@+id/iv_goods_img"
4949
app:layout_constraintTop_toBottomOf="@+id/iv_goods_name" />
5050

5151
<TextView
@@ -57,7 +57,7 @@
5757
android:textColor="@color/color_red"
5858
android:textSize="17sp"
5959
android:textStyle="bold"
60-
app:layout_constraintLeft_toLeftOf="@+id/iv_goods_img"
60+
app:layout_constraintStart_toStartOf="@+id/iv_goods_img"
6161
app:layout_constraintTop_toBottomOf="@+id/iv_goods_detail" />
6262

6363
<androidx.appcompat.widget.AppCompatImageView
@@ -66,7 +66,7 @@
6666
android:layout_height="wrap_content"
6767
android:layout_marginEnd="10dp"
6868
android:src="@drawable/btn_add_food"
69-
app:layout_constraintRight_toRightOf="parent"
69+
app:layout_constraintEnd_toEndOf="parent"
7070
app:layout_constraintTop_toTopOf="@+id/iv_goods_price" />
7171

7272
</androidx.constraintlayout.widget.ConstraintLayout>

app/src/main/res/layout/adapter_eleme_secondary_linear.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,30 @@
2222
android:layout_width="match_parent"
2323
android:layout_height="100dp">
2424

25-
<ImageView
25+
<androidx.appcompat.widget.AppCompatImageView
2626
android:id="@+id/iv_goods_img"
2727
android:layout_width="80dp"
2828
android:layout_height="80dp"
2929
android:layout_marginStart="10dp"
3030
android:src="@drawable/bg_food_sample"
3131
app:layout_constraintBottom_toBottomOf="parent"
32-
app:layout_constraintLeft_toLeftOf="parent"
32+
app:layout_constraintStart_toStartOf="parent"
3333
app:layout_constraintTop_toTopOf="parent" />
3434

35-
<ImageView
35+
<androidx.appcompat.widget.AppCompatImageView
3636
android:id="@+id/iv_goods_img_tip"
3737
android:layout_width="wrap_content"
3838
android:layout_height="wrap_content"
3939
android:src="@drawable/tag_new_good"
40-
app:layout_constraintLeft_toLeftOf="@+id/iv_goods_img"
40+
app:layout_constraintStart_toStartOf="@+id/iv_goods_img"
4141
app:layout_constraintTop_toTopOf="@+id/iv_goods_img" />
4242

4343
<TextView
4444
android:id="@+id/iv_goods_name"
4545
style="@style/TextStyle.Title"
4646
android:layout_marginStart="10dp"
4747
android:textStyle="bold"
48-
app:layout_constraintLeft_toRightOf="@+id/iv_goods_img"
48+
app:layout_constraintStart_toEndOf="@+id/iv_goods_img"
4949
app:layout_constraintTop_toTopOf="@+id/iv_goods_img"
5050
tools:text="水果" />
5151

@@ -56,7 +56,7 @@
5656
android:text="好吃的食物,增肥神器,有求必应"
5757
android:textColor="@color/colorGray"
5858
android:textSize="10sp"
59-
app:layout_constraintLeft_toLeftOf="@+id/iv_goods_name"
59+
app:layout_constraintStart_toStartOf="@+id/iv_goods_name"
6060
app:layout_constraintTop_toBottomOf="@+id/iv_goods_name" />
6161

6262
<TextView
@@ -66,7 +66,7 @@
6666
android:text="月售1023 好评率90%"
6767
android:textColor="@color/colorGray"
6868
android:textSize="10sp"
69-
app:layout_constraintLeft_toLeftOf="@+id/iv_goods_name"
69+
app:layout_constraintStart_toStartOf="@+id/iv_goods_name"
7070
app:layout_constraintTop_toBottomOf="@+id/iv_goods_detail" />
7171

7272
<TextView
@@ -78,16 +78,16 @@
7878
android:textColor="@color/color_red"
7979
android:textSize="16sp"
8080
android:textStyle="bold"
81-
app:layout_constraintLeft_toLeftOf="@+id/iv_goods_name"
81+
app:layout_constraintStart_toStartOf="@+id/iv_goods_name"
8282
app:layout_constraintTop_toBottomOf="@+id/iv_goods_comment" />
8383

84-
<ImageView
84+
<androidx.appcompat.widget.AppCompatImageView
8585
android:id="@+id/iv_goods_add"
8686
android:layout_width="wrap_content"
8787
android:layout_height="wrap_content"
8888
android:layout_margin="10dp"
8989
android:src="@drawable/btn_add_food"
9090
app:layout_constraintBottom_toBottomOf="parent"
91-
app:layout_constraintRight_toRightOf="parent" />
91+
app:layout_constraintEnd_toEndOf="parent" />
9292

9393
</androidx.constraintlayout.widget.ConstraintLayout>

app/src/main/res/layout/fragment_custom_edittext.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@
2626
android:id="@+id/clearEditText"
2727
android:layout_width="match_parent"
2828
android:layout_height="wrap_content"
29-
android:layout_margin="5dp" />
29+
android:layout_margin="5dp"
30+
android:hint="请输入内容..."
31+
android:textAlignment="viewStart" />
3032

3133
<com.xuexiang.xui.widget.edittext.ClearEditText
3234
android:id="@+id/clearEditText1"
3335
android:layout_width="match_parent"
3436
android:layout_height="wrap_content"
3537
android:layout_margin="5dp"
38+
android:hint="请输入内容..."
3639
app:cet_clearIcon="@drawable/icon_clear"
3740
app:cet_clearIconSize="@dimen/default_clear_icon_size" />
3841

@@ -49,7 +52,8 @@
4952
android:layout_margin="5dp"
5053
android:layout_marginTop="16dp"
5154
android:gravity="start"
52-
android:textAlignment="viewStart">
55+
android:textAlignment="viewStart"
56+
android:textDirection="locale">
5357

5458
<com.xuexiang.xui.widget.edittext.PasswordEditText
5559
android:id="@+id/input_password"
@@ -58,6 +62,7 @@
5862
android:gravity="start"
5963
android:hint="输入密码"
6064
android:inputType="textPassword"
65+
android:layoutDirection="locale"
6166
android:textAlignment="viewStart"
6267
app:pet_enableIconAlpha="true"
6368
app:pet_isAsteriskStyle="true" />
@@ -72,6 +77,7 @@
7277
android:gravity="start"
7378
android:hint="重复密码"
7479
android:inputType="textPassword"
80+
android:layoutDirection="locale"
7581
android:textAlignment="viewStart"
7682
app:fontPath="fonts/Roboto-Thin.ttf"
7783
app:pet_enableIconAlpha="true"

app/src/main/res/layout/fragment_guide_case_queue.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<com.xuexiang.xui.widget.alpha.XUIAlphaButton
88
android:id="@+id/step1"
99
style="@style/Button.Primary.wrap"
10-
android:layout_marginTop="20dp"
1110
android:layout_marginStart="20dp"
11+
android:layout_marginTop="20dp"
1212
android:text="步骤1" />
1313

1414
<com.xuexiang.xui.widget.alpha.XUIAlphaButton
1515
android:id="@+id/step2"
1616
style="@style/Button.Primary.wrap"
17-
android:layout_gravity="right"
17+
android:layout_gravity="end"
1818
android:layout_marginTop="20dp"
1919
android:layout_marginEnd="40dp"
2020
android:text="步骤2" />
@@ -23,24 +23,24 @@
2323
<com.xuexiang.xui.widget.alpha.XUIAlphaButton
2424
android:id="@+id/step3"
2525
style="@style/Button.Primary.wrap"
26-
android:layout_gravity="right"
26+
android:layout_gravity="end"
2727
android:layout_marginTop="20dp"
2828
android:layout_marginEnd="40dp"
2929
android:text="步骤3" />
3030

3131
<com.xuexiang.xui.widget.alpha.XUIAlphaButton
3232
android:id="@+id/step4"
3333
style="@style/Button.Primary.wrap"
34-
android:layout_gravity="right"
34+
android:layout_gravity="end"
3535
android:layout_marginTop="20dp"
3636
android:layout_marginEnd="40dp"
3737
android:text="步骤4" />
3838

3939
<com.xuexiang.xui.widget.alpha.XUIAlphaButton
4040
android:id="@+id/changePicture"
4141
style="@style/Button.Primary.wrap"
42-
android:layout_marginTop="20dp"
4342
android:layout_marginStart="20dp"
43+
android:layout_marginTop="20dp"
4444
android:text="更换图片" />
4545

4646
</LinearLayout>

app/src/main/res/layout/fragment_material_progress_bar.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
style="?android:progressBarStyleLarge"
195195
android:layout_width="wrap_content"
196196
android:layout_height="wrap_content"
197-
android:layout_gravity="left|bottom"
197+
android:layout_gravity="start|bottom"
198198
android:indeterminate="true" />
199199

200200
<ProgressBar
@@ -208,7 +208,7 @@
208208
style="?android:progressBarStyleSmall"
209209
android:layout_width="wrap_content"
210210
android:layout_height="wrap_content"
211-
android:layout_gravity="right|bottom"
211+
android:layout_gravity="end|bottom"
212212
android:indeterminate="true" />
213213
</FrameLayout>
214214

@@ -226,7 +226,7 @@
226226
style="@style/Widget.MaterialProgressBar.ProgressBar.Large"
227227
android:layout_width="wrap_content"
228228
android:layout_height="wrap_content"
229-
android:layout_gravity="left|bottom"
229+
android:layout_gravity="start|bottom"
230230
android:indeterminate="true" />
231231

232232
<com.xuexiang.xui.widget.progress.materialprogressbar.MaterialProgressBar
@@ -240,7 +240,7 @@
240240
style="@style/Widget.MaterialProgressBar.ProgressBar.Small"
241241
android:layout_width="wrap_content"
242242
android:layout_height="wrap_content"
243-
android:layout_gravity="right|bottom"
243+
android:layout_gravity="end|bottom"
244244
android:indeterminate="true" />
245245
</FrameLayout>
246246

app/src/main/res/layout/fragment_searchview.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<!--
1+
<?xml version="1.0" encoding="utf-8"?><!--
32
~ Copyright (C) 2019 xuexiangjys(xuexiangjys@163.com)
43
~
54
~ Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,7 +27,7 @@
2827
android:id="@+id/fab"
2928
android:layout_width="wrap_content"
3029
android:layout_height="wrap_content"
31-
android:layout_gravity="bottom|right"
30+
android:layout_gravity="bottom|end"
3231
android:layout_margin="?attr/xui_config_content_spacing_horizontal"
3332
android:src="@drawable/ic_action_search_white" />
3433

app/src/main/res/layout/fragment_super_button.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
android:layout_width="100dp"
146146
android:layout_height="wrap_content"
147147
android:layout_marginBottom="10dp"
148-
android:layout_toRightOf="@+id/super_btn1"
148+
android:layout_toEndOf="@+id/super_btn1"
149149
android:text="右上圆角"
150150
app:sCornersTopRightRadius="20dp"
151151
app:sStrokeColor="@color/colorPrimary"
@@ -169,7 +169,7 @@
169169
android:layout_height="wrap_content"
170170
android:layout_below="@+id/super_btn2"
171171
android:layout_marginBottom="10dp"
172-
android:layout_toRightOf="@+id/super_btn3"
172+
android:layout_toEndOf="@+id/super_btn3"
173173
android:text="右下圆角"
174174
app:sCornersBottomRightRadius="20dp"
175175
app:sStrokeColor="@color/colorPrimary"

app/src/main/res/layout/fragment_toolbar.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
android:layout_width="match_parent"
1212
android:layout_height="wrap_content"
1313
android:layout_marginTop="10dp"
14-
android:theme="@style/ToolbarTheme"
15-
android:background="@color/colorPrimary">
14+
android:background="@color/colorPrimary"
15+
android:theme="@style/ToolbarTheme">
1616

1717
<TextView
1818
android:layout_width="wrap_content"
1919
android:layout_height="wrap_content"
20-
android:gravity="right"
20+
android:gravity="end"
2121
android:text="View"
2222
android:textColor="@color/white"
2323
android:textSize="14sp" />
@@ -49,8 +49,8 @@
4949
android:id="@+id/tool_bar_4"
5050
style="@style/ToolbarStyle"
5151
android:layout_marginTop="10dp"
52-
app:navigationIcon="@drawable/ic_navigation_back_white"
53-
android:theme="@style/ToolbarTheme">
52+
android:theme="@style/ToolbarTheme"
53+
app:navigationIcon="@drawable/ic_navigation_back_white">
5454

5555
<EditText
5656
android:id="@+id/edit_search"

app/src/main/res/layout/layout_constraintset_big.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
android:scaleType="centerCrop"
3838
android:src="@drawable/img_beautiful_scenery"
3939
app:layout_constraintDimensionRatio="h,16:9"
40-
app:layout_constraintLeft_toLeftOf="parent"
41-
app:layout_constraintRight_toRightOf="parent"
42-
app:layout_constraintTop_toTopOf="parent"/>
40+
app:layout_constraintEnd_toEndOf="parent"
41+
app:layout_constraintStart_toStartOf="parent"
42+
app:layout_constraintTop_toTopOf="parent" />
4343

4444
<TextView
4545
android:id="@+id/tv_title"
@@ -48,7 +48,7 @@
4848
android:layout_marginTop="8dp"
4949
android:text="@string/lake_tahoe_title"
5050
android:textSize="30sp"
51-
app:layout_constraintLeft_toLeftOf="@id/iv_content"
51+
app:layout_constraintStart_toStartOf="@id/iv_content"
5252
app:layout_constraintTop_toBottomOf="@id/iv_content" />
5353

5454
<TextView
@@ -59,9 +59,9 @@
5959
android:layout_marginBottom="16dp"
6060
android:text="@string/lake_description"
6161
app:layout_constraintBottom_toBottomOf="parent"
62+
app:layout_constraintEnd_toEndOf="@id/iv_content"
6263
app:layout_constraintHorizontal_bias="0.0"
63-
app:layout_constraintLeft_toLeftOf="@id/tv_title"
64-
app:layout_constraintRight_toRightOf="@id/iv_content"
64+
app:layout_constraintStart_toStartOf="@id/tv_title"
6565
app:layout_constraintTop_toBottomOf="@id/tv_title"
6666
app:layout_constraintVertical_bias="0.0" />
6767

app/src/main/res/layout/layout_constraintset_normal.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
android:src="@drawable/img_beautiful_scenery"
3838
app:layout_constraintBottom_toBottomOf="@id/tv_title"
3939
app:layout_constraintDimensionRatio="w,16:9"
40-
app:layout_constraintLeft_toLeftOf="parent"
40+
app:layout_constraintStart_toStartOf="parent"
4141
app:layout_constraintTop_toTopOf="@id/tv_title"
4242
app:layout_constraintVertical_bias="0.0"
4343
tools:layout_constraintBottom_creator="1"
@@ -51,7 +51,7 @@
5151
android:layout_marginTop="16dp"
5252
android:text="@string/lake_tahoe_title"
5353
android:textSize="30sp"
54-
app:layout_constraintLeft_toRightOf="@id/iv_content"
54+
app:layout_constraintStart_toEndOf="@id/iv_content"
5555
app:layout_constraintTop_toTopOf="parent" />
5656

5757
<TextView
@@ -64,8 +64,8 @@
6464
android:layout_marginBottom="8dp"
6565
android:text="@string/lake_description"
6666
app:layout_constraintBottom_toBottomOf="parent"
67-
app:layout_constraintLeft_toLeftOf="parent"
68-
app:layout_constraintRight_toRightOf="parent"
67+
app:layout_constraintEnd_toEndOf="parent"
68+
app:layout_constraintStart_toStartOf="parent"
6969
app:layout_constraintTop_toBottomOf="@id/iv_content"
7070
tools:layout_constraintBottom_creator="1"
7171
tools:layout_constraintLeft_creator="1"

0 commit comments

Comments
 (0)