|
1 | 1 | package org.schabi.newpipe.local.bookmark; |
2 | 2 |
|
3 | 3 | import static org.schabi.newpipe.local.bookmark.MergedPlaylistManager.getMergedOrderedPlaylists; |
4 | | -import static org.schabi.newpipe.util.ThemeHelper.shouldUseGridLayout; |
5 | 4 |
|
6 | 5 | import android.content.DialogInterface; |
7 | 6 | import android.os.Bundle; |
@@ -244,7 +243,7 @@ public void onDestroy() { |
244 | 243 | /////////////////////////////////////////////////////////////////////////// |
245 | 244 |
|
246 | 245 | private Subscriber<List<PlaylistLocalItem>> getPlaylistsSubscriber() { |
247 | | - return new Subscriber<List<PlaylistLocalItem>>() { |
| 246 | + return new Subscriber<>() { |
248 | 247 | @Override |
249 | 248 | public void onSubscribe(final Subscription s) { |
250 | 249 | showLoading(); |
@@ -276,7 +275,6 @@ public void onError(final Throwable exception) { |
276 | 275 |
|
277 | 276 | @Override |
278 | 277 | public void onComplete() { |
279 | | - // Do nothing. |
280 | 278 | } |
281 | 279 | }; |
282 | 280 | } |
@@ -418,11 +416,9 @@ public void saveImmediate() { |
418 | 416 | } |
419 | 417 |
|
420 | 418 | private ItemTouchHelper.SimpleCallback getItemTouchCallback() { |
421 | | - int directions = ItemTouchHelper.UP | ItemTouchHelper.DOWN; |
422 | | - if (shouldUseGridLayout(requireContext())) { |
423 | | - directions |= ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT; |
424 | | - } |
425 | | - return new ItemTouchHelper.SimpleCallback(directions, |
| 419 | + // if adding grid layout, also include ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT |
| 420 | + // with an `if (shouldUseGridLayout()) ...` |
| 421 | + return new ItemTouchHelper.SimpleCallback(ItemTouchHelper.UP | ItemTouchHelper.DOWN, |
426 | 422 | ItemTouchHelper.ACTION_STATE_IDLE) { |
427 | 423 | @Override |
428 | 424 | public int interpolateOutOfBoundsScroll(@NonNull final RecyclerView recyclerView, |
|
0 commit comments