Skip to content

Commit 3b32596

Browse files
committed
fix(rtl-layout): Mirror arrow buttons in rtl layout
The attribute android:autoMirrored="true" requires API level 19, we therefore have to create a dedicated layout. Fixes #657
1 parent 8fb53c2 commit 3b32596

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent" android:layout_height="match_parent">
4+
<ImageButton
5+
android:id="@+id/mdtp_previous_month_arrow"
6+
android:layout_width="wrap_content"
7+
android:layout_height="wrap_content"
8+
android:minWidth="48dp"
9+
android:minHeight="48dp"
10+
android:src="@drawable/mdtp_ic_chevron_right_black_24dp"
11+
android:background="@drawable/mdtp_month_arrow_background"
12+
android:visibility="invisible"
13+
android:nextFocusForward="@+id/mdtp_next_month_arrow"
14+
android:contentDescription="@string/mdtp_previous_month_arrow_description"/>
15+
<ImageButton
16+
android:id="@+id/mdtp_next_month_arrow"
17+
android:layout_width="wrap_content"
18+
android:layout_height="wrap_content"
19+
android:minWidth="48dp"
20+
android:minHeight="48dp"
21+
android:src="@drawable/mdtp_ic_chevron_left_black_24dp"
22+
android:background="@drawable/mdtp_month_arrow_background"
23+
android:visibility="invisible"
24+
android:contentDescription="@string/mdtp_next_month_arrow_description"/>
25+
</FrameLayout>

sample/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
android:allowBackup="true"
77
android:icon="@mipmap/ic_launcher"
88
android:label="@string/app_name"
9-
android:theme="@style/AppTheme" >
9+
android:theme="@style/AppTheme"
10+
android:supportsRtl="true">
1011
<activity
1112
android:name=".MainActivity"
1213
android:label="@string/title_activity_main" >

0 commit comments

Comments
 (0)