File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/local/bookmark Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .schabi .newpipe .local .bookmark ;
22
33import static org .schabi .newpipe .local .bookmark .MergedPlaylistManager .getMergedOrderedPlaylists ;
4+ import static org .schabi .newpipe .util .ThemeHelper .shouldUseGridLayout ;
45
56import android .content .DialogInterface ;
67import android .os .Bundle ;
@@ -417,10 +418,11 @@ public void saveImmediate() {
417418 }
418419
419420 private ItemTouchHelper .SimpleCallback getItemTouchCallback () {
420- // if adding grid layout, also include ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT
421- // with an `if (shouldUseGridLayout()) ...`
422- return new ItemTouchHelper .SimpleCallback (ItemTouchHelper .UP | ItemTouchHelper .DOWN ,
423- ItemTouchHelper .ACTION_STATE_IDLE ) {
421+ int directions = ItemTouchHelper .UP | ItemTouchHelper .DOWN ;
422+ if (shouldUseGridLayout (requireContext ())) {
423+ directions |= ItemTouchHelper .LEFT | ItemTouchHelper .RIGHT ;
424+ }
425+ return new ItemTouchHelper .SimpleCallback (directions , ItemTouchHelper .ACTION_STATE_IDLE ) {
424426 @ Override
425427 public int interpolateOutOfBoundsScroll (@ NonNull final RecyclerView recyclerView ,
426428 final int viewSize ,
You can’t perform that action at this time.
0 commit comments