Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: remoting/android/java/src/org/chromium/chromoting/AbstractDesktopView.java

Issue 2175353003: [Remoting Android] Define feedback animation size in dp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's Feedback Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698