Skip to content

Commit

Permalink
Support conner Rtl
Browse files Browse the repository at this point in the history
  • Loading branch information
RuffianZhong committed Apr 25, 2022
1 parent 2b32322 commit 5f114d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 12
versionName "androidx.v0.0.9"
versionCode 13
versionName "androidx.v0.0.10"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1384,14 +1384,15 @@ private void setRadius() {
mBorderRadii[6] = mCornerRadius;
mBorderRadii[7] = mCornerRadius;
} else {
mBorderRadii[0] = mCornerRadiusTopLeft;
mBorderRadii[1] = mCornerRadiusTopLeft;
mBorderRadii[2] = mCornerRadiusTopRight;
mBorderRadii[3] = mCornerRadiusTopRight;
mBorderRadii[4] = mCornerRadiusBottomRight;
mBorderRadii[5] = mCornerRadiusBottomRight;
mBorderRadii[6] = mCornerRadiusBottomLeft;
mBorderRadii[7] = mCornerRadiusBottomLeft;
boolean isRtl = isRtl();
mBorderRadii[0] = isRtl ? mCornerRadiusTopRight : mCornerRadiusTopLeft;
mBorderRadii[1] = isRtl ? mCornerRadiusTopRight : mCornerRadiusTopLeft;
mBorderRadii[2] = isRtl ? mCornerRadiusTopLeft : mCornerRadiusTopRight;
mBorderRadii[3] = isRtl ? mCornerRadiusTopLeft : mCornerRadiusTopRight;
mBorderRadii[4] = isRtl ? mCornerRadiusBottomLeft : mCornerRadiusBottomRight;
mBorderRadii[5] = isRtl ? mCornerRadiusBottomLeft : mCornerRadiusBottomRight;
mBorderRadii[6] = isRtl ? mCornerRadiusBottomRight : mCornerRadiusBottomLeft;
mBorderRadii[7] = isRtl ? mCornerRadiusBottomRight : mCornerRadiusBottomLeft;
}
mBackgroundNormal.setCornerRadii(mBorderRadii);
mBackgroundPressed.setCornerRadii(mBorderRadii);
Expand Down

0 comments on commit 5f114d9

Please sign in to comment.