summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorhuiyan <huiyan@codeaurora.org>2016-04-23 14:52:23 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-04-26 00:12:05 -0700
commit8782c246345bf7be648d740dcad66de934729294 (patch)
tree9408875aefa63ca94bfab7e0f2faf80cd0cb68b1 /src
parent9166741f9eb6d7b337e2257b701fcf5556c88231 (diff)
downloadandroid_packages_apps_Gallery2-8782c246345bf7be648d740dcad66de934729294.tar.gz
android_packages_apps_Gallery2-8782c246345bf7be648d740dcad66de934729294.tar.bz2
android_packages_apps_Gallery2-8782c246345bf7be648d740dcad66de934729294.zip
Gallery2: Fix status bar and menu list are overlapped in photopage.
After the menu list open, the status bar is showed. So they overlapped. Set full screen in onResume state to hide status bar, and cancel full screen in onPause state to show status bar in photopage. Change-Id: I7af92a3c351b0b713126645e0270f454263356ee CRs-Fixed: 1004673
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/ActivityState.java7
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java18
-rw-r--r--src/com/android/gallery3d/app/SlideshowPage.java2
3 files changed, 26 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/ActivityState.java b/src/com/android/gallery3d/app/ActivityState.java
index 11be8c6dd..8ca584a12 100644
--- a/src/com/android/gallery3d/app/ActivityState.java
+++ b/src/com/android/gallery3d/app/ActivityState.java
@@ -46,6 +46,7 @@ abstract public class ActivityState {
protected static final int FLAG_SCREEN_ON_ALWAYS = 8;
protected static final int FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 16;
protected static final int FLAG_SHOW_WHEN_LOCKED = 32;
+ protected static final int FLAG_SCREEN_FULL = 64;
protected AbstractGalleryActivity mActivity;
protected Bundle mData;
@@ -164,6 +165,12 @@ abstract public class ActivityState {
} else {
params.flags &= ~WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
}
+
+ if (0 != (mFlags & FLAG_SCREEN_FULL)) {
+ params.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
+ } else {
+ params.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
+ }
win.setAttributes(params);
}
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index ac89a03d1..9f7a054d8 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -41,6 +41,7 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
+import android.view.WindowManager;
import android.widget.RelativeLayout;
import android.widget.ShareActionProvider;
import android.widget.Toast;
@@ -1470,6 +1471,7 @@ public abstract class PhotoPage extends ActivityState implements
}
mActivity.getGLRoot().unfreeze();
mHandler.removeMessages(MSG_UNFREEZE_GLROOT);
+ showFullScreen(false);
DetailsHelper.pause();
// Hide the detail dialog on exit
@@ -1490,6 +1492,19 @@ public abstract class PhotoPage extends ActivityState implements
if (mMediaSet != null) mMediaSet.clearDeletion();
}
+ private void showFullScreen(boolean show) {
+ Window win = mActivity.getWindow();
+ WindowManager.LayoutParams winParams = win.getAttributes();
+ if (show) {
+ //set full screen
+ winParams.flags |= (WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ } else {
+ //cancel full screen
+ winParams.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+ win.setAttributes(winParams);
+ }
+
@Override
public void onCurrentImageUpdated() {
mActivity.getGLRoot().unfreeze();
@@ -1580,6 +1595,9 @@ public abstract class PhotoPage extends ActivityState implements
mActivity.getStateManager().finishState(this);
return;
}
+ //set full screen to hide the status bar
+ showFullScreen(true);
+
transitionFromAlbumPageIfNeeded();
mActivity.getGLRoot().freeze();
diff --git a/src/com/android/gallery3d/app/SlideshowPage.java b/src/com/android/gallery3d/app/SlideshowPage.java
index ca46ce3e8..ffc5dbf32 100644
--- a/src/com/android/gallery3d/app/SlideshowPage.java
+++ b/src/com/android/gallery3d/app/SlideshowPage.java
@@ -113,7 +113,7 @@ public class SlideshowPage extends ActivityState {
@Override
public void onCreate(Bundle data, Bundle restoreState) {
super.onCreate(data, restoreState);
- mFlags |= (FLAG_HIDE_ACTION_BAR | FLAG_HIDE_STATUS_BAR);
+ mFlags |= (FLAG_HIDE_ACTION_BAR | FLAG_HIDE_STATUS_BAR | FLAG_SCREEN_FULL);
if (data.getBoolean(KEY_DREAM)) {
// Dream screensaver only keeps screen on for plugged devices.
mFlags |= FLAG_SCREEN_ON_WHEN_PLUGGED | FLAG_SHOW_WHEN_LOCKED;