diff options
author | Bobby Georgescu <georgescu@google.com> | 2013-03-08 20:15:15 -0800 |
---|---|---|
committer | Bobby Georgescu <georgescu@google.com> | 2013-03-13 14:20:31 -0700 |
commit | e2bc54a09412790da5ac7d19c52b964e49e14c25 (patch) | |
tree | 1a8b298139d71257aaaa7badef075760ae267546 /src/com/android/photos/GalleryActivity.java | |
parent | a27f45a5c142ec752f68ba752542972476dae8eb (diff) | |
download | android_packages_apps_Snap-e2bc54a09412790da5ac7d19c52b964e49e14c25.tar.gz android_packages_apps_Snap-e2bc54a09412790da5ac7d19c52b964e49e14c25.tar.bz2 android_packages_apps_Snap-e2bc54a09412790da5ac7d19c52b964e49e14c25.zip |
Sharing support for albums, bulk operations infrastructure
Change-Id: I590f60ab85ffbd9cf9d7cd9982627604fa1b427f
Diffstat (limited to 'src/com/android/photos/GalleryActivity.java')
-rw-r--r-- | src/com/android/photos/GalleryActivity.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/com/android/photos/GalleryActivity.java b/src/com/android/photos/GalleryActivity.java index 420fc3d51..ddf04e365 100644 --- a/src/com/android/photos/GalleryActivity.java +++ b/src/com/android/photos/GalleryActivity.java @@ -43,7 +43,7 @@ public class GalleryActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - + mSelectionManager = new SelectionManager(this); mViewPager = new ViewPager(this); mViewPager.setId(R.id.viewpager); setContentView(mViewPager); @@ -70,13 +70,6 @@ public class GalleryActivity extends Activity { outState.putInt("tab", getActionBar().getSelectedNavigationIndex()); } - protected SelectionManager getSelectionManager() { - if (mSelectionManager == null) { - mSelectionManager = new SelectionManager(this); - } - return mSelectionManager; - } - @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.gallery, menu); @@ -99,7 +92,7 @@ public class GalleryActivity extends Activity { public static class TabsAdapter extends FragmentPagerAdapter implements ActionBar.TabListener, ViewPager.OnPageChangeListener { - private final Context mContext; + private final GalleryActivity mActivity; private final ActionBar mActionBar; private final ViewPager mViewPager; private final ArrayList<TabInfo> mTabs = new ArrayList<TabInfo>(); @@ -115,9 +108,9 @@ public class GalleryActivity extends Activity { } } - public TabsAdapter(Activity activity, ViewPager pager) { + public TabsAdapter(GalleryActivity activity, ViewPager pager) { super(activity.getFragmentManager()); - mContext = activity; + mActivity = activity; mActionBar = activity.getActionBar(); mViewPager = pager; mViewPager.setAdapter(this); @@ -141,8 +134,11 @@ public class GalleryActivity extends Activity { @Override public Fragment getItem(int position) { TabInfo info = mTabs.get(position); - return Fragment.instantiate(mContext, info.clss.getName(), + Fragment item = Fragment.instantiate(mActivity, info.clss.getName(), info.args); + ((SelectionManager.Client) item).setSelectionManager( + mActivity.mSelectionManager); + return item; } @Override |