Search in sources :

Example 1 with TimeLineSlotView

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

the class TimeLinePage method initializeViews.

private void initializeViews() {
    mSelectionManager = new SelectionManager(mActivity, false);
    mSelectionManager.setSelectionListener(this);
    Config.TimeLinePage config = Config.TimeLinePage.get(mActivity);
    mSlotView = new TimeLineSlotView(mActivity, config.slotViewSpec);
    mAlbumView = new TimeLineSlotRenderer(mActivity, mSlotView, mSelectionManager, config.labelSpec, config.placeholderColor);
    mSlotView.setSlotRenderer(mAlbumView);
    mRootPane.addComponent(mSlotView);
    mSlotView.setListener(new TimeLineSlotView.SimpleListener() {

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

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

        @Override
        public void onSingleTapUp(int slotIndex, boolean isTitle) {
            TimeLinePage.this.onSingleTapUp(slotIndex, isTitle);
        }

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

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