summaryrefslogtreecommitdiffstats
path: root/remoting/android
diff options
context:
space:
mode:
authorlambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-17 05:11:52 +0000
committerlambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-17 05:11:52 +0000
commit7e624d38f5590f953c1880d76198682fc8f521f8 (patch)
tree801ec6e3d5e4a0b0babcdea6cef47575eae96f6a /remoting/android
parent1f9cf47eb30c2974daad65c7e4a2415efb01a43d (diff)
downloadchromium_src-7e624d38f5590f953c1880d76198682fc8f521f8.zip
chromium_src-7e624d38f5590f953c1880d76198682fc8f521f8.tar.gz
chromium_src-7e624d38f5590f953c1880d76198682fc8f521f8.tar.bz2
Fullscreen mode (lights out) for Android Chromoting
This implements basic full-screen support, by dimming the system controls whenever the action-bar is hidden. This works on all supported OS versions (ICS and higher). Followup CLs will add Immersive support, introduced in KitKat. BUG=338773 Review URL: https://codereview.chromium.org/237793004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264427 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/android')
-rw-r--r--remoting/android/java/src/org/chromium/chromoting/Desktop.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/remoting/android/java/src/org/chromium/chromoting/Desktop.java b/remoting/android/java/src/org/chromium/chromoting/Desktop.java
index 570fd80..662c0d9 100644
--- a/remoting/android/java/src/org/chromium/chromoting/Desktop.java
+++ b/remoting/android/java/src/org/chromium/chromoting/Desktop.java
@@ -19,7 +19,7 @@ import org.chromium.chromoting.jni.JniInterface;
/**
* A simple screen that does nothing except display a DesktopView and notify it of rotations.
*/
-public class Desktop extends Activity {
+public class Desktop extends Activity implements View.OnSystemUiVisibilityChangeListener {
/** Web page to be displayed in the Help screen when launched from this activity. */
private static final String HELP_URL =
"http://support.google.com/chrome/?p=mobile_crd_connecthost";
@@ -41,6 +41,9 @@ public class Desktop extends Activity {
// Ensure the button is initially hidden.
showActionBar();
+
+ View decorView = getWindow().getDecorView();
+ decorView.setOnSystemUiVisibilityChangeListener(this);
}
/** Called when the activity is finally finished. */
@@ -64,14 +67,33 @@ public class Desktop extends Activity {
return super.onCreateOptionsMenu(menu);
}
+ /** Called whenever the visibility of the system status bar or navigation bar changes. */
+ @Override
+ public void onSystemUiVisibilityChange(int visibility) {
+ // Ensure the action-bar's visibility matches that of the system controls. This
+ // minimizes the number of states the UI can be in, to keep things simple for the user.
+ if ((visibility & View.SYSTEM_UI_FLAG_LOW_PROFILE) != 0) {
+ hideActionBar();
+ } else {
+ showActionBar();
+ }
+ }
+
public void showActionBar() {
mOverlayButton.setVisibility(View.INVISIBLE);
getActionBar().show();
+
+ View decorView = getWindow().getDecorView();
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
}
public void hideActionBar() {
mOverlayButton.setVisibility(View.VISIBLE);
getActionBar().hide();
+
+ View decorView = getWindow().getDecorView();
+ decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE
+ | View.SYSTEM_UI_FLAG_FULLSCREEN);
}
/** The overlay button's onClick handler. */