Search in sources :

Example 1 with AlbumSetSlotRenderer

use of com.android.gallery3d.ui.AlbumSetSlotRenderer in project android_packages_apps_Gallery2 by LineageOS.

the class AlbumSetPage method initializeViews.

private void initializeViews() {
    mSelectionManager = new SelectionManager(mActivity, true);
    mSelectionManager.setSelectionListener(this);
    mConfig = Config.AlbumSetPage.get(mActivity);
    mSlotView = new SlotView(mActivity, mConfig.slotViewSpec);
    mAlbumSetView = new AlbumSetSlotRenderer(mActivity, mSelectionManager, mSlotView, mConfig.labelSpec, mConfig.placeholderColor);
    mSlotView.setSlotRenderer(mAlbumSetView);
    mSlotView.setListener(new SlotView.SimpleListener() {

        @Override
        public void onDown(int index) {
            AlbumSetPage.this.onDown(index);
        }

        @Override
        public void onUp(boolean followedByLongPress) {
            AlbumSetPage.this.onUp(followedByLongPress);
        }

        @Override
        public void onSingleTapUp(int slotIndex) {
            AlbumSetPage.this.onSingleTapUp(slotIndex);
        }

        @Override
        public void onLongTap(int slotIndex) {
            AlbumSetPage.this.onLongTap(slotIndex);
        }
    });
    mActionModeHandler = new ActionModeHandler(mActivity, mSelectionManager);
    mActionModeHandler.setActionModeListener(new ActionModeListener() {

        @Override
        public boolean onActionItemClicked(MenuItem item) {
            return onItemSelected(item);
        }
    });
    mRootPane.addComponent(mSlotView);
}
Also used : SelectionManager(com.android.gallery3d.ui.SelectionManager) SlotView(com.android.gallery3d.ui.SlotView) ActionModeListener(com.android.gallery3d.ui.ActionModeHandler.ActionModeListener) AlbumSetSlotRenderer(com.android.gallery3d.ui.AlbumSetSlotRenderer) MenuItem(android.view.MenuItem) ActionModeHandler(com.android.gallery3d.ui.ActionModeHandler)

Aggregations

MenuItem (android.view.MenuItem)1 ActionModeHandler (com.android.gallery3d.ui.ActionModeHandler)1 ActionModeListener (com.android.gallery3d.ui.ActionModeHandler.ActionModeListener)1 AlbumSetSlotRenderer (com.android.gallery3d.ui.AlbumSetSlotRenderer)1 SelectionManager (com.android.gallery3d.ui.SelectionManager)1 SlotView (com.android.gallery3d.ui.SlotView)1