Long click favourite to select slot

This commit is contained in:
NekoInverter committed 2020-10-20 17:03:35 +08:00
1 parent a31b767431
commit 867bf43c68
2 files changed
+26 -1

No files matched your search

@@ -62,12 +62,17 @@ public final class CommonOperations {
public static void addToFavorites(final Activity activity, final GalleryInfo galleryInfo,
final EhClient.Callback<Void> listener) {
addToFavorites(activity, galleryInfo, listener, false);
}
public static void addToFavorites(final Activity activity, final GalleryInfo galleryInfo,
final EhClient.Callback<Void> listener, boolean select) {
int slot = Settings.getDefaultFavSlot();
String[] items = new String[11];
items[0] = activity.getString(R.string.local_favorites);
String[] favCat = Settings.getFavCat();
System.arraycopy(favCat, 0, items, 1, 10);
if (slot >= -1 && slot <= 9) {
if (!select && slot >= -1 && slot <= 9) {
String newFavoriteName = slot >= 0 ? items[slot + 1] : null;
doAddToFavorites(activity, galleryInfo, slot, new DelegateFavoriteCallback(listener, galleryInfo, newFavoriteName, slot));
} else {