From 1ac62541a8b601c15816065ba5d4a2b8702afa8b Mon Sep 17 00:00:00 2001 From: Jared Fantaye Date: Fri, 9 Dec 2022 12:01:59 +0100 Subject: [PATCH] Formatting, renaming and small fixes --- .../playlist/model/PlaylistEntity.java | 18 +++++++++--------- .../local/bookmark/BookmarkFragment.java | 16 +++++++--------- .../local/playlist/LocalPlaylistFragment.java | 13 +++++++------ .../local/playlist/LocalPlaylistManager.java | 7 ++++--- app/src/main/res/values/strings.xml | 1 - 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistEntity.java b/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistEntity.java index a04a284da..051b7c318 100644 --- a/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistEntity.java +++ b/app/src/main/java/org/schabi/newpipe/database/playlist/model/PlaylistEntity.java @@ -15,7 +15,7 @@ public class PlaylistEntity { public static final String PLAYLIST_ID = "uid"; public static final String PLAYLIST_NAME = "name"; public static final String PLAYLIST_THUMBNAIL_URL = "thumbnail_url"; - public static final String PLAYLIST_THUMBNAIL_SET = "isThumbnailSet"; + public static final String PLAYLIST_THUMBNAIL_PERMANENT = "isThumbnailSet"; @PrimaryKey(autoGenerate = true) @ColumnInfo(name = PLAYLIST_ID) @@ -27,14 +27,14 @@ public class PlaylistEntity { @ColumnInfo(name = PLAYLIST_THUMBNAIL_URL) private String thumbnailUrl; - @ColumnInfo(name = PLAYLIST_THUMBNAIL_SET) - private boolean isThumbnailSet; + @ColumnInfo(name = PLAYLIST_THUMBNAIL_PERMANENT) + private boolean isThumbnailPermanent; public PlaylistEntity(final String name, final String thumbnailUrl, - final boolean isThumbnailSet) { + final boolean isThumbnailPermanent) { this.name = name; this.thumbnailUrl = thumbnailUrl; - this.isThumbnailSet = isThumbnailSet; + this.isThumbnailPermanent = isThumbnailPermanent; } public long getUid() { @@ -61,12 +61,12 @@ public class PlaylistEntity { this.thumbnailUrl = thumbnailUrl; } - public boolean getIsThumbnailSet() { - return isThumbnailSet; + public boolean getIsThumbnailPermanent() { + return isThumbnailPermanent; } - public void setIsThumbnailSet(final boolean isThumbnailSet) { - this.isThumbnailSet = isThumbnailSet; + public void setIsThumbnailPermanent(final boolean isThumbnailSet) { + this.isThumbnailPermanent = isThumbnailSet; } } diff --git a/app/src/main/java/org/schabi/newpipe/local/bookmark/BookmarkFragment.java b/app/src/main/java/org/schabi/newpipe/local/bookmark/BookmarkFragment.java index 1ef61bf31..8cb544e0b 100644 --- a/app/src/main/java/org/schabi/newpipe/local/bookmark/BookmarkFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/bookmark/BookmarkFragment.java @@ -262,12 +262,12 @@ public final class BookmarkFragment extends BaseLocalListFragment arrayAdapter = getLocalDialogArrayAdapter(isPlaylistThumbnailSet, + final ArrayAdapter arrayAdapter = getLocalDialogArrayAdapter(isThumbnailPermanent, unsetThumbnail); arrayAdapter.addAll(rename, delete, unsetThumbnail); @@ -277,11 +277,10 @@ public final class BookmarkFragment extends BaseLocalListFragment getLocalDialogArrayAdapter(final boolean isPlaylistThumbnailSet, final String unsetThumbnail) { - return new ArrayAdapter<>(getContext(), - android.R.layout.simple_list_item_1) { + return new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1) { @Override public View getView(final int position, final View convertView, final ViewGroup parent) { diff --git a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java index 78e455c78..d584ceefb 100644 --- a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java @@ -405,8 +405,8 @@ public class LocalPlaylistFragment extends BaseLocalListFragment { // Remove Watched, Functionality data final List notWatchedItems = new ArrayList<>(); - final boolean isThumbnailSet = playlistManager - .getIsPlaylistThumbnailSet(playlistId); + final boolean isThumbnailPermanent = playlistManager + .getIsPlaylistThumbnailPermanent(playlistId); boolean thumbnailVideoRemoved = false; if (removePartiallyWatched) { @@ -416,7 +416,7 @@ public class LocalPlaylistFragment extends BaseLocalListFragmentInstall Cancel OK - Yes Open in browser Mark as watched Open in popup mode