Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.launcher3.folder; |
| 18 | |
Sunny Goyal | d0ae492 | 2018-10-11 10:37:53 -0700 | [diff] [blame] | 19 | import static com.android.launcher3.folder.FolderShape.getShape; |
Sunny Goyal | 066ace1 | 2018-11-05 11:08:31 -0800 | [diff] [blame] | 20 | import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound; |
Sunny Goyal | d0ae492 | 2018-10-11 10:37:53 -0700 | [diff] [blame] | 21 | |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 22 | import android.animation.Animator; |
| 23 | import android.animation.AnimatorListenerAdapter; |
| 24 | import android.animation.ObjectAnimator; |
| 25 | import android.animation.ValueAnimator; |
| 26 | import android.graphics.Canvas; |
| 27 | import android.graphics.Color; |
| 28 | import android.graphics.Matrix; |
| 29 | import android.graphics.Paint; |
| 30 | import android.graphics.Path; |
| 31 | import android.graphics.PorterDuff; |
| 32 | import android.graphics.PorterDuffXfermode; |
| 33 | import android.graphics.RadialGradient; |
| 34 | import android.graphics.Region; |
| 35 | import android.graphics.Shader; |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 36 | import android.util.Property; |
| 37 | import android.view.View; |
| 38 | |
| 39 | import com.android.launcher3.CellLayout; |
| 40 | import com.android.launcher3.DeviceProfile; |
| 41 | import com.android.launcher3.Launcher; |
Tony | 05d98c2 | 2018-07-23 08:01:15 -0700 | [diff] [blame] | 42 | import com.android.launcher3.R; |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 43 | import com.android.launcher3.util.Themes; |
| 44 | |
| 45 | /** |
| 46 | * This object represents a FolderIcon preview background. It stores drawing / measurement |
| 47 | * information, handles drawing, and animation (accept state <--> rest state). |
| 48 | */ |
| 49 | public class PreviewBackground { |
| 50 | |
| 51 | private static final int CONSUMPTION_ANIMATION_DURATION = 100; |
| 52 | |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 53 | private final PorterDuffXfermode mShadowPorterDuffXfermode |
| 54 | = new PorterDuffXfermode(PorterDuff.Mode.DST_OUT); |
| 55 | private RadialGradient mShadowShader = null; |
| 56 | |
| 57 | private final Matrix mShaderMatrix = new Matrix(); |
| 58 | private final Path mPath = new Path(); |
| 59 | |
| 60 | private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG); |
| 61 | |
| 62 | float mScale = 1f; |
| 63 | private float mColorMultiplier = 1f; |
| 64 | private int mBgColor; |
Tony | 05d98c2 | 2018-07-23 08:01:15 -0700 | [diff] [blame] | 65 | private int mBadgeColor; |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 66 | private float mStrokeWidth; |
| 67 | private int mStrokeAlpha = MAX_BG_OPACITY; |
| 68 | private int mShadowAlpha = 255; |
| 69 | private View mInvalidateDelegate; |
| 70 | |
| 71 | int previewSize; |
| 72 | int basePreviewOffsetX; |
| 73 | int basePreviewOffsetY; |
| 74 | |
| 75 | private CellLayout mDrawingDelegate; |
| 76 | public int delegateCellX; |
| 77 | public int delegateCellY; |
| 78 | |
| 79 | // When the PreviewBackground is drawn under an icon (for creating a folder) the border |
| 80 | // should not occlude the icon |
| 81 | public boolean isClipping = true; |
| 82 | |
| 83 | // Drawing / animation configurations |
Jon Miranda | 72b5fd1 | 2017-06-25 18:06:23 -0700 | [diff] [blame] | 84 | private static final float ACCEPT_SCALE_FACTOR = 1.20f; |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 85 | private static final float ACCEPT_COLOR_MULTIPLIER = 1.5f; |
| 86 | |
| 87 | // Expressed on a scale from 0 to 255. |
| 88 | private static final int BG_OPACITY = 160; |
| 89 | private static final int MAX_BG_OPACITY = 225; |
| 90 | private static final int SHADOW_OPACITY = 40; |
| 91 | |
| 92 | private ValueAnimator mScaleAnimator; |
| 93 | private ObjectAnimator mStrokeAlphaAnimator; |
| 94 | private ObjectAnimator mShadowAnimator; |
| 95 | |
| 96 | private static final Property<PreviewBackground, Integer> STROKE_ALPHA = |
| 97 | new Property<PreviewBackground, Integer>(Integer.class, "strokeAlpha") { |
| 98 | @Override |
| 99 | public Integer get(PreviewBackground previewBackground) { |
| 100 | return previewBackground.mStrokeAlpha; |
| 101 | } |
| 102 | |
| 103 | @Override |
| 104 | public void set(PreviewBackground previewBackground, Integer alpha) { |
| 105 | previewBackground.mStrokeAlpha = alpha; |
| 106 | previewBackground.invalidate(); |
| 107 | } |
| 108 | }; |
| 109 | |
| 110 | private static final Property<PreviewBackground, Integer> SHADOW_ALPHA = |
| 111 | new Property<PreviewBackground, Integer>(Integer.class, "shadowAlpha") { |
| 112 | @Override |
| 113 | public Integer get(PreviewBackground previewBackground) { |
| 114 | return previewBackground.mShadowAlpha; |
| 115 | } |
| 116 | |
| 117 | @Override |
| 118 | public void set(PreviewBackground previewBackground, Integer alpha) { |
| 119 | previewBackground.mShadowAlpha = alpha; |
| 120 | previewBackground.invalidate(); |
| 121 | } |
| 122 | }; |
| 123 | |
| 124 | public void setup(Launcher launcher, View invalidateDelegate, |
Jon Miranda | 591e360 | 2018-03-28 11:37:00 -0700 | [diff] [blame] | 125 | int availableSpaceX, int topPadding) { |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 126 | mInvalidateDelegate = invalidateDelegate; |
| 127 | mBgColor = Themes.getAttrColor(launcher, android.R.attr.colorPrimary); |
Tony | 05d98c2 | 2018-07-23 08:01:15 -0700 | [diff] [blame] | 128 | mBadgeColor = Themes.getAttrColor(launcher, R.attr.folderBadgeColor); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 129 | |
| 130 | DeviceProfile grid = launcher.getDeviceProfile(); |
Jon Miranda | 591e360 | 2018-03-28 11:37:00 -0700 | [diff] [blame] | 131 | previewSize = grid.folderIconSizePx; |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 132 | |
Jon Miranda | 591e360 | 2018-03-28 11:37:00 -0700 | [diff] [blame] | 133 | basePreviewOffsetX = (availableSpaceX - previewSize) / 2; |
| 134 | basePreviewOffsetY = topPadding + grid.folderIconOffsetYPx; |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 135 | |
| 136 | // Stroke width is 1dp |
| 137 | mStrokeWidth = launcher.getResources().getDisplayMetrics().density; |
| 138 | |
| 139 | float radius = getScaledRadius(); |
| 140 | float shadowRadius = radius + mStrokeWidth; |
| 141 | int shadowColor = Color.argb(SHADOW_OPACITY, 0, 0, 0); |
| 142 | mShadowShader = new RadialGradient(0, 0, 1, |
| 143 | new int[] {shadowColor, Color.TRANSPARENT}, |
| 144 | new float[] {radius / shadowRadius, 1}, |
| 145 | Shader.TileMode.CLAMP); |
| 146 | |
| 147 | invalidate(); |
| 148 | } |
| 149 | |
| 150 | int getRadius() { |
| 151 | return previewSize / 2; |
| 152 | } |
| 153 | |
| 154 | int getScaledRadius() { |
| 155 | return (int) (mScale * getRadius()); |
| 156 | } |
| 157 | |
| 158 | int getOffsetX() { |
| 159 | return basePreviewOffsetX - (getScaledRadius() - getRadius()); |
| 160 | } |
| 161 | |
| 162 | int getOffsetY() { |
| 163 | return basePreviewOffsetY - (getScaledRadius() - getRadius()); |
| 164 | } |
| 165 | |
| 166 | /** |
| 167 | * Returns the progress of the scale animation, where 0 means the scale is at 1f |
| 168 | * and 1 means the scale is at ACCEPT_SCALE_FACTOR. |
| 169 | */ |
| 170 | float getScaleProgress() { |
| 171 | return (mScale - 1f) / (ACCEPT_SCALE_FACTOR - 1f); |
| 172 | } |
| 173 | |
| 174 | void invalidate() { |
| 175 | if (mInvalidateDelegate != null) { |
| 176 | mInvalidateDelegate.invalidate(); |
| 177 | } |
| 178 | |
| 179 | if (mDrawingDelegate != null) { |
| 180 | mDrawingDelegate.invalidate(); |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | void setInvalidateDelegate(View invalidateDelegate) { |
| 185 | mInvalidateDelegate = invalidateDelegate; |
| 186 | invalidate(); |
| 187 | } |
| 188 | |
Sunny Goyal | e29897f | 2017-07-20 10:09:42 -0700 | [diff] [blame] | 189 | public int getBgColor() { |
| 190 | int alpha = (int) Math.min(MAX_BG_OPACITY, BG_OPACITY * mColorMultiplier); |
Sunny Goyal | 066ace1 | 2018-11-05 11:08:31 -0800 | [diff] [blame] | 191 | return setColorAlphaBound(mBgColor, alpha); |
Sunny Goyal | e29897f | 2017-07-20 10:09:42 -0700 | [diff] [blame] | 192 | } |
| 193 | |
Sunny Goyal | 179249d | 2017-12-19 16:49:24 -0800 | [diff] [blame] | 194 | public int getBadgeColor() { |
Tony | 05d98c2 | 2018-07-23 08:01:15 -0700 | [diff] [blame] | 195 | return mBadgeColor; |
Sunny Goyal | 179249d | 2017-12-19 16:49:24 -0800 | [diff] [blame] | 196 | } |
| 197 | |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 198 | public void drawBackground(Canvas canvas) { |
| 199 | mPaint.setStyle(Paint.Style.FILL); |
Sunny Goyal | e29897f | 2017-07-20 10:09:42 -0700 | [diff] [blame] | 200 | mPaint.setColor(getBgColor()); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 201 | |
Sunny Goyal | d0ae492 | 2018-10-11 10:37:53 -0700 | [diff] [blame] | 202 | getShape().drawShape(canvas, getOffsetX(), getOffsetY(), getScaledRadius(), mPaint); |
Sunny Goyal | e29897f | 2017-07-20 10:09:42 -0700 | [diff] [blame] | 203 | drawShadow(canvas); |
| 204 | } |
| 205 | |
| 206 | public void drawShadow(Canvas canvas) { |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 207 | if (mShadowShader == null) { |
| 208 | return; |
| 209 | } |
Sunny Goyal | e29897f | 2017-07-20 10:09:42 -0700 | [diff] [blame] | 210 | |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 211 | float radius = getScaledRadius(); |
| 212 | float shadowRadius = radius + mStrokeWidth; |
Sunny Goyal | e29897f | 2017-07-20 10:09:42 -0700 | [diff] [blame] | 213 | mPaint.setStyle(Paint.Style.FILL); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 214 | mPaint.setColor(Color.BLACK); |
| 215 | int offsetX = getOffsetX(); |
| 216 | int offsetY = getOffsetY(); |
| 217 | final int saveCount; |
| 218 | if (canvas.isHardwareAccelerated()) { |
| 219 | saveCount = canvas.saveLayer(offsetX - mStrokeWidth, offsetY, |
Derek Sollenberger | 26a1b45 | 2018-02-23 13:37:25 -0500 | [diff] [blame] | 220 | offsetX + radius + shadowRadius, offsetY + shadowRadius + shadowRadius, null); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 221 | |
| 222 | } else { |
Derek Sollenberger | 26a1b45 | 2018-02-23 13:37:25 -0500 | [diff] [blame] | 223 | saveCount = canvas.save(); |
Sunny Goyal | e29897f | 2017-07-20 10:09:42 -0700 | [diff] [blame] | 224 | canvas.clipPath(getClipPath(), Region.Op.DIFFERENCE); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | mShaderMatrix.setScale(shadowRadius, shadowRadius); |
| 228 | mShaderMatrix.postTranslate(radius + offsetX, shadowRadius + offsetY); |
| 229 | mShadowShader.setLocalMatrix(mShaderMatrix); |
| 230 | mPaint.setAlpha(mShadowAlpha); |
| 231 | mPaint.setShader(mShadowShader); |
| 232 | canvas.drawPaint(mPaint); |
| 233 | mPaint.setAlpha(255); |
| 234 | mPaint.setShader(null); |
| 235 | if (canvas.isHardwareAccelerated()) { |
| 236 | mPaint.setXfermode(mShadowPorterDuffXfermode); |
Sunny Goyal | d0ae492 | 2018-10-11 10:37:53 -0700 | [diff] [blame] | 237 | getShape().drawShape(canvas, offsetX, offsetY, radius, mPaint); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 238 | mPaint.setXfermode(null); |
| 239 | } |
| 240 | |
| 241 | canvas.restoreToCount(saveCount); |
| 242 | } |
| 243 | |
| 244 | public void fadeInBackgroundShadow() { |
| 245 | if (mShadowAnimator != null) { |
| 246 | mShadowAnimator.cancel(); |
| 247 | } |
| 248 | mShadowAnimator = ObjectAnimator |
| 249 | .ofInt(this, SHADOW_ALPHA, 0, 255) |
| 250 | .setDuration(100); |
| 251 | mShadowAnimator.addListener(new AnimatorListenerAdapter() { |
| 252 | @Override |
| 253 | public void onAnimationEnd(Animator animation) { |
| 254 | mShadowAnimator = null; |
| 255 | } |
| 256 | }); |
| 257 | mShadowAnimator.start(); |
| 258 | } |
| 259 | |
| 260 | public void animateBackgroundStroke() { |
| 261 | if (mStrokeAlphaAnimator != null) { |
| 262 | mStrokeAlphaAnimator.cancel(); |
| 263 | } |
| 264 | mStrokeAlphaAnimator = ObjectAnimator |
| 265 | .ofInt(this, STROKE_ALPHA, MAX_BG_OPACITY / 2, MAX_BG_OPACITY) |
| 266 | .setDuration(100); |
| 267 | mStrokeAlphaAnimator.addListener(new AnimatorListenerAdapter() { |
| 268 | @Override |
| 269 | public void onAnimationEnd(Animator animation) { |
| 270 | mStrokeAlphaAnimator = null; |
| 271 | } |
| 272 | }); |
| 273 | mStrokeAlphaAnimator.start(); |
| 274 | } |
| 275 | |
| 276 | public void drawBackgroundStroke(Canvas canvas) { |
Sunny Goyal | 066ace1 | 2018-11-05 11:08:31 -0800 | [diff] [blame] | 277 | mPaint.setColor(setColorAlphaBound(mBgColor, mStrokeAlpha)); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 278 | mPaint.setStyle(Paint.Style.STROKE); |
| 279 | mPaint.setStrokeWidth(mStrokeWidth); |
Sunny Goyal | d0ae492 | 2018-10-11 10:37:53 -0700 | [diff] [blame] | 280 | |
| 281 | float inset = 1f; |
| 282 | getShape().drawShape(canvas, |
| 283 | getOffsetX() + inset, getOffsetY() + inset, getScaledRadius() - inset, mPaint); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | public void drawLeaveBehind(Canvas canvas) { |
| 287 | float originalScale = mScale; |
| 288 | mScale = 0.5f; |
| 289 | |
| 290 | mPaint.setStyle(Paint.Style.FILL); |
| 291 | mPaint.setColor(Color.argb(160, 245, 245, 245)); |
Sunny Goyal | d0ae492 | 2018-10-11 10:37:53 -0700 | [diff] [blame] | 292 | getShape().drawShape(canvas, getOffsetX(), getOffsetY(), getScaledRadius(), mPaint); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 293 | |
| 294 | mScale = originalScale; |
| 295 | } |
| 296 | |
Sunny Goyal | e29897f | 2017-07-20 10:09:42 -0700 | [diff] [blame] | 297 | public Path getClipPath() { |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 298 | mPath.reset(); |
Sunny Goyal | d0ae492 | 2018-10-11 10:37:53 -0700 | [diff] [blame] | 299 | getShape().addShape(mPath, getOffsetX(), getOffsetY(), getScaledRadius()); |
Sunny Goyal | e29897f | 2017-07-20 10:09:42 -0700 | [diff] [blame] | 300 | return mPath; |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 301 | } |
| 302 | |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 303 | private void delegateDrawing(CellLayout delegate, int cellX, int cellY) { |
| 304 | if (mDrawingDelegate != delegate) { |
| 305 | delegate.addFolderBackground(this); |
| 306 | } |
| 307 | |
| 308 | mDrawingDelegate = delegate; |
| 309 | delegateCellX = cellX; |
| 310 | delegateCellY = cellY; |
| 311 | |
| 312 | invalidate(); |
| 313 | } |
| 314 | |
| 315 | private void clearDrawingDelegate() { |
| 316 | if (mDrawingDelegate != null) { |
| 317 | mDrawingDelegate.removeFolderBackground(this); |
| 318 | } |
| 319 | |
| 320 | mDrawingDelegate = null; |
Sunny Goyal | 5247f5b | 2017-07-04 12:07:46 -0700 | [diff] [blame] | 321 | isClipping = true; |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 322 | invalidate(); |
| 323 | } |
| 324 | |
| 325 | boolean drawingDelegated() { |
| 326 | return mDrawingDelegate != null; |
| 327 | } |
| 328 | |
| 329 | private void animateScale(float finalScale, float finalMultiplier, |
| 330 | final Runnable onStart, final Runnable onEnd) { |
| 331 | final float scale0 = mScale; |
| 332 | final float scale1 = finalScale; |
| 333 | |
| 334 | final float bgMultiplier0 = mColorMultiplier; |
| 335 | final float bgMultiplier1 = finalMultiplier; |
| 336 | |
| 337 | if (mScaleAnimator != null) { |
| 338 | mScaleAnimator.cancel(); |
| 339 | } |
| 340 | |
Sunny Goyal | 849c6a2 | 2018-08-08 16:33:46 -0700 | [diff] [blame] | 341 | mScaleAnimator = ValueAnimator.ofFloat(0f, 1.0f); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 342 | |
| 343 | mScaleAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { |
| 344 | @Override |
| 345 | public void onAnimationUpdate(ValueAnimator animation) { |
| 346 | float prog = animation.getAnimatedFraction(); |
| 347 | mScale = prog * scale1 + (1 - prog) * scale0; |
| 348 | mColorMultiplier = prog * bgMultiplier1 + (1 - prog) * bgMultiplier0; |
| 349 | invalidate(); |
| 350 | } |
| 351 | }); |
| 352 | mScaleAnimator.addListener(new AnimatorListenerAdapter() { |
| 353 | @Override |
| 354 | public void onAnimationStart(Animator animation) { |
| 355 | if (onStart != null) { |
| 356 | onStart.run(); |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | @Override |
| 361 | public void onAnimationEnd(Animator animation) { |
| 362 | if (onEnd != null) { |
| 363 | onEnd.run(); |
| 364 | } |
| 365 | mScaleAnimator = null; |
| 366 | } |
| 367 | }); |
| 368 | |
| 369 | mScaleAnimator.setDuration(CONSUMPTION_ANIMATION_DURATION); |
| 370 | mScaleAnimator.start(); |
| 371 | } |
| 372 | |
Sunny Goyal | 849c6a2 | 2018-08-08 16:33:46 -0700 | [diff] [blame] | 373 | public void animateToAccept(CellLayout cl, int cellX, int cellY) { |
| 374 | animateScale(ACCEPT_SCALE_FACTOR, ACCEPT_COLOR_MULTIPLIER, |
| 375 | () -> delegateDrawing(cl, cellX, cellY), null); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 376 | } |
| 377 | |
| 378 | public void animateToRest() { |
| 379 | // This can be called multiple times -- we need to make sure the drawing delegate |
| 380 | // is saved and restored at the beginning of the animation, since cancelling the |
| 381 | // existing animation can clear the delgate. |
Sunny Goyal | 849c6a2 | 2018-08-08 16:33:46 -0700 | [diff] [blame] | 382 | CellLayout cl = mDrawingDelegate; |
| 383 | int cellX = delegateCellX; |
| 384 | int cellY = delegateCellY; |
| 385 | animateScale(1f, 1f, () -> delegateDrawing(cl, cellX, cellY), this::clearDrawingDelegate); |
Jon Miranda | a0233f7 | 2017-06-22 18:34:45 -0700 | [diff] [blame] | 386 | } |
| 387 | |
| 388 | public int getBackgroundAlpha() { |
| 389 | return (int) Math.min(MAX_BG_OPACITY, BG_OPACITY * mColorMultiplier); |
| 390 | } |
| 391 | |
| 392 | public float getStrokeWidth() { |
| 393 | return mStrokeWidth; |
| 394 | } |
| 395 | } |