From c27a26c0aa8278df93bfed0d1c8dda55b97da2b8 Mon Sep 17 00:00:00 2001 From: Stypox Date: Tue, 31 Mar 2020 09:36:35 +0200 Subject: [PATCH] Rename ic_hot in ic_kiosk_hot and improve getKioskIcon() --- app/src/main/java/org/schabi/newpipe/MainActivity.java | 5 ++--- .../org/schabi/newpipe/local/subscription/FeedGroupIcon.kt | 2 +- .../java/org/schabi/newpipe/settings/tabs/AddTabDialog.java | 2 +- .../org/schabi/newpipe/settings/tabs/ChooseTabsFragment.java | 5 +++-- app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java | 4 ++-- .../main/java/org/schabi/newpipe/util/KioskTranslator.java | 2 +- app/src/main/res/layout/feed_group_reorder_item.xml | 2 +- app/src/main/res/layout/list_choose_tabs.xml | 2 +- app/src/main/res/layout/list_choose_tabs_dialog.xml | 2 +- app/src/main/res/values/attrs.xml | 2 +- app/src/main/res/values/styles.xml | 4 ++-- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/MainActivity.java b/app/src/main/java/org/schabi/newpipe/MainActivity.java index 5e3aac83b..d74031704 100644 --- a/app/src/main/java/org/schabi/newpipe/MainActivity.java +++ b/app/src/main/java/org/schabi/newpipe/MainActivity.java @@ -165,8 +165,7 @@ public class MainActivity extends AppCompatActivity { drawerItems.getMenu() .add(R.id.menu_tabs_group, kioskId, 0, KioskTranslator .getTranslatedKioskName(ks, this)) - .setIcon(KioskTranslator.getKioskIcons(ks, this)); - kioskId++; + .setIcon(KioskTranslator.getKioskIcon(ks, this)); } drawerItems.getMenu() @@ -420,7 +419,7 @@ public class MainActivity extends AppCompatActivity { drawerItems.getMenu() .add(R.id.menu_tabs_group, kioskId, ORDER, KioskTranslator.getTranslatedKioskName(ks, this)) - .setIcon(KioskTranslator.getKioskIcons(ks, this)); + .setIcon(KioskTranslator.getKioskIcon(ks, this)); kioskId++; } diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/FeedGroupIcon.kt b/app/src/main/java/org/schabi/newpipe/local/subscription/FeedGroupIcon.kt index 39ec4b8d1..19038be93 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/FeedGroupIcon.kt +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/FeedGroupIcon.kt @@ -47,7 +47,7 @@ enum class FeedGroupIcon( SHOPPING_CART(27, R.attr.ic_shopping_cart), WATCH_LATER(28, R.attr.ic_watch_later), WORK(29, R.attr.ic_work), - HOT(30, R.attr.ic_hot), + HOT(30, R.attr.ic_kiosk_hot), CHANNEL(31, R.attr.ic_channel), BOOKMARK(32, R.attr.ic_bookmark), PETS(33, R.attr.ic_pets), diff --git a/app/src/main/java/org/schabi/newpipe/settings/tabs/AddTabDialog.java b/app/src/main/java/org/schabi/newpipe/settings/tabs/AddTabDialog.java index f03348890..52e50fbba 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/tabs/AddTabDialog.java +++ b/app/src/main/java/org/schabi/newpipe/settings/tabs/AddTabDialog.java @@ -60,7 +60,7 @@ public final class AddTabDialog { private DialogListAdapter(final Context context, final ChooseTabListItem[] items) { this.inflater = LayoutInflater.from(context); this.items = items; - this.fallbackIcon = ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_hot); + this.fallbackIcon = ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_kiosk_hot); } @Override diff --git a/app/src/main/java/org/schabi/newpipe/settings/tabs/ChooseTabsFragment.java b/app/src/main/java/org/schabi/newpipe/settings/tabs/ChooseTabsFragment.java index 8a3a7f67e..6ebfbd73c 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/tabs/ChooseTabsFragment.java +++ b/app/src/main/java/org/schabi/newpipe/settings/tabs/ChooseTabsFragment.java @@ -233,7 +233,7 @@ public class ChooseTabsFragment extends Fragment { case KIOSK: returnList.add(new ChooseTabListItem(tab.getTabId(), getString(R.string.kiosk_page_summary), - ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_hot))); + ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_kiosk_hot))); break; case CHANNEL: returnList.add(new ChooseTabListItem(tab.getTabId(), @@ -244,7 +244,8 @@ public class ChooseTabsFragment extends Fragment { if (!tabList.contains(tab)) { returnList.add(new ChooseTabListItem(tab.getTabId(), getString(R.string.default_kiosk_page_summary), - ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_hot))); + ThemeHelper.resolveResourceIdFromAttr(context, + R.attr.ic_kiosk_hot))); } break; default: diff --git a/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java b/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java index 5e3dc08dc..d06b4b14e 100644 --- a/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java +++ b/app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java @@ -323,7 +323,7 @@ public abstract class Tab { @DrawableRes @Override public int getTabIconRes(final Context context) { - final int kioskIcon = KioskTranslator.getKioskIcons(kioskId, context); + final int kioskIcon = KioskTranslator.getKioskIcon(kioskId, context); if (kioskIcon <= 0) { throw new IllegalStateException("Kiosk ID is not valid: \"" + kioskId + "\""); @@ -459,7 +459,7 @@ public abstract class Tab { @DrawableRes @Override public int getTabIconRes(final Context context) { - return KioskTranslator.getKioskIcons(getDefaultKioskId(context), context); + return KioskTranslator.getKioskIcon(getDefaultKioskId(context), context); } @Override diff --git a/app/src/main/java/org/schabi/newpipe/util/KioskTranslator.java b/app/src/main/java/org/schabi/newpipe/util/KioskTranslator.java index 2b036c6f1..ecc6e6b59 100644 --- a/app/src/main/java/org/schabi/newpipe/util/KioskTranslator.java +++ b/app/src/main/java/org/schabi/newpipe/util/KioskTranslator.java @@ -55,7 +55,7 @@ public final class KioskTranslator { case "Top 50": case "New & hot": case "conferences": - return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_hot); + return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_kiosk_hot); case "Local": return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_kiosk_local); case "Recently added": diff --git a/app/src/main/res/layout/feed_group_reorder_item.xml b/app/src/main/res/layout/feed_group_reorder_item.xml index 1b77c391f..04327e500 100644 --- a/app/src/main/res/layout/feed_group_reorder_item.xml +++ b/app/src/main/res/layout/feed_group_reorder_item.xml @@ -28,7 +28,7 @@ android:layout_centerVertical="true" android:layout_marginLeft="16dp" tools:ignore="ContentDescription,RtlHardcoded" - tools:src="?attr/ic_hot" /> + tools:src="?attr/ic_kiosk_hot" /> + tools:src="?attr/ic_kiosk_hot"/> + tools:src="?attr/ic_kiosk_hot"/> - + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index b37dcb216..fae608074 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -43,7 +43,7 @@ @drawable/ic_play_arrow_black_24dp @drawable/ic_pause_black_24dp @drawable/ic_settings_black_24dp - @drawable/ic_whatshot_black_24dp + @drawable/ic_whatshot_black_24dp @drawable/ic_home_black_24dp @drawable/ic_add_circle_outline_black_24dp @drawable/ic_tv_black_24dp @@ -149,7 +149,7 @@ @drawable/ic_more_vert_white_24dp @drawable/ic_play_arrow_white_24dp @drawable/ic_settings_white_24dp - @drawable/ic_whatshot_white_24dp + @drawable/ic_whatshot_white_24dp @drawable/ic_home_white_24dp @drawable/ic_add_circle_outline_white_24dp @drawable/ic_tv_white_24dp