WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 8e439b7

Browse files
committed
Feature - RTL Support (#844)
1 parent 7562372 commit 8e439b7

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

library/src/main/java/com/prolificinteractive/materialcalendarview/CalendarPagerView.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ public CalendarPagerView(
5555
setClipChildren(false);
5656
setClipToPadding(false);
5757

58-
if (LocalUtils.isRTL()) {
59-
this.setRotationY(180);
60-
}
61-
6258
if (showWeekDays) {
6359
buildWeekDays(resetAndGetWorkingCalendar());
6460
}
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
package com.prolificinteractive.materialcalendarview;
22

3+
import android.support.v4.text.TextUtilsCompat;
4+
import android.support.v4.view.ViewCompat;
35
import java.util.Locale;
46

57
class LocalUtils {
68

79
private LocalUtils() { }
810

911
static boolean isRTL() {
10-
return isRTL(Locale.getDefault());
11-
}
12-
13-
private static boolean isRTL(Locale locale) {
14-
final int directionality = Character.getDirectionality(locale.getDisplayName().charAt(0));
15-
return directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT ||
16-
directionality == Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
12+
return TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault())
13+
== ViewCompat.LAYOUT_DIRECTION_RTL;
1714
}
1815
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:height="24dp"
3+
android:viewportHeight="24.0"
4+
android:viewportWidth="24.0"
5+
android:width="24dp"
6+
>
7+
<path
8+
android:fillColor="#000000"
9+
android:pathData="M15.41,7.41L14,6l-6,6 6,6 1.41,-1.41L10.83,12z"
10+
/>
11+
</vector>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:height="24dp"
3+
android:viewportHeight="24.0"
4+
android:viewportWidth="24.0"
5+
android:width="24dp"
6+
>
7+
<path
8+
android:fillColor="#000000"
9+
android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"
10+
/>
11+
</vector>

0 commit comments

Comments
 (0)