diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2016-03-22 23:57:13 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-03-22 23:57:13 -0700 |
| commit | fcc433780cb7cb225a31307969ce3fbeaa040b1f (patch) | |
| tree | 69e1daeef01a0c66e765c628e258053396c4b89c | |
| parent | 806c8d7ea5af8728a72dbb1b99fcd83b5d324e3f (diff) | |
| parent | 4c35ffdef659d46804bee308465a0b89a5e2d77d (diff) | |
| download | android_packages_apps_Gallery2-fcc433780cb7cb225a31307969ce3fbeaa040b1f.tar.gz android_packages_apps_Gallery2-fcc433780cb7cb225a31307969ce3fbeaa040b1f.tar.bz2 android_packages_apps_Gallery2-fcc433780cb7cb225a31307969ce3fbeaa040b1f.zip | |
Merge "Gallery2: Status bar not display when viewing image/video" into android_ui.lnx.1.2-dev
5 files changed, 34 insertions, 5 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index 6a355577f..bcbf9d4ef 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -197,7 +197,7 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster paddingBottom = mConfig.paddingBottom; paddingRight = mConfig.paddingRight; - int slotViewTop = mActivity.getGalleryActionBar().getHeight() + int slotViewTop = mActivity.getToolbar().getLayoutParams().height + paddingTop; int slotViewBottom = bottom - top - paddingBottom; int slotViewRight = right - left - paddingRight; diff --git a/src/com/android/gallery3d/app/AlbumSetPage.java b/src/com/android/gallery3d/app/AlbumSetPage.java index 97c629a8c..d8dbad373 100644 --- a/src/com/android/gallery3d/app/AlbumSetPage.java +++ b/src/com/android/gallery3d/app/AlbumSetPage.java @@ -160,7 +160,7 @@ public class AlbumSetPage extends ActivityState implements paddingLeft = mConfig.paddingLeft; } - int slotViewTop = mActionBar.getHeight() + paddingTop; + int slotViewTop = mActivity.getToolbar().getLayoutParams().height + paddingTop; int slotViewBottom = bottom - top - paddingBottom; int slotViewRight = right - left - paddingRight; int slotViewLeft = paddingLeft ; diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 0a7d58944..a84a5cca6 100644 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -39,9 +39,12 @@ import android.text.TextUtils; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.view.ViewGroup; +import android.view.Window; import android.widget.RelativeLayout; import android.widget.ShareActionProvider; import android.widget.Toast; +import android.widget.Toolbar; import com.android.gallery3d.R; import com.android.gallery3d.common.ApiHelper; @@ -208,6 +211,10 @@ public abstract class PhotoPage extends ActivityState implements private ShareActionProvider mShareActionProvider; private Intent mShareIntent; + //use for saving the original height and padding of toolbar + private int originalHeight = 0; + private int originalPadding = 0; + private final PanoramaSupportCallback mUpdatePanoramaMenuItemsCallback = new PanoramaSupportCallback() { @Override public void panoramaInfoAvailable(MediaObject mediaObject, boolean isPanorama, @@ -1448,7 +1455,14 @@ public abstract class PhotoPage extends ActivityState implements public void onPause() { super.onPause(); mIsActive = false; - + //restore the orginal heigh and padding of toolbar + Toolbar toolbar = mActivity.getToolbar(); + if (toolbar != null) { + ViewGroup.LayoutParams layoutParams = toolbar.getLayoutParams(); + layoutParams.height = originalHeight; + toolbar.setLayoutParams(layoutParams); + toolbar.setPadding(0, originalPadding, 0, 0); + } mActivity.getGLRoot().unfreeze(); mHandler.removeMessages(MSG_UNFREEZE_GLROOT); @@ -1573,6 +1587,16 @@ public abstract class PhotoPage extends ActivityState implements transitionFromAlbumPageIfNeeded(); mActivity.getGLRoot().freeze(); + Toolbar toolbar = mActivity.getToolbar(); + //set the new height and padding to toolbar + if (toolbar != null) { + ViewGroup.LayoutParams layoutParams = toolbar.getLayoutParams(); + originalHeight = layoutParams.height; + originalPadding = toolbar.getPaddingTop(); + layoutParams.height = originalHeight - originalPadding; + toolbar.setPadding(0, 0, 0, 0); + toolbar.setLayoutParams(layoutParams); + } mIsActive = true; setContentPane(mRootPane); @@ -1592,8 +1616,9 @@ public abstract class PhotoPage extends ActivityState implements // } if (!mShowBars) { mActionBar.hide(); - mActivity.getGLRoot().setLightsOutMode(true); } + //hide the status bar + mActivity.getGLRoot().setLightsOutMode(true); boolean haveImageEditor = GalleryUtils.isEditorAvailable(mActivity, "image/*"); if (haveImageEditor != mHaveImageEditor) { mHaveImageEditor = haveImageEditor; diff --git a/src/com/android/gallery3d/app/TimeLinePage.java b/src/com/android/gallery3d/app/TimeLinePage.java index c2f406680..618f219f4 100755 --- a/src/com/android/gallery3d/app/TimeLinePage.java +++ b/src/com/android/gallery3d/app/TimeLinePage.java @@ -168,7 +168,7 @@ public class TimeLinePage extends ActivityState implements protected void onLayout( boolean changed, int left, int top, int right, int bottom) { - int slotViewTop = mActivity.getGalleryActionBar().getHeight(); + int slotViewTop = mActivity.getToolbar().getLayoutParams().height; int padding =0 ; if((right - left) > (bottom - top)) { padding = (int) mActivity.getResources().getDimension(R.dimen.timeline_land_margin); diff --git a/src/com/android/gallery3d/filtershow/FilterShowActivity.java b/src/com/android/gallery3d/filtershow/FilterShowActivity.java index 863cd1b2c..46f3d1621 100644 --- a/src/com/android/gallery3d/filtershow/FilterShowActivity.java +++ b/src/com/android/gallery3d/filtershow/FilterShowActivity.java @@ -303,6 +303,10 @@ public class FilterShowActivity extends FragmentActivity implements OnItemClickL doBindService(); getWindow().setBackgroundDrawable(new ColorDrawable(Color.GRAY)); setContentView(R.layout.filtershow_splashscreen); + Window win = getWindow(); + WindowManager.LayoutParams winParams = win.getAttributes(); + winParams.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; + win.setAttributes(winParams); } public boolean isShowingImageStatePanel() { |
