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

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/DesktopView.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, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chromoting; 5 package org.chromium.chromoting;
6 6
7 import android.graphics.Bitmap; 7 import android.graphics.Bitmap;
8 import android.graphics.Canvas; 8 import android.graphics.Canvas;
9 import android.graphics.Color; 9 import android.graphics.Color;
10 import android.graphics.Paint; 10 import android.graphics.Paint;
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 */ 218 */
219 @Override 219 @Override
220 public void surfaceDestroyed(SurfaceHolder holder) { 220 public void surfaceDestroyed(SurfaceHolder holder) {
221 synchronized (mRenderData) { 221 synchronized (mRenderData) {
222 mSurfaceCreated = false; 222 mSurfaceCreated = false;
223 } 223 }
224 } 224 }
225 225
226 @Override 226 @Override
227 public void showInputFeedback(InputFeedbackType feedbackToShow, Point pos) { 227 public void showInputFeedback(InputFeedbackType feedbackToShow, Point pos) {
228 if (feedbackToShow != InputFeedbackType.NONE) { 228 float radius = getFeedbackRadius(feedbackToShow);
229 FeedbackAnimator.startAnimation(this, pos, feedbackToShow); 229 if (radius <= 0.0f) {
230 requestRepaint(); 230 return;
231 } 231 }
232 FeedbackAnimator.startAnimation(this, pos, radius);
233 requestRepaint();
232 } 234 }
233 235
234 @Override 236 @Override
235 public void transformationChanged() { 237 public void transformationChanged() {
236 requestRepaint(); 238 requestRepaint();
237 } 239 }
238 240
239 @Override 241 @Override
240 public void cursorMoved() { 242 public void cursorMoved() {
241 // For current implementation, cursorMoved() is always followed by trans formationChanged() 243 // For current implementation, cursorMoved() is always followed by trans formationChanged()
242 // even if the canvas isn't really changed. For future we should improve this by not calling 244 // even if the canvas isn't really changed. For future we should improve this by not calling
243 // transformationChanged() if the cursor is moved but the canvas is not changed. 245 // transformationChanged() if the cursor is moved but the canvas is not changed.
244 } 246 }
245 247
246 @Override 248 @Override
247 public void cursorVisibilityChanged() { 249 public void cursorVisibilityChanged() {
248 requestRepaint(); 250 requestRepaint();
249 } 251 }
250 252
251 @Override 253 @Override
252 public void setAnimationEnabled(boolean enabled) { 254 public void setAnimationEnabled(boolean enabled) {
253 synchronized (mAnimationLock) { 255 synchronized (mAnimationLock) {
254 if (enabled && !mInputAnimationRunning) { 256 if (enabled && !mInputAnimationRunning) {
255 requestRepaint(); 257 requestRepaint();
256 } 258 }
257 mInputAnimationRunning = enabled; 259 mInputAnimationRunning = enabled;
258 } 260 }
259 } 261 }
260 } 262 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698