Search in sources :

Example 1 with AlbumSlotRenderer

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

the class AlbumPage method initializeViews.

private void initializeViews() {
    mSelectionManager = new SelectionManager(mActivity, false);
    mSelectionManager.setSelectionListener(this);
    mConfig = Config.AlbumPage.get(mActivity);
    mConfigList = Config.AlbumPageList.get(mActivity);
    if (mViewType) {
        mSlotView = new SlotView(mActivity, mConfig.slotViewSpec);
        mAlbumView = new AlbumSlotRenderer(mActivity, mSlotView, mConfig.labelSpec, mSelectionManager, mConfig.placeholderColor, mViewType);
    } else {
        mSlotView = new SlotView(mActivity, mConfigList.slotViewSpec);
        mAlbumView = new AlbumSlotRenderer(mActivity, mSlotView, mConfigList.labelSpec, mSelectionManager, mConfig.placeholderColor, mViewType);
    }
    mSlotView.setSlotRenderer(mAlbumView);
    mRootPane.addComponent(mSlotView);
    mSlotView.setListener(new SlotView.SimpleListener() {

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

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

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

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

        @Override
        public boolean onActionItemClicked(MenuItem item) {
            return onItemSelected(item);
        }
    });
}
Also used : SelectionManager(com.android.gallery3d.ui.SelectionManager) SlotView(com.android.gallery3d.ui.SlotView) ActionModeListener(com.android.gallery3d.ui.ActionModeHandler.ActionModeListener) AlbumSlotRenderer(com.android.gallery3d.ui.AlbumSlotRenderer) 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 AlbumSlotRenderer (com.android.gallery3d.ui.AlbumSlotRenderer)1 SelectionManager (com.android.gallery3d.ui.SelectionManager)1 SlotView (com.android.gallery3d.ui.SlotView)1