Skip to content

Commit

Permalink
Fix warnings and allow moving only up and down even in grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Mar 30, 2024
1 parent 3cc0205 commit 819245c
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.schabi.newpipe.local.bookmark;

import static org.schabi.newpipe.local.bookmark.MergedPlaylistManager.getMergedOrderedPlaylists;
import static org.schabi.newpipe.util.ThemeHelper.shouldUseGridLayout;

import android.content.DialogInterface;
import android.os.Bundle;
Expand Down Expand Up @@ -244,7 +243,7 @@ public void onDestroy() {
///////////////////////////////////////////////////////////////////////////

private Subscriber<List<PlaylistLocalItem>> getPlaylistsSubscriber() {
return new Subscriber<List<PlaylistLocalItem>>() {
return new Subscriber<>() {
@Override
public void onSubscribe(final Subscription s) {
showLoading();
Expand Down Expand Up @@ -276,7 +275,6 @@ public void onError(final Throwable exception) {

@Override
public void onComplete() {
// Do nothing.
}
};
}
Expand Down Expand Up @@ -419,9 +417,7 @@ public void saveImmediate() {

private ItemTouchHelper.SimpleCallback getItemTouchCallback() {
int directions = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
if (shouldUseGridLayout(requireContext())) {
directions |= ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT;
}
// if adding grid layout, also include ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT
return new ItemTouchHelper.SimpleCallback(directions,
ItemTouchHelper.ACTION_STATE_IDLE) {
@Override
Expand Down

0 comments on commit 819245c

Please sign in to comment.