diff options
author | cretin45 <cretin45@gmail.com> | 2014-12-17 15:01:26 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-03-28 14:56:24 -0700 |
commit | d29332b5cc904c7c0fa10419e1ba3a73edf747a0 (patch) | |
tree | 21e8796dd942521f375eaf4f57ab24d315979a49 /src/com/android/gallery3d/app/AlbumPage.java | |
parent | 51aa540d08dfd7ef45a9851dbdda20c62d8edc03 (diff) | |
download | android_packages_apps_Gallery2-d29332b5cc904c7c0fa10419e1ba3a73edf747a0.tar.gz android_packages_apps_Gallery2-d29332b5cc904c7c0fa10419e1ba3a73edf747a0.tar.bz2 android_packages_apps_Gallery2-d29332b5cc904c7c0fa10419e1ba3a73edf747a0.zip |
Gallery2: Make grids scroll vertically by default
- Can optionally be switched back to horizontal via overlay.
Change-Id: I666a2e7cfe95cba630171b6272eda9a786be4cb6
Diffstat (limited to 'src/com/android/gallery3d/app/AlbumPage.java')
-rw-r--r-- | src/com/android/gallery3d/app/AlbumPage.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index 7824bf763..d0056fcfd 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -113,6 +113,7 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster private Path mMediaSetPath; private String mParentMediaSetString; private SlotView mSlotView; + private Config.AlbumPage mConfig; private AlbumDataLoader mAlbumDataAdapter; @@ -179,9 +180,9 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster protected void onLayout( boolean changed, int left, int top, int right, int bottom) { - int slotViewTop = mActivity.getGalleryActionBar().getHeight(); - int slotViewBottom = bottom - top; - int slotViewRight = right - left; + int slotViewTop = mActivity.getGalleryActionBar().getHeight() + mConfig.paddingTop; + int slotViewBottom = bottom - top - mConfig.paddingBottom; + int slotViewRight = right - left - mConfig.paddingRight; if (mShowDetails) { mDetailsHelper.layout(left, slotViewTop, right, bottom); @@ -190,8 +191,8 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster } // Set the mSlotView as a reference point to the open animation - mOpenCenter.setReferencePosition(0, slotViewTop); - mSlotView.layout(0, slotViewTop, slotViewRight, slotViewBottom); + mOpenCenter.setReferencePosition(mConfig.paddingLeft, slotViewTop); + mSlotView.layout(mConfig.paddingLeft, slotViewTop, slotViewRight, slotViewBottom); GalleryUtils.setViewPointMatrix(mMatrix, (right - left) / 2, (bottom - top) / 2, -mUserDistance); } @@ -610,10 +611,10 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster private void initializeViews() { mSelectionManager = new SelectionManager(mActivity, false); mSelectionManager.setSelectionListener(this); - Config.AlbumPage config = Config.AlbumPage.get(mActivity); - mSlotView = new SlotView(mActivity, config.slotViewSpec); + mConfig = Config.AlbumPage.get(mActivity); + mSlotView = new SlotView(mActivity, mConfig.slotViewSpec); mAlbumView = new AlbumSlotRenderer(mActivity, mSlotView, - mSelectionManager, config.placeholderColor); + mSelectionManager, mConfig.placeholderColor); mSlotView.setSlotRenderer(mAlbumView); mRootPane.addComponent(mSlotView); mSlotView.setListener(new SlotView.SimpleListener() { |