Skip to content

Commit a60ea0f

Browse files
committed
Support corner Rtl
1 parent 9e79135 commit a60ea0f

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

library/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
defaultConfig {
99
minSdkVersion 14
1010
targetSdkVersion 28
11-
versionCode 33
12-
versionName "support.v0.0.9"
11+
versionCode 34
12+
versionName "support.v0.0.10"
1313
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1414
}
1515
buildTypes {

library/src/main/java/com/ruffian/library/widget/helper/RBaseHelper.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,14 +1383,15 @@ private void setRadius() {
13831383
mBorderRadii[6] = mCornerRadius;
13841384
mBorderRadii[7] = mCornerRadius;
13851385
} else {
1386-
mBorderRadii[0] = mCornerRadiusTopLeft;
1387-
mBorderRadii[1] = mCornerRadiusTopLeft;
1388-
mBorderRadii[2] = mCornerRadiusTopRight;
1389-
mBorderRadii[3] = mCornerRadiusTopRight;
1390-
mBorderRadii[4] = mCornerRadiusBottomRight;
1391-
mBorderRadii[5] = mCornerRadiusBottomRight;
1392-
mBorderRadii[6] = mCornerRadiusBottomLeft;
1393-
mBorderRadii[7] = mCornerRadiusBottomLeft;
1386+
boolean isRtl = isRtl();
1387+
mBorderRadii[0] = isRtl ? mCornerRadiusTopRight : mCornerRadiusTopLeft;
1388+
mBorderRadii[1] = isRtl ? mCornerRadiusTopRight : mCornerRadiusTopLeft;
1389+
mBorderRadii[2] = isRtl ? mCornerRadiusTopLeft : mCornerRadiusTopRight;
1390+
mBorderRadii[3] = isRtl ? mCornerRadiusTopLeft : mCornerRadiusTopRight;
1391+
mBorderRadii[4] = isRtl ? mCornerRadiusBottomLeft : mCornerRadiusBottomRight;
1392+
mBorderRadii[5] = isRtl ? mCornerRadiusBottomLeft : mCornerRadiusBottomRight;
1393+
mBorderRadii[6] = isRtl ? mCornerRadiusBottomRight : mCornerRadiusBottomLeft;
1394+
mBorderRadii[7] = isRtl ? mCornerRadiusBottomRight : mCornerRadiusBottomLeft;
13941395
}
13951396
mBackgroundNormal.setCornerRadii(mBorderRadii);
13961397
mBackgroundPressed.setCornerRadii(mBorderRadii);

0 commit comments

Comments
 (0)