Search in sources :

Example 1 with SwipeDragItemTouchHelperCallback

use of org.videolan.vlc.gui.helpers.SwipeDragItemTouchHelperCallback in project vlc-android by videolan.

the class VideoPlayerActivity method initPlaylistUi.

private void initPlaylistUi() {
    if (mService.hasPlaylist()) {
        mHasPlaylist = true;
        mPlaylistAdapter = new PlaylistAdapter(this);
        mPlaylistAdapter.setService(mService);
        final LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mPlaylist.setLayoutManager(layoutManager);
        mPlaylistToggle.setVisibility(View.VISIBLE);
        mHudBinding.playlistPrevious.setVisibility(View.VISIBLE);
        mHudBinding.playlistNext.setVisibility(View.VISIBLE);
        mPlaylistToggle.setOnClickListener(VideoPlayerActivity.this);
        final ItemTouchHelper.Callback callback = new SwipeDragItemTouchHelperCallback(mPlaylistAdapter);
        final ItemTouchHelper touchHelper = new ItemTouchHelper(callback);
        touchHelper.attachToRecyclerView(mPlaylist);
    }
}
Also used : ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) SwipeDragItemTouchHelperCallback(org.videolan.vlc.gui.helpers.SwipeDragItemTouchHelperCallback) PlaylistAdapter(org.videolan.vlc.gui.audio.PlaylistAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 2 with SwipeDragItemTouchHelperCallback

use of org.videolan.vlc.gui.helpers.SwipeDragItemTouchHelperCallback in project vlc-android by GeoffreyMetais.

the class VideoPlayerActivity method initPlaylistUi.

private void initPlaylistUi() {
    if (mService.hasPlaylist()) {
        mHasPlaylist = true;
        mPlaylistAdapter = new PlaylistAdapter(this);
        mPlaylistAdapter.setService(mService);
        final LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
        mPlaylist.setLayoutManager(layoutManager);
        mPlaylistToggle.setVisibility(View.VISIBLE);
        mHudBinding.playlistPrevious.setVisibility(View.VISIBLE);
        mHudBinding.playlistNext.setVisibility(View.VISIBLE);
        mPlaylistToggle.setOnClickListener(VideoPlayerActivity.this);
        final ItemTouchHelper.Callback callback = new SwipeDragItemTouchHelperCallback(mPlaylistAdapter);
        final ItemTouchHelper touchHelper = new ItemTouchHelper(callback);
        touchHelper.attachToRecyclerView(mPlaylist);
    }
}
Also used : ItemTouchHelper(android.support.v7.widget.helper.ItemTouchHelper) SwipeDragItemTouchHelperCallback(org.videolan.vlc.gui.helpers.SwipeDragItemTouchHelperCallback) PlaylistAdapter(org.videolan.vlc.gui.audio.PlaylistAdapter) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)2 PlaylistAdapter (org.videolan.vlc.gui.audio.PlaylistAdapter)2 SwipeDragItemTouchHelperCallback (org.videolan.vlc.gui.helpers.SwipeDragItemTouchHelperCallback)2