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

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java

Issue 2371803002: Updating the method called when System UI visibility/size changes (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/DesktopCanvas.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.content.Context; 7 import android.content.Context;
8 import android.graphics.Matrix; 8 import android.graphics.Matrix;
9 import android.graphics.PointF; 9 import android.graphics.PointF;
10 import android.graphics.Rect; 10 import android.graphics.Rect;
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 // Unreachable, but required by Google Java style and findbugs. 342 // Unreachable, but required by Google Java style and findbugs.
343 assert false : "Unreached"; 343 assert false : "Unreached";
344 } 344 }
345 345
346 // Ensure the cursor state is updated appropriately. 346 // Ensure the cursor state is updated appropriately.
347 mRenderStub.setCursorVisibility(mRenderData.drawCursor); 347 mRenderStub.setCursorVisibility(mRenderData.drawCursor);
348 } 348 }
349 349
350 private void handleSystemUiVisibilityChanged( 350 private void handleSystemUiVisibilityChanged(
351 SystemUiVisibilityChangedEventParameter parameter) { 351 SystemUiVisibilityChangedEventParameter parameter) {
352 if (parameter.softInputMethodVisible) { 352 if (parameter.systemUiVisible) {
353 mDesktopCanvas.setSystemUiOffsetValues(parameter.left, parameter.top , 353 mDesktopCanvas.setSystemUiOffsetValues(parameter.left, parameter.top ,
354 mRenderData.screenWidth - parameter.right, 354 mRenderData.screenWidth - parameter.right,
355 mRenderData.screenHeight - parameter.bottom); 355 mRenderData.screenHeight - parameter.bottom);
356 } else { 356 } else {
357 mDesktopCanvas.setSystemUiOffsetValues(0, 0, 0, 0); 357 mDesktopCanvas.clearSystemUiOffsets();
358 } 358 }
359 359
360 mDesktopCanvas.repositionImage(true); 360 mDesktopCanvas.repositionImage(true);
361 } 361 }
362 362
363 private boolean handleTouchEvent(MotionEvent event) { 363 private boolean handleTouchEvent(MotionEvent event) {
364 // Give the underlying input strategy a chance to observe the current mo tion event before 364 // Give the underlying input strategy a chance to observe the current mo tion event before
365 // passing it to the gesture detectors. This allows the input strategy to react to the 365 // passing it to the gesture detectors. This allows the input strategy to react to the
366 // event or save the payload for use in recreating the gesture remotely. 366 // event or save the payload for use in recreating the gesture remotely.
367 mInputStrategy.onMotionEvent(event); 367 mInputStrategy.onMotionEvent(event);
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 float[] mappedPoints = mapScreenPointToImagePoint(screenX, screenY); 692 float[] mappedPoints = mapScreenPointToImagePoint(screenX, screenY);
693 693
694 float imageWidth = (float) mRenderData.imageWidth + EPSILON; 694 float imageWidth = (float) mRenderData.imageWidth + EPSILON;
695 float imageHeight = (float) mRenderData.imageHeight + EPSILON; 695 float imageHeight = (float) mRenderData.imageHeight + EPSILON;
696 696
697 return mappedPoints[0] < -EPSILON || mappedPoints[0] > imageWidth 697 return mappedPoints[0] < -EPSILON || mappedPoints[0] > imageWidth
698 || mappedPoints[1] < -EPSILON || mappedPoints[1] > imageHeig ht; 698 || mappedPoints[1] < -EPSILON || mappedPoints[1] > imageHeig ht;
699 } 699 }
700 } 700 }
701 } 701 }
OLDNEW
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/DesktopCanvas.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698