Skip to content

Commit 495fe20

Browse files
committed
Added a sample for RTL
1 parent 0d93f77 commit 495fe20

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:width="24dp"
4+
android:height="24dp"
5+
android:viewportHeight="24.0"
6+
android:viewportWidth="24.0">
7+
<path
8+
android:fillColor="#000000"
9+
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z" />
10+
</vector>

sample/src/main/res/layout/activity_main.xml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent"
67
android:background="#eaeaea"
@@ -24,7 +25,8 @@
2425
app:cit_drawableRight="@drawable/ic_android_black_24dp"
2526
app:cit_iconColor="#fff"
2627
app:cit_iconHeight="4dp"
27-
app:cit_iconWidth="4dp" />
28+
app:cit_iconWidth="4dp"
29+
tools:ignore="HardcodedText" />
2830

2931
<com.github.aakira.compoundicontextview.CompoundIconTextView
3032
android:id="@+id/compoundIconTextView2"
@@ -40,7 +42,8 @@
4042
app:cit_drawableRight="@drawable/ic_cloud_download_black_24px"
4143
app:cit_iconColor="#1565C0"
4244
app:cit_iconHeight="@dimen/icon_size"
43-
app:cit_iconWidth="@dimen/icon_size" />
45+
app:cit_iconWidth="@dimen/icon_size"
46+
tools:ignore="HardcodedText" />
4447

4548
<com.github.aakira.compoundicontextview.CompoundIconTextView
4649
android:layout_width="wrap_content"
@@ -54,7 +57,8 @@
5457
app:cit_drawableRight="@drawable/ic_volume_up_black_24px"
5558
app:cit_iconColor="#00695C"
5659
app:cit_iconHeight="@dimen/icon_size"
57-
app:cit_iconWidth="@dimen/icon_size" />
60+
app:cit_iconWidth="@dimen/icon_size"
61+
tools:ignore="HardcodedText" />
5862

5963
<com.github.aakira.compoundicontextview.CompoundIconTextView
6064
android:layout_width="wrap_content"
@@ -68,7 +72,8 @@
6872
app:cit_drawableTop="@drawable/ic_call_end_black_24px"
6973
app:cit_iconColor="#558B2F"
7074
app:cit_iconHeight="@dimen/icon_size"
71-
app:cit_iconWidth="@dimen/icon_size" />
75+
app:cit_iconWidth="@dimen/icon_size"
76+
tools:ignore="HardcodedText" />
7277

7378
<com.github.aakira.compoundicontextview.CompoundIconTextView
7479
android:layout_width="wrap_content"
@@ -82,5 +87,20 @@
8287
app:cit_drawableBottom="@drawable/ic_train_black_24px"
8388
app:cit_iconColor="#EF6C00"
8489
app:cit_iconHeight="@dimen/icon_size"
90+
app:cit_iconWidth="@dimen/icon_size"
91+
tools:ignore="HardcodedText" />
92+
93+
<com.github.aakira.compoundicontextview.CompoundIconTextView
94+
android:layout_width="wrap_content"
95+
android:layout_height="wrap_content"
96+
android:layout_marginTop="@dimen/margin_x_large"
97+
android:drawablePadding="@dimen/margin_small"
98+
android:gravity="center"
99+
android:text="@string/right_to_left"
100+
android:textColor="#795548"
101+
android:textSize="@dimen/text_large"
102+
app:cit_drawableStart="@drawable/ic_language_black_24px"
103+
app:cit_iconColor="#4E342E"
104+
app:cit_iconHeight="@dimen/icon_size"
85105
app:cit_iconWidth="@dimen/icon_size" />
86106
</LinearLayout>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="right_to_left">من اليمين الى اليسار</string>
3+
</resources>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<resources>
2-
<string name="app_name">CompoundIconTextView</string>
2+
<string name="app_name" translatable="false">CompoundIconTextView</string>
3+
<string name="right_to_left">Right to Left (in Arabic)</string>
34
</resources>

0 commit comments

Comments
 (0)