Search in sources :

Example 1 with SlotView

use of com.android.gallery3d.ui.SlotView 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)

Example 2 with SlotView

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

the class ManageCachePage method initializeViews.

private void initializeViews() {
    Activity activity = mActivity;
    mSelectionManager = new SelectionManager(mActivity, true);
    mSelectionManager.setSelectionListener(this);
    Config.ManageCachePage config = Config.ManageCachePage.get(activity);
    mSlotView = new SlotView(mActivity, config.slotViewSpec);
    mSelectionDrawer = new ManageCacheDrawer(mActivity, mSelectionManager, mSlotView, config.labelSpec, config.cachePinSize, config.cachePinMargin);
    mSlotView.setSlotRenderer(mSelectionDrawer);
    mSlotView.setListener(new SlotView.SimpleListener() {

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

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

        @Override
        public void onSingleTapUp(int slotIndex) {
            ManageCachePage.this.onSingleTapUp(slotIndex);
        }
    });
    mRootPane.addComponent(mSlotView);
    initializeFooterViews();
}
Also used : ManageCacheDrawer(com.android.gallery3d.ui.ManageCacheDrawer) SelectionManager(com.android.gallery3d.ui.SelectionManager) SlotView(com.android.gallery3d.ui.SlotView) Activity(android.app.Activity)

Example 3 with SlotView

use of com.android.gallery3d.ui.SlotView 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

SelectionManager (com.android.gallery3d.ui.SelectionManager)3 SlotView (com.android.gallery3d.ui.SlotView)3 MenuItem (android.view.MenuItem)2 ActionModeHandler (com.android.gallery3d.ui.ActionModeHandler)2 ActionModeListener (com.android.gallery3d.ui.ActionModeHandler.ActionModeListener)2 Activity (android.app.Activity)1 AlbumSetSlotRenderer (com.android.gallery3d.ui.AlbumSetSlotRenderer)1 AlbumSlotRenderer (com.android.gallery3d.ui.AlbumSlotRenderer)1 ManageCacheDrawer (com.android.gallery3d.ui.ManageCacheDrawer)1