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

Issue 1427453004: Fixing image canvas resize problems when showing/hiding system UI. (Closed)

Created:
5 years, 1 month ago by joedow
Modified:
4 years, 6 months ago
Reviewers:
Lambros
CC:
chromium-reviews, chromoting-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fixing image canvas resize problems when showing/hiding system UI. The previous behavior for the image canvas was to allow the system to resize the canvas based on the systemUI being displayed. The two problems with this approach were that the canvas could receive mulitple resize events as systemUI was hidden (resulting in a jerky resize of the canvas) and that area beneath the system bars would not match the color of the background (white vs. black) so that area would appear to flash. On a fit and finish side, it was odd to have the canvas resize because the ActionBar or navigation bar was displayed as these are transient UI elements which are infrequently needed. I've also added an auto-hide timer to hide the ActionBar after a period of inactivity. To address these issues, I have updated the layout of the Desktop activity such that the image canvas is effectively streched to fit the screen and the /action/navigation/system UI is drawn over the top. This removes the need for frequent resizing and results in a smoother experience. The second change needed was to detect when the on screen keyboard is present and shift the remote image canvas upwards to accommodate the reduced screen size. There is no straight-forward way to detect the OSK presence on Android so my solution was to add a transparent UI element which is resized by the system when systemUI is displayed and use an attached resize listener to detect the new screen bounds. I then use this info to shift the canvas appropriately. This mechanism will also allow us to display adornments at the top of the on screen keyboard if necessary. Note: This change is targeting KitKat and above as earlier API versions do not support all of the flags needed to properly support this work. BUG=548003 Committed: https://crrev.com/decde3542a6456595150345eb99e8afe705a3397 Cr-Commit-Position: refs/heads/master@{#357445}

Patch Set 1 #

Patch Set 2 : Fixing some comment formatting. #

Total comments: 22

Patch Set 3 : Addressing feedback and removed previous formatting changes. #

Patch Set 4 : Removing Hide action from ActionBar when autohide is enabled. #

Total comments: 7

Patch Set 5 : Addressing code review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+218 lines, -36 lines) Patch
M remoting/android/java/res/layout/desktop.xml View 1 2 1 chunk +25 lines, -12 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/Desktop.java View 1 2 3 4 15 chunks +135 lines, -14 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/DesktopView.java View 1 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/TouchInputHandler.java View 1 2 2 chunks +10 lines, -0 lines 0 comments Download
M remoting/android/java/src/org/chromium/chromoting/TrackingInputHandler.java View 1 2 3 4 6 chunks +42 lines, -10 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
joedow
This change updates the behavior on KitKat+ Android devices such that the remote image canvas ...
5 years, 1 month ago (2015-10-28 20:19:29 UTC) #2
Lambros
https://codereview.chromium.org/1427453004/diff/20001/remoting/android/java/res/layout/desktop.xml File remoting/android/java/res/layout/desktop.xml (right): https://codereview.chromium.org/1427453004/diff/20001/remoting/android/java/res/layout/desktop.xml#newcode14 remoting/android/java/res/layout/desktop.xml:14: android:layout_height="wrap_content"/> match_parent? https://codereview.chromium.org/1427453004/diff/20001/remoting/android/java/res/layout/desktop.xml#newcode18 remoting/android/java/res/layout/desktop.xml:18: android:orientation="vertical" remove orientation? https://codereview.chromium.org/1427453004/diff/20001/remoting/android/java/res/layout/desktop.xml#newcode28 remoting/android/java/res/layout/desktop.xml:28: ...
5 years, 1 month ago (2015-10-29 23:39:16 UTC) #3
joedow
PTAL! https://codereview.chromium.org/1427453004/diff/20001/remoting/android/java/res/layout/desktop.xml File remoting/android/java/res/layout/desktop.xml (right): https://codereview.chromium.org/1427453004/diff/20001/remoting/android/java/res/layout/desktop.xml#newcode14 remoting/android/java/res/layout/desktop.xml:14: android:layout_height="wrap_content"/> On 2015/10/29 23:39:16, Lambros wrote: > match_parent? ...
5 years, 1 month ago (2015-10-30 17:41:23 UTC) #4
joedow
One last tweak, removed the 'Hide' action from the ActionBar for API levels which support ...
5 years, 1 month ago (2015-10-30 18:21:54 UTC) #5
joedow
Ping!
5 years, 1 month ago (2015-11-02 16:39:37 UTC) #6
Lambros
lgtm with comments https://codereview.chromium.org/1427453004/diff/40002/remoting/android/java/src/org/chromium/chromoting/Desktop.java File remoting/android/java/src/org/chromium/chromoting/Desktop.java (right): https://codereview.chromium.org/1427453004/diff/40002/remoting/android/java/src/org/chromium/chromoting/Desktop.java#newcode201 remoting/android/java/src/org/chromium/chromoting/Desktop.java:201: View decorView = getWindow().getDecorView(); optional: getWindow().getDecorView().removeCallbacks(...) ...
5 years, 1 month ago (2015-11-02 19:48:54 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1427453004/70001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1427453004/70001
5 years, 1 month ago (2015-11-02 21:45:32 UTC) #10
commit-bot: I haz the power
Committed patchset #5 (id:70001)
5 years, 1 month ago (2015-11-02 22:09:26 UTC) #11
commit-bot: I haz the power
5 years, 1 month ago (2015-11-02 22:10:49 UTC) #12
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/decde3542a6456595150345eb99e8afe705a3397
Cr-Commit-Position: refs/heads/master@{#357445}

Powered by Google App Engine
This is Rietveld 408576698