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

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

Issue 1643273002: Fix status bar visibility issue on pre-Marshmallow devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing CR feedback Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/android/java/src/org/chromium/chromoting/Desktop.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/Desktop.java b/remoting/android/java/src/org/chromium/chromoting/Desktop.java
index 887d16b9c9de48c2bec201aa7d6c6d6b2c264c88..93e54b184db3e9adeedeb54683acf37288a5896a 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Desktop.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Desktop.java
@@ -77,6 +77,9 @@ public class Desktop
/** Flag to indicate whether the current activity is switching to Cardboard desktop activity. */
private boolean mSwitchToCardboardDesktopActivity;
+ /** Flag to indicate whether to manually hide the system UI when the OSK is dismissed. */
+ private boolean mHideSystemUIOnSoftKeyboardDismiss = false;
+
/** Indicates whether a Soft Input UI (such as a keyboard) is visible. */
private boolean mSoftInputVisible = false;
@@ -387,6 +390,8 @@ public class Desktop
}
public void showActionBar() {
+ mHideSystemUIOnSoftKeyboardDismiss = false;
+
// Request exit from any fullscreen mode. The action-bar controls will be shown in response
// to the SystemUiVisibility notification. The visibility of the action-bar should be tied
// to the fullscreen state of the system, so there's no need to explicitly show it here.
@@ -439,6 +444,12 @@ public class Desktop
// and still allow the system to hide the ActionBar normally when no keyboard is present.
if (mSoftInputVisible) {
hideActionBarWithoutSystemUi();
+
+ // Android OSes prior to Marshmallow do not call onSystemUiVisibilityChange after the
+ // OSK is dismissed if the user has interacted with the status bar.
+ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
+ mHideSystemUIOnSoftKeyboardDismiss = true;
+ }
}
}
@@ -534,6 +545,20 @@ public class Desktop
mSoftInputVisible = (bottom < mMaxBottomValue);
mRemoteHostDesktop.onSoftInputMethodVisibilityChanged(
mSoftInputVisible, new Rect(left, top, right, bottom));
+
+ if (!mSoftInputVisible && mHideSystemUIOnSoftKeyboardDismiss) {
+ // Queue a task which will run after the current action (OSK dismiss) has
+ // completed, otherwise the hide request will not take effect.
+ new Handler().post(new Runnable() {
+ @Override
+ public void run() {
+ if (mHideSystemUIOnSoftKeyboardDismiss) {
+ mHideSystemUIOnSoftKeyboardDismiss = false;
+ hideActionBar();
+ }
+ }
+ });
+ }
}
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698