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

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

Issue 2105843002: Updating SystemUI visibility events in Adroid Client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing feedback Created 4 years, 6 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/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 ebc7ad6c3427bbd8c554d210ed860d15aa853a97..4ad4324d816408f6fb351b04a96647f7a5e4ec69 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Desktop.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Desktop.java
@@ -62,8 +62,8 @@ public class Desktop
/** The amount of time to wait to hide the ActionBar after user input is seen. */
private static final int ACTIONBAR_AUTO_HIDE_DELAY_MS = 3000;
- private final Event.Raisable<SoftInputMethodVisibilityChangedEventParameter>
- mOnSoftInputMethodVisibilityChanged = new Event.Raisable<>();
+ private final Event.Raisable<SystemUiVisibilityChangedEventParameter>
+ mOnSystemUiVisibilityChanged = new Event.Raisable<>();
private final Event.Raisable<InputModeChangedEventParameter> mOnInputModeChanged =
new Event.Raisable<>();
@@ -253,9 +253,8 @@ public class Desktop
return super.onCreateOptionsMenu(menu);
}
- public Event<SoftInputMethodVisibilityChangedEventParameter>
- onSoftInputMethodVisibilityChanged() {
- return mOnSoftInputMethodVisibilityChanged;
+ public Event<SystemUiVisibilityChangedEventParameter> onSystemUiVisibilityChanged() {
+ return mOnSystemUiVisibilityChanged;
}
public Event<InputModeChangedEventParameter> onInputModeChanged() {
@@ -372,6 +371,10 @@ public class Desktop
return getSupportActionBar() != null && getSupportActionBar().isShowing();
}
+ private boolean isSystemUiVisible() {
+ return (getWindow().getDecorView().getSystemUiVisibility() & getFullscreenFlags()) == 0;
+ }
+
/** Called whenever the visibility of the system status bar or navigation bar changes. */
@Override
public void onSystemUiVisibilityChange(int visibility) {
@@ -541,9 +544,8 @@ public class Desktop
// whenever they occur.
boolean oldSoftInputVisible = mSoftInputVisible;
mSoftInputVisible = (bottom < mMaxBottomValue);
- mOnSoftInputMethodVisibilityChanged.raise(
- new SoftInputMethodVisibilityChangedEventParameter(
- mSoftInputVisible, left, top, right, bottom));
+ mOnSystemUiVisibilityChanged.raise(new SystemUiVisibilityChangedEventParameter(
+ isSystemUiVisible(), mSoftInputVisible, left, top, right, bottom));
boolean softInputVisibilityChanged = oldSoftInputVisible != mSoftInputVisible;
if (!mSoftInputVisible && softInputVisibilityChanged && !isActionBarVisible()) {
« no previous file with comments | « remoting/android/client_java_tmpl.gni ('k') | remoting/android/java/src/org/chromium/chromoting/DesktopCanvas.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698