| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.android.wm.shell.bubbles; |
| 18 |
|
| 19 |
import static android.graphics.Paint.ANTI_ALIAS_FLAG; |
| 20 |
import static android.graphics.Paint.FILTER_BITMAP_FLAG; |
| 21 |
|
| 22 |
import static com.android.wm.shell.animation.Interpolators.ALPHA_IN; |
| 23 |
import static com.android.wm.shell.animation.Interpolators.ALPHA_OUT; |
| 24 |
|
| 25 |
import android.animation.ArgbEvaluator; |
| 26 |
import android.content.Context; |
| 27 |
import android.content.res.Resources; |
| 28 |
import android.content.res.TypedArray; |
| 29 |
import android.graphics.Canvas; |
| 30 |
import android.graphics.Color; |
| 31 |
import android.graphics.Matrix; |
| 32 |
import android.graphics.Outline; |
| 33 |
import android.graphics.Paint; |
| 34 |
import android.graphics.Path; |
| 35 |
import android.graphics.PointF; |
| 36 |
import android.graphics.RectF; |
| 37 |
import android.graphics.drawable.Drawable; |
| 38 |
import android.graphics.drawable.ShapeDrawable; |
| 39 |
import android.text.TextUtils; |
| 40 |
import android.util.TypedValue; |
| 41 |
import android.view.LayoutInflater; |
| 42 |
import android.view.View; |
| 43 |
import android.view.ViewGroup; |
| 44 |
import android.view.ViewOutlineProvider; |
| 45 |
import android.widget.FrameLayout; |
| 46 |
import android.widget.ImageView; |
| 47 |
import android.widget.TextView; |
| 48 |
|
| 49 |
import androidx.annotation.Nullable; |
| 50 |
|
| 51 |
import com.android.wm.shell.R; |
| 52 |
import com.android.wm.shell.common.TriangleShape; |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
public class BubbleFlyoutView extends FrameLayout { |
| 59 |
|
| 60 |
private static final float FLYOUT_FADE_Y = 40f; |
| 61 |
|
| 62 |
private static final long FLYOUT_FADE_OUT_DURATION = 150L; |
| 63 |
private static final long FLYOUT_FADE_IN_DURATION = 250L; |
| 64 |
|
| 65 |
|
| 66 |
private static final boolean SHOW_POINTER = false; |
| 67 |
|
| 68 |
private BubblePositioner mPositioner; |
| 69 |
|
| 70 |
private final int mFlyoutPadding; |
| 71 |
private final int mFlyoutSpaceFromBubble; |
| 72 |
private final int mPointerSize; |
| 73 |
private int mBubbleSize; |
| 74 |
|
| 75 |
private final int mFlyoutElevation; |
| 76 |
private final int mBubbleElevation; |
| 77 |
private final int mFloatingBackgroundColor; |
| 78 |
private final float mCornerRadius; |
| 79 |
|
| 80 |
private final ViewGroup mFlyoutTextContainer; |
| 81 |
private final ImageView mSenderAvatar; |
| 82 |
private final TextView mSenderText; |
| 83 |
private final TextView mMessageText; |
| 84 |
|
| 85 |
|
| 86 |
private float mNewDotRadius; |
| 87 |
private float mNewDotSize; |
| 88 |
private float mOriginalDotSize; |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
private final Paint mBgPaint = new Paint(ANTI_ALIAS_FLAG | FILTER_BITMAP_FLAG); |
| 95 |
private final ArgbEvaluator mArgbEvaluator = new ArgbEvaluator(); |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
private final ShapeDrawable mLeftTriangleShape; |
| 102 |
private final ShapeDrawable mRightTriangleShape; |
| 103 |
|
| 104 |
|
| 105 |
private boolean mArrowPointingLeft = true; |
| 106 |
|
| 107 |
|
| 108 |
private int mDotColor; |
| 109 |
|
| 110 |
|
| 111 |
private final Outline mTriangleOutline = new Outline(); |
| 112 |
|
| 113 |
|
| 114 |
private final RectF mBgRect = new RectF(); |
| 115 |
|
| 116 |
|
| 117 |
private float mFlyoutY = 0f; |
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
private float mPercentTransitionedToDot = 1f; |
| 125 |
private float mPercentStillFlyout = 0f; |
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
private float mFlyoutToDotWidthDelta = 0f; |
| 132 |
private float mFlyoutToDotHeightDelta = 0f; |
| 133 |
|
| 134 |
|
| 135 |
private float mTranslationXWhenDot = 0f; |
| 136 |
private float mTranslationYWhenDot = 0f; |
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
private float mBgTranslationX; |
| 143 |
private float mBgTranslationY; |
| 144 |
|
| 145 |
private float[] mDotCenter; |
| 146 |
|
| 147 |
|
| 148 |
private float mRestingTranslationX = 0f; |
| 149 |
|
| 150 |
|
| 151 |
private static final float SIZE_PERCENTAGE = 0.228f; |
| 152 |
|
| 153 |
private static final float DOT_SCALE = 1f; |
| 154 |
|
| 155 |
|
| 156 |
@Nullable private Runnable mOnHide; |
| 157 |
|
| 158 |
public BubbleFlyoutView(Context context, BubblePositioner positioner) { |
| 159 |
super(context); |
| 160 |
mPositioner = positioner; |
| 161 |
|
| 162 |
LayoutInflater.from(context).inflate(R.layout.bubble_flyout, this, true); |
| 163 |
mFlyoutTextContainer = findViewById(R.id.bubble_flyout_text_container); |
| 164 |
mSenderText = findViewById(R.id.bubble_flyout_name); |
| 165 |
mSenderAvatar = findViewById(R.id.bubble_flyout_avatar); |
| 166 |
mMessageText = mFlyoutTextContainer.findViewById(R.id.bubble_flyout_text); |
| 167 |
|
| 168 |
final Resources res = getResources(); |
| 169 |
mFlyoutPadding = res.getDimensionPixelSize(R.dimen.bubble_flyout_padding_x); |
| 170 |
mFlyoutSpaceFromBubble = res.getDimensionPixelSize(R.dimen.bubble_flyout_space_from_bubble); |
| 171 |
mPointerSize = SHOW_POINTER |
| 172 |
? res.getDimensionPixelSize(R.dimen.bubble_flyout_pointer_size) |
| 173 |
: 0; |
| 174 |
|
| 175 |
mBubbleElevation = res.getDimensionPixelSize(R.dimen.bubble_elevation); |
| 176 |
mFlyoutElevation = res.getDimensionPixelSize(R.dimen.bubble_flyout_elevation); |
| 177 |
|
| 178 |
final TypedArray ta = mContext.obtainStyledAttributes( |
| 179 |
new int[] { |
| 180 |
com.android.internal.R.attr.colorSurface, |
| 181 |
android.R.attr.dialogCornerRadius}); |
| 182 |
mFloatingBackgroundColor = ta.getColor(0, Color.WHITE); |
| 183 |
mCornerRadius = ta.getDimensionPixelSize(1, 0); |
| 184 |
ta.recycle(); |
| 185 |
|
| 186 |
|
| 187 |
setPadding(mPointerSize, 0, mPointerSize, 0); |
| 188 |
setWillNotDraw(false); |
| 189 |
setClipChildren(!SHOW_POINTER); |
| 190 |
setTranslationZ(mFlyoutElevation); |
| 191 |
setOutlineProvider(new ViewOutlineProvider() { |
| 192 |
@Override |
| 193 |
public void getOutline(View view, Outline outline) { |
| 194 |
BubbleFlyoutView.this.getOutline(outline); |
| 195 |
} |
| 196 |
}); |
| 197 |
|
| 198 |
|
| 199 |
setLayoutDirection(LAYOUT_DIRECTION_LOCALE); |
| 200 |
|
| 201 |
mBgPaint.setColor(mFloatingBackgroundColor); |
| 202 |
|
| 203 |
mLeftTriangleShape = |
| 204 |
new ShapeDrawable(TriangleShape.createHorizontal( |
| 205 |
mPointerSize, mPointerSize, true )); |
| 206 |
mLeftTriangleShape.setBounds(0, 0, mPointerSize, mPointerSize); |
| 207 |
mLeftTriangleShape.getPaint().setColor(mFloatingBackgroundColor); |
| 208 |
|
| 209 |
mRightTriangleShape = |
| 210 |
new ShapeDrawable(TriangleShape.createHorizontal( |
| 211 |
mPointerSize, mPointerSize, false )); |
| 212 |
mRightTriangleShape.setBounds(0, 0, mPointerSize, mPointerSize); |
| 213 |
mRightTriangleShape.getPaint().setColor(mFloatingBackgroundColor); |
| 214 |
} |
| 215 |
|
| 216 |
@Override |
| 217 |
protected void onDraw(Canvas canvas) { |
| 218 |
renderBackground(canvas); |
| 219 |
invalidateOutline(); |
| 220 |
super.onDraw(canvas); |
| 221 |
} |
| 222 |
|
| 223 |
void updateFontSize() { |
| 224 |
final float fontSize = mContext.getResources() |
| 225 |
.getDimensionPixelSize(com.android.internal.R.dimen.text_size_body_2_material); |
| 226 |
mMessageText.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize); |
| 227 |
mSenderText.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize); |
| 228 |
} |
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
void animateUpdate(Bubble.FlyoutMessage flyoutMessage, PointF stackPos, |
| 234 |
boolean hideDot, float[] dotCenter, Runnable onHide) { |
| 235 |
mOnHide = onHide; |
| 236 |
mDotCenter = dotCenter; |
| 237 |
final Runnable afterFadeOut = () -> { |
| 238 |
updateFlyoutMessage(flyoutMessage); |
| 239 |
|
| 240 |
post(() -> { |
| 241 |
fade(true , stackPos, hideDot, () -> {} ); |
| 242 |
} ); |
| 243 |
}; |
| 244 |
fade(false , stackPos, hideDot, afterFadeOut); |
| 245 |
} |
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
private void fade(boolean in, PointF stackPos, boolean hideDot, Runnable afterFade) { |
| 251 |
mFlyoutY = stackPos.y + (mBubbleSize - mFlyoutTextContainer.getHeight()) / 2f; |
| 252 |
|
| 253 |
setAlpha(in ? 0f : 1f); |
| 254 |
setTranslationY(in ? mFlyoutY + FLYOUT_FADE_Y : mFlyoutY); |
| 255 |
updateFlyoutX(stackPos.x); |
| 256 |
setTranslationX(mRestingTranslationX); |
| 257 |
updateDot(stackPos, hideDot); |
| 258 |
|
| 259 |
animate() |
| 260 |
.alpha(in ? 1f : 0f) |
| 261 |
.setDuration(in ? FLYOUT_FADE_IN_DURATION : FLYOUT_FADE_OUT_DURATION) |
| 262 |
.setInterpolator(in ? ALPHA_IN : ALPHA_OUT); |
| 263 |
animate() |
| 264 |
.translationY(in ? mFlyoutY : mFlyoutY - FLYOUT_FADE_Y) |
| 265 |
.setDuration(in ? FLYOUT_FADE_IN_DURATION : FLYOUT_FADE_OUT_DURATION) |
| 266 |
.setInterpolator(in ? ALPHA_IN : ALPHA_OUT) |
| 267 |
.withEndAction(afterFade); |
| 268 |
} |
| 269 |
|
| 270 |
private void updateFlyoutMessage(Bubble.FlyoutMessage flyoutMessage) { |
| 271 |
final Drawable senderAvatar = flyoutMessage.senderAvatar; |
| 272 |
if (senderAvatar != null && flyoutMessage.isGroupChat) { |
| 273 |
mSenderAvatar.setVisibility(VISIBLE); |
| 274 |
mSenderAvatar.setImageDrawable(senderAvatar); |
| 275 |
} else { |
| 276 |
mSenderAvatar.setVisibility(GONE); |
| 277 |
mSenderAvatar.setTranslationX(0); |
| 278 |
mMessageText.setTranslationX(0); |
| 279 |
mSenderText.setTranslationX(0); |
| 280 |
} |
| 281 |
|
| 282 |
final int maxTextViewWidth = (int) mPositioner.getMaxFlyoutSize() - mFlyoutPadding * 2; |
| 283 |
|
| 284 |
|
| 285 |
if (!TextUtils.isEmpty(flyoutMessage.senderName)) { |
| 286 |
mSenderText.setMaxWidth(maxTextViewWidth); |
| 287 |
mSenderText.setText(flyoutMessage.senderName); |
| 288 |
mSenderText.setVisibility(VISIBLE); |
| 289 |
} else { |
| 290 |
mSenderText.setVisibility(GONE); |
| 291 |
} |
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
mMessageText.setMaxWidth(maxTextViewWidth); |
| 297 |
mMessageText.setText(flyoutMessage.message); |
| 298 |
} |
| 299 |
|
| 300 |
void updateFlyoutX(float stackX) { |
| 301 |
|
| 302 |
|
| 303 |
mRestingTranslationX = mArrowPointingLeft |
| 304 |
? stackX + mBubbleSize + mFlyoutSpaceFromBubble |
| 305 |
: stackX - getWidth() - mFlyoutSpaceFromBubble; |
| 306 |
} |
| 307 |
|
| 308 |
void updateDot(PointF stackPos, boolean hideDot) { |
| 309 |
|
| 310 |
|
| 311 |
final float newDotSize = hideDot ? 0f : mNewDotSize; |
| 312 |
mFlyoutToDotWidthDelta = getWidth() - newDotSize; |
| 313 |
mFlyoutToDotHeightDelta = getHeight() - newDotSize; |
| 314 |
|
| 315 |
|
| 316 |
final float adjustmentForScaleAway = hideDot ? 0f : (mOriginalDotSize / 2f); |
| 317 |
final float dotPositionX = stackPos.x + mDotCenter[0] - adjustmentForScaleAway; |
| 318 |
final float dotPositionY = stackPos.y + mDotCenter[1] - adjustmentForScaleAway; |
| 319 |
|
| 320 |
final float distanceFromFlyoutLeftToDotCenterX = mRestingTranslationX - dotPositionX; |
| 321 |
final float distanceFromLayoutTopToDotCenterY = mFlyoutY - dotPositionY; |
| 322 |
|
| 323 |
mTranslationXWhenDot = -distanceFromFlyoutLeftToDotCenterX; |
| 324 |
mTranslationYWhenDot = -distanceFromLayoutTopToDotCenterY; |
| 325 |
} |
| 326 |
|
| 327 |
|
| 328 |
void setupFlyoutStartingAsDot( |
| 329 |
Bubble.FlyoutMessage flyoutMessage, |
| 330 |
PointF stackPos, |
| 331 |
boolean arrowPointingLeft, |
| 332 |
int dotColor, |
| 333 |
@Nullable Runnable onLayoutComplete, |
| 334 |
@Nullable Runnable onHide, |
| 335 |
float[] dotCenter, |
| 336 |
boolean hideDot) { |
| 337 |
|
| 338 |
mBubbleSize = mPositioner.getBubbleSize(); |
| 339 |
|
| 340 |
mOriginalDotSize = SIZE_PERCENTAGE * mBubbleSize; |
| 341 |
mNewDotRadius = (DOT_SCALE * mOriginalDotSize) / 2f; |
| 342 |
mNewDotSize = mNewDotRadius * 2f; |
| 343 |
|
| 344 |
updateFlyoutMessage(flyoutMessage); |
| 345 |
|
| 346 |
mArrowPointingLeft = arrowPointingLeft; |
| 347 |
mDotColor = dotColor; |
| 348 |
mOnHide = onHide; |
| 349 |
mDotCenter = dotCenter; |
| 350 |
|
| 351 |
setCollapsePercent(1f); |
| 352 |
|
| 353 |
|
| 354 |
post(() -> { |
| 355 |
|
| 356 |
mFlyoutY = |
| 357 |
stackPos.y + (mBubbleSize - mFlyoutTextContainer.getHeight()) / 2f; |
| 358 |
setTranslationY(mFlyoutY); |
| 359 |
updateFlyoutX(stackPos.x); |
| 360 |
updateDot(stackPos, hideDot); |
| 361 |
if (onLayoutComplete != null) { |
| 362 |
onLayoutComplete.run(); |
| 363 |
} |
| 364 |
}); |
| 365 |
} |
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
void hideFlyout() { |
| 373 |
if (mOnHide != null) { |
| 374 |
mOnHide.run(); |
| 375 |
mOnHide = null; |
| 376 |
} |
| 377 |
|
| 378 |
setVisibility(GONE); |
| 379 |
} |
| 380 |
|
| 381 |
|
| 382 |
void setCollapsePercent(float percentCollapsed) { |
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
if (Float.isNaN(percentCollapsed)) { |
| 387 |
return; |
| 388 |
} |
| 389 |
|
| 390 |
mPercentTransitionedToDot = Math.max(0f, Math.min(percentCollapsed, 1f)); |
| 391 |
mPercentStillFlyout = (1f - mPercentTransitionedToDot); |
| 392 |
|
| 393 |
|
| 394 |
final float translationX = mPercentTransitionedToDot |
| 395 |
* (mArrowPointingLeft ? -getWidth() : getWidth()); |
| 396 |
final float alpha = clampPercentage( |
| 397 |
(mPercentStillFlyout - (1f - BubbleStackView.FLYOUT_DRAG_PERCENT_DISMISS)) |
| 398 |
/ BubbleStackView.FLYOUT_DRAG_PERCENT_DISMISS); |
| 399 |
|
| 400 |
mMessageText.setTranslationX(translationX); |
| 401 |
mMessageText.setAlpha(alpha); |
| 402 |
|
| 403 |
mSenderText.setTranslationX(translationX); |
| 404 |
mSenderText.setAlpha(alpha); |
| 405 |
|
| 406 |
mSenderAvatar.setTranslationX(translationX); |
| 407 |
mSenderAvatar.setAlpha(alpha); |
| 408 |
|
| 409 |
|
| 410 |
setTranslationZ( |
| 411 |
mFlyoutElevation |
| 412 |
- (mFlyoutElevation - mBubbleElevation) * mPercentTransitionedToDot); |
| 413 |
invalidate(); |
| 414 |
} |
| 415 |
|
| 416 |
|
| 417 |
float getRestingTranslationX() { |
| 418 |
return mRestingTranslationX; |
| 419 |
} |
| 420 |
|
| 421 |
|
| 422 |
private float clampPercentage(float percent) { |
| 423 |
return Math.min(1f, Math.max(0f, percent)); |
| 424 |
} |
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
private void renderBackground(Canvas canvas) { |
| 431 |
|
| 432 |
|
| 433 |
final float width = getWidth() - (mFlyoutToDotWidthDelta * mPercentTransitionedToDot); |
| 434 |
final float height = getHeight() - (mFlyoutToDotHeightDelta * mPercentTransitionedToDot); |
| 435 |
final float interpolatedRadius = getInterpolatedRadius(); |
| 436 |
|
| 437 |
|
| 438 |
mBgTranslationX = mTranslationXWhenDot * mPercentTransitionedToDot; |
| 439 |
mBgTranslationY = mTranslationYWhenDot * mPercentTransitionedToDot; |
| 440 |
|
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
|
| 446 |
mBgRect.set( |
| 447 |
mPointerSize * mPercentStillFlyout , |
| 448 |
0 , |
| 449 |
width - mPointerSize * mPercentStillFlyout , |
| 450 |
height ); |
| 451 |
|
| 452 |
mBgPaint.setColor( |
| 453 |
(int) mArgbEvaluator.evaluate( |
| 454 |
mPercentTransitionedToDot, mFloatingBackgroundColor, mDotColor)); |
| 455 |
|
| 456 |
canvas.save(); |
| 457 |
canvas.translate(mBgTranslationX, mBgTranslationY); |
| 458 |
renderPointerTriangle(canvas, width, height); |
| 459 |
canvas.drawRoundRect(mBgRect, interpolatedRadius, interpolatedRadius, mBgPaint); |
| 460 |
canvas.restore(); |
| 461 |
} |
| 462 |
|
| 463 |
|
| 464 |
private void renderPointerTriangle( |
| 465 |
Canvas canvas, float currentFlyoutWidth, float currentFlyoutHeight) { |
| 466 |
if (!SHOW_POINTER) return; |
| 467 |
canvas.save(); |
| 468 |
|
| 469 |
|
| 470 |
final float retractionTranslationX = |
| 471 |
(mArrowPointingLeft ? 1 : -1) * (mPercentTransitionedToDot * mPointerSize * 2f); |
| 472 |
|
| 473 |
|
| 474 |
|
| 475 |
final float arrowTranslationX = |
| 476 |
mArrowPointingLeft |
| 477 |
? retractionTranslationX |
| 478 |
: currentFlyoutWidth - mPointerSize + retractionTranslationX; |
| 479 |
|
| 480 |
|
| 481 |
final float arrowTranslationY = currentFlyoutHeight / 2f - mPointerSize / 2f; |
| 482 |
|
| 483 |
|
| 484 |
final ShapeDrawable relevantTriangle = |
| 485 |
mArrowPointingLeft ? mLeftTriangleShape : mRightTriangleShape; |
| 486 |
canvas.translate(arrowTranslationX, arrowTranslationY); |
| 487 |
relevantTriangle.setAlpha((int) (255f * mPercentStillFlyout)); |
| 488 |
relevantTriangle.draw(canvas); |
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
relevantTriangle.getOutline(mTriangleOutline); |
| 493 |
mTriangleOutline.offset((int) arrowTranslationX, (int) arrowTranslationY); |
| 494 |
canvas.restore(); |
| 495 |
} |
| 496 |
|
| 497 |
|
| 498 |
private void getOutline(Outline outline) { |
| 499 |
if (!mTriangleOutline.isEmpty() || !SHOW_POINTER) { |
| 500 |
|
| 501 |
final Path rectPath = new Path(); |
| 502 |
final float interpolatedRadius = getInterpolatedRadius(); |
| 503 |
rectPath.addRoundRect(mBgRect, interpolatedRadius, |
| 504 |
interpolatedRadius, Path.Direction.CW); |
| 505 |
outline.setPath(rectPath); |
| 506 |
|
| 507 |
|
| 508 |
if (SHOW_POINTER && mPercentStillFlyout > 0.5f) { |
| 509 |
outline.mPath.addPath(mTriangleOutline.mPath); |
| 510 |
} |
| 511 |
|
| 512 |
|
| 513 |
final Matrix outlineMatrix = new Matrix(); |
| 514 |
outlineMatrix.postTranslate(getLeft() + mBgTranslationX, getTop() + mBgTranslationY); |
| 515 |
|
| 516 |
|
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
if (mPercentTransitionedToDot > 0.98f) { |
| 521 |
final float percentBetween99and100 = (mPercentTransitionedToDot - 0.98f) / .02f; |
| 522 |
final float percentShadowVisible = 1f - percentBetween99and100; |
| 523 |
|
| 524 |
|
| 525 |
outlineMatrix.postTranslate( |
| 526 |
mNewDotRadius * percentBetween99and100, |
| 527 |
mNewDotRadius * percentBetween99and100); |
| 528 |
outlineMatrix.preScale(percentShadowVisible, percentShadowVisible); |
| 529 |
} |
| 530 |
|
| 531 |
outline.mPath.transform(outlineMatrix); |
| 532 |
} |
| 533 |
} |
| 534 |
|
| 535 |
private float getInterpolatedRadius() { |
| 536 |
return mNewDotRadius * mPercentTransitionedToDot |
| 537 |
+ mCornerRadius * (1 - mPercentTransitionedToDot); |
| 538 |
} |
| 539 |
} |