| 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..11968881c01aa4e904712a98795976f673da28cf 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,25 @@ 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 be shown.
|
| + */
|
| + protected final float getFeedbackRadius(InputFeedbackType feedbackToShow) {
|
| + switch (feedbackToShow) {
|
| + case NONE:
|
| + return 0.0f;
|
| + 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);
|
|
|
|
|