Chromium Code Reviews| Index: remoting/android/java/src/org/chromium/chromoting/FeedbackAnimator.java |
| diff --git a/remoting/android/java/src/org/chromium/chromoting/FeedbackAnimator.java b/remoting/android/java/src/org/chromium/chromoting/FeedbackAnimator.java |
| index 4a1ff236aee80de42dd5112a63e3c1946ce0c35d..cca9ffdd2f48582f5ebb8aa8c3fd20f980bf539f 100644 |
| --- a/remoting/android/java/src/org/chromium/chromoting/FeedbackAnimator.java |
| +++ b/remoting/android/java/src/org/chromium/chromoting/FeedbackAnimator.java |
| @@ -10,6 +10,7 @@ import android.graphics.Point; |
| import android.graphics.RadialGradient; |
| import android.graphics.Shader; |
| import android.os.SystemClock; |
| +import android.view.View; |
| /** Helper class for displaying the press feedback animations. */ |
| public final class FeedbackAnimator |
| @@ -42,16 +43,19 @@ public final class FeedbackAnimator |
| } |
| view.onPaint().addSelfRemovable(new FeedbackAnimator( |
| - getInputFeedbackSizeInPixels(feedbackType), pos)); |
| + getInputFeedbackSizeInPixels(feedbackType, view), pos)); |
| } |
| - private static float getInputFeedbackSizeInPixels(DesktopView.InputFeedbackType feedbackType) { |
| + private static float getInputFeedbackSizeInPixels(DesktopView.InputFeedbackType feedbackType, |
| + View view) { |
| switch (feedbackType) { |
| case SMALL_ANIMATION: |
| - return 40.0f; |
| + return view.getResources() |
| + .getDimensionPixelSize(R.dimen.feedback_animation_radius_small); |
|
joedow
2016/07/25 20:24:18
Can you cache these values? I'd assume they don't
Yuwei
2016/07/25 20:57:13
Sure. It probably won't change through the whole l
Yuwei
2016/07/25 21:21:56
Done.
|
| case LARGE_ANIMATION: |
| - return 160.0f; |
| + return view.getResources() |
| + .getDimensionPixelSize(R.dimen.feedback_animation_radius_large); |
| default: |
| // Unreachable, but required by Google Java style and findbugs. |