BearND has uploaded a new change for review. https://gerrit.wikimedia.org/r/179963
Change subject: Hide system and navigation bars in GalleryActivity ...................................................................... Hide system and navigation bars in GalleryActivity when controls are hidden. Change-Id: I00b24b5c45bfefa9ab3462532680f0d95bc14159 --- M wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java 1 file changed, 25 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/63/179963/1 diff --git a/wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java b/wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java index b8a2c7c..9ede638 100644 --- a/wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java +++ b/wikipedia/src/main/java/org/wikipedia/page/gallery/GalleryActivity.java @@ -10,9 +10,12 @@ import org.wikipedia.history.HistoryEntry; import org.wikipedia.page.LinkMovementMethodExt; import org.wikipedia.page.PageActivity; + import android.content.Intent; import android.net.Uri; +import android.os.Build; import android.os.Bundle; +import android.support.v7.app.ActionBar; import android.support.v7.widget.Toolbar; import android.text.Html; import android.text.TextUtils; @@ -96,6 +99,21 @@ pageTitle = getIntent().getParcelableExtra(EXTRA_PAGETITLE); currentImageTitle = getIntent().getParcelableExtra(EXTRA_IMAGETITLE); Log.d(TAG, "image title: " + currentImageTitle.getPrefixedText()); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + View decorView = getWindow().getDecorView(); + decorView.setOnSystemUiVisibilityChangeListener + (new View.OnSystemUiVisibilityChangeListener() { + @Override + public void onSystemUiVisibilityChange(int visibility) { + if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { + // The system bars are visible. Bring back controls right away + // to avoid the user having to click another time to get them back. + setControlsShowing(true); + } + } + }); + } if (savedInstanceState != null) { controlsShowing = savedInstanceState.getBoolean("controlsShowing"); @@ -185,6 +203,13 @@ } else { ViewAnimations.ensureTranslationY(toolbarContainer, -toolbarContainer.getHeight()); ViewAnimations.ensureTranslationY(infoContainer, infoContainer.getHeight()); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + // Hide the status and navigation bars. + int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_FULLSCREEN; + View decorView = getWindow().getDecorView(); + decorView.setSystemUiVisibility(uiOptions); + } } } -- To view, visit https://gerrit.wikimedia.org/r/179963 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00b24b5c45bfefa9ab3462532680f0d95bc14159 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: BearND <bsitzm...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits