summaryrefslogtreecommitdiff
path: root/core/java/android/widget/SmartSelectSprite.java
diff options
context:
space:
mode:
authorPetar Šegina <psegina@google.com>2017-08-31 12:25:41 +0100
committerPetar Šegina <psegina@google.com>2017-08-31 15:03:18 +0100
commit0d37b1a71de5befe6f57eebcd10dbb62e282f57a (patch)
treebb38e74ad930b5e05ba5316bd80f1f59b5f44494 /core/java/android/widget/SmartSelectSprite.java
parent4b950cf674c7215de3c7ab650c9eb7c82fb47569 (diff)
Rename roundPercentage to roundRatio
Test: manual - verify smart select animation still works Change-Id: Ic63236a47563b2daef57eeb52dd4fdbbb2cb1780
Diffstat (limited to 'core/java/android/widget/SmartSelectSprite.java')
-rw-r--r--core/java/android/widget/SmartSelectSprite.java23
1 files changed, 11 insertions, 12 deletions
diff --git a/core/java/android/widget/SmartSelectSprite.java b/core/java/android/widget/SmartSelectSprite.java
index 844c714b729a..877e4b60cf5b 100644
--- a/core/java/android/widget/SmartSelectSprite.java
+++ b/core/java/android/widget/SmartSelectSprite.java
@@ -110,7 +110,7 @@ final class SmartSelectSprite {
*/
private static final class RoundedRectangleShape extends Shape {
- private static final String PROPERTY_ROUND_PERCENTAGE = "roundPercentage";
+ private static final String PROPERTY_ROUND_RATIO = "roundRatio";
@Retention(SOURCE)
@IntDef({ExpansionDirection.LEFT, ExpansionDirection.CENTER, ExpansionDirection.RIGHT})
@@ -134,7 +134,7 @@ final class SmartSelectSprite {
private final float mStrokeWidth;
private final RectF mBoundingRectangle;
- private float mRoundPercentage = 1.0f;
+ private float mRoundRatio = 1.0f;
private final @ExpansionDirection int mExpansionDirection;
private final @RectangleBorderType int mRectangleBorderType;
@@ -158,9 +158,9 @@ final class SmartSelectSprite {
mStrokeWidth = strokeWidth;
if (boundingRectangle.height() > boundingRectangle.width()) {
- setRoundPercentage(0.0f);
+ setRoundRatio(0.0f);
} else {
- setRoundPercentage(1.0f);
+ setRoundRatio(1.0f);
}
}
@@ -218,13 +218,12 @@ final class SmartSelectSprite {
canvas.restore();
}
- public void setRoundPercentage(
- @FloatRange(from = 0.0, to = 1.0) final float newPercentage) {
- mRoundPercentage = newPercentage;
+ public void setRoundRatio(@FloatRange(from = 0.0, to = 1.0) final float roundRatio) {
+ mRoundRatio = roundRatio;
}
- public float getRoundPercentage() {
- return mRoundPercentage;
+ public float getRoundRatio() {
+ return mRoundRatio;
}
private void setLeftBoundary(final float leftBoundary) {
@@ -240,7 +239,7 @@ final class SmartSelectSprite {
}
private float getAdjustedCornerRadius() {
- return (getCornerRadius() * mRoundPercentage);
+ return (getCornerRadius() * mRoundRatio);
}
private float getBoundingWidth() {
@@ -583,8 +582,8 @@ final class SmartSelectSprite {
final ValueAnimator.AnimatorUpdateListener listener) {
final ObjectAnimator animator = ObjectAnimator.ofFloat(
shape,
- RoundedRectangleShape.PROPERTY_ROUND_PERCENTAGE,
- shape.getRoundPercentage(), 0.0F);
+ RoundedRectangleShape.PROPERTY_ROUND_RATIO,
+ shape.getRoundRatio(), 0.0F);
animator.setDuration(CORNER_DURATION);
animator.addUpdateListener(listener);
animator.setInterpolator(mCornerInterpolator);