Chromium Code Reviews| Index: remoting/android/java/src/org/chromium/chromoting/AbstractDesktopView.java |
| diff --git a/remoting/android/java/src/org/chromium/chromoting/AbstractDesktopView.java b/remoting/android/java/src/org/chromium/chromoting/AbstractDesktopView.java |
| index 3dae8a2c8c83c570a281cac62a7dd0ff54e359c1..481b5346f2d5094ebc7f1b2135c2cf34c8a406d6 100644 |
| --- a/remoting/android/java/src/org/chromium/chromoting/AbstractDesktopView.java |
| +++ b/remoting/android/java/src/org/chromium/chromoting/AbstractDesktopView.java |
| @@ -38,6 +38,9 @@ public abstract class AbstractDesktopView extends SurfaceView { |
| protected final Event.Raisable<SizeChangedEventParameter> mOnHostSizeChanged = |
| new Event.Raisable<>(); |
| + protected final int mSmallFeedbackPixelRadius; |
| + protected final int mLargeFeedbackPixelRadius; |
| + |
| /** The parent Desktop activity. */ |
| private final Desktop mDesktop; |
| @@ -54,6 +57,12 @@ public abstract class AbstractDesktopView extends SurfaceView { |
| // Give this view keyboard focus, allowing us to customize the soft keyboard's settings. |
| setFocusableInTouchMode(true); |
| + |
| + mSmallFeedbackPixelRadius = getResources() |
| + .getDimensionPixelSize(R.dimen.feedback_animation_radius_small); |
| + |
| + mLargeFeedbackPixelRadius = getResources() |
| + .getDimensionPixelSize(R.dimen.feedback_animation_radius_large); |
| } |
| // TODO(yuweih): move showActionBar and showKeyboard out of this abstract class. |
| @@ -111,6 +120,24 @@ public abstract class AbstractDesktopView extends SurfaceView { |
| return parameter.handled; |
| } |
| + /** Returns the radius of the given feedback type. 0.0f will be returned if no feedback should |
|
Lambros
2016/07/26 18:54:17
Format this as multi-line:
/**
* Returns...
* bl
Yuwei
2016/07/26 19:05:42
Done.
|
| + * be shown. */ |
| + protected final float getFeedbackRadius(InputFeedbackType feedbackToShow) { |
| + if (feedbackToShow == InputFeedbackType.NONE) { |
|
Lambros
2016/07/26 18:54:17
Move this into the switch..case.
Yuwei
2016/07/26 19:05:42
Done.
|
| + return 0.0f; |
| + } |
| + switch (feedbackToShow) { |
| + case SMALL_ANIMATION: |
| + return mSmallFeedbackPixelRadius; |
| + case LARGE_ANIMATION: |
| + return mLargeFeedbackPixelRadius; |
| + default: |
| + // Unreachable, but required by Google Java style and findbugs. |
| + assert false : "Unreached"; |
| + return 0.0f; |
| + } |
| + } |
| + |
| /** Triggers a brief animation to indicate the existence and location of an input event. */ |
| public abstract void showInputFeedback(InputFeedbackType feedbackToShow, Point pos); |