Fix Dark elements in Light Theme

pull/5927/head
krlvm 2021-03-27 17:45:49 +03:00
rodzic 1d51002173
commit fd14c8cdce
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B8552A91FD265536
288 zmienionych plików z 327 dodań i 560 usunięć

Wyświetl plik

@ -6,50 +6,50 @@
<PreferenceScreen <PreferenceScreen
android:fragment="org.schabi.newpipe.settings.VideoAudioSettingsFragment" android:fragment="org.schabi.newpipe.settings.VideoAudioSettingsFragment"
android:icon="?attr/ic_headset" android:icon="@drawable/ic_headset"
android:title="@string/settings_category_video_audio_title" android:title="@string/settings_category_video_audio_title"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<PreferenceScreen <PreferenceScreen
android:fragment="org.schabi.newpipe.settings.DownloadSettingsFragment" android:fragment="org.schabi.newpipe.settings.DownloadSettingsFragment"
android:icon="?attr/ic_file_download" android:icon="@drawable/ic_file_download"
android:title="@string/settings_category_downloads_title" android:title="@string/settings_category_downloads_title"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<PreferenceScreen <PreferenceScreen
android:fragment="org.schabi.newpipe.settings.AppearanceSettingsFragment" android:fragment="org.schabi.newpipe.settings.AppearanceSettingsFragment"
android:icon="?attr/ic_palette" android:icon="@drawable/ic_palette"
android:title="@string/settings_category_appearance_title" android:title="@string/settings_category_appearance_title"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<PreferenceScreen <PreferenceScreen
android:fragment="org.schabi.newpipe.settings.HistorySettingsFragment" android:fragment="org.schabi.newpipe.settings.HistorySettingsFragment"
android:icon="?attr/ic_history" android:icon="@drawable/ic_history"
android:title="@string/settings_category_history_title" android:title="@string/settings_category_history_title"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<PreferenceScreen <PreferenceScreen
android:fragment="org.schabi.newpipe.settings.ContentSettingsFragment" android:fragment="org.schabi.newpipe.settings.ContentSettingsFragment"
android:icon="?attr/ic_language" android:icon="@drawable/ic_language"
android:title="@string/content" android:title="@string/content"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<PreferenceScreen <PreferenceScreen
android:fragment="org.schabi.newpipe.settings.NotificationSettingsFragment" android:fragment="org.schabi.newpipe.settings.NotificationSettingsFragment"
android:icon="?attr/ic_play_arrow" android:icon="@drawable/ic_play_arrow"
android:title="@string/settings_category_notification_title" android:title="@string/settings_category_notification_title"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<PreferenceScreen <PreferenceScreen
android:fragment="org.schabi.newpipe.settings.UpdateSettingsFragment" android:fragment="org.schabi.newpipe.settings.UpdateSettingsFragment"
android:icon="?attr/ic_settings_update" android:icon="@drawable/ic_cloud_download"
android:key="update_pref_screen_key" android:key="update_pref_screen_key"
android:title="@string/settings_category_updates_title" android:title="@string/settings_category_updates_title"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />
<PreferenceScreen <PreferenceScreen
android:fragment="org.schabi.newpipe.settings.DebugSettingsFragment" android:fragment="org.schabi.newpipe.settings.DebugSettingsFragment"
android:icon="?attr/ic_bug_report" android:icon="@drawable/ic_bug_report"
android:key="@string/debug_pref_screen_key" android:key="@string/debug_pref_screen_key"
android:title="@string/settings_category_debug_title" android:title="@string/settings_category_debug_title"
app:iconSpaceReserved="false" /> app:iconSpaceReserved="false" />

Wyświetl plik

@ -182,27 +182,27 @@ public class MainActivity extends AppCompatActivity {
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_SUBSCRIPTIONS, ORDER, .add(R.id.menu_tabs_group, ITEM_ID_SUBSCRIPTIONS, ORDER,
R.string.tab_subscriptions) R.string.tab_subscriptions)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_channel)); .setIcon(R.drawable.ic_tv);
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_FEED, ORDER, R.string.fragment_feed_title) .add(R.id.menu_tabs_group, ITEM_ID_FEED, ORDER, R.string.fragment_feed_title)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_rss)); .setIcon(R.drawable.ic_rss_feed);
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_BOOKMARKS, ORDER, R.string.tab_bookmarks) .add(R.id.menu_tabs_group, ITEM_ID_BOOKMARKS, ORDER, R.string.tab_bookmarks)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_bookmark)); .setIcon(R.drawable.ic_bookmark);
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_DOWNLOADS, ORDER, R.string.downloads) .add(R.id.menu_tabs_group, ITEM_ID_DOWNLOADS, ORDER, R.string.downloads)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_file_download)); .setIcon(R.drawable.ic_file_download);
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history) .add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_history)); .setIcon(R.drawable.ic_history);
//Settings and About //Settings and About
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_options_about_group, ITEM_ID_SETTINGS, ORDER, R.string.settings) .add(R.id.menu_options_about_group, ITEM_ID_SETTINGS, ORDER, R.string.settings)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_settings)); .setIcon(R.drawable.ic_settings);
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_options_about_group, ITEM_ID_ABOUT, ORDER, R.string.tab_about) .add(R.id.menu_options_about_group, ITEM_ID_ABOUT, ORDER, R.string.tab_about)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_info_outline)); .setIcon(R.drawable.ic_info_outline);
toggle = new ActionBarDrawerToggle(this, mainBinding.getRoot(), toggle = new ActionBarDrawerToggle(this, mainBinding.getRoot(),
toolbarLayoutBinding.toolbar, R.string.drawer_open, R.string.drawer_close); toolbarLayoutBinding.toolbar, R.string.drawer_open, R.string.drawer_close);
@ -348,7 +348,7 @@ public class MainActivity extends AppCompatActivity {
} }
private void showServices() { private void showServices() {
drawerHeaderBinding.drawerArrow.setImageResource(R.drawable.ic_arrow_drop_up_white_24dp); drawerHeaderBinding.drawerArrow.setImageResource(R.drawable.ic_arrow_drop_up);
for (final StreamingService s : NewPipe.getServices()) { for (final StreamingService s : NewPipe.getServices()) {
final String title = s.getServiceInfo().getName() final String title = s.getServiceInfo().getName()
@ -414,7 +414,7 @@ public class MainActivity extends AppCompatActivity {
} }
private void showTabs() throws ExtractionException { private void showTabs() throws ExtractionException {
drawerHeaderBinding.drawerArrow.setImageResource(R.drawable.ic_arrow_drop_down_white_24dp); drawerHeaderBinding.drawerArrow.setImageResource(R.drawable.ic_arrow_drop_down);
//Tabs //Tabs
final int currentServiceId = ServiceHelper.getSelectedServiceId(this); final int currentServiceId = ServiceHelper.getSelectedServiceId(this);
@ -432,27 +432,27 @@ public class MainActivity extends AppCompatActivity {
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_SUBSCRIPTIONS, ORDER, R.string.tab_subscriptions) .add(R.id.menu_tabs_group, ITEM_ID_SUBSCRIPTIONS, ORDER, R.string.tab_subscriptions)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_channel)); .setIcon(R.drawable.ic_tv);
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_FEED, ORDER, R.string.fragment_feed_title) .add(R.id.menu_tabs_group, ITEM_ID_FEED, ORDER, R.string.fragment_feed_title)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_rss)); .setIcon(R.drawable.ic_rss_feed);
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_BOOKMARKS, ORDER, R.string.tab_bookmarks) .add(R.id.menu_tabs_group, ITEM_ID_BOOKMARKS, ORDER, R.string.tab_bookmarks)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_bookmark)); .setIcon(R.drawable.ic_bookmark);
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_DOWNLOADS, ORDER, R.string.downloads) .add(R.id.menu_tabs_group, ITEM_ID_DOWNLOADS, ORDER, R.string.downloads)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_file_download)); .setIcon(R.drawable.ic_file_download);
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history) .add(R.id.menu_tabs_group, ITEM_ID_HISTORY, ORDER, R.string.action_history)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_history)); .setIcon(R.drawable.ic_history);
//Settings and About //Settings and About
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_options_about_group, ITEM_ID_SETTINGS, ORDER, R.string.settings) .add(R.id.menu_options_about_group, ITEM_ID_SETTINGS, ORDER, R.string.settings)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_settings)); .setIcon(R.drawable.ic_settings);
drawerLayoutBinding.navigation.getMenu() drawerLayoutBinding.navigation.getMenu()
.add(R.id.menu_options_about_group, ITEM_ID_ABOUT, ORDER, R.string.tab_about) .add(R.id.menu_options_about_group, ITEM_ID_ABOUT, ORDER, R.string.tab_about)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(this, R.attr.ic_info_outline)); .setIcon(R.drawable.ic_info_outline);
} }
@Override @Override

Wyświetl plik

@ -91,7 +91,6 @@ import io.reactivex.rxjava3.schedulers.Schedulers;
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.AUDIO; import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.AUDIO;
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.VIDEO; import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.VIDEO;
import static org.schabi.newpipe.util.ThemeHelper.resolveResourceIdFromAttr;
/** /**
* Get the url from the intent and open it in the chosen preferred player. * Get the url from the intent and open it in the chosen preferred player.
@ -231,7 +230,7 @@ public class RouterActivity extends AppCompatActivity {
new AlertDialog.Builder(context) new AlertDialog.Builder(context)
.setTitle(R.string.unsupported_url) .setTitle(R.string.unsupported_url)
.setMessage(R.string.unsupported_url_dialog_message) .setMessage(R.string.unsupported_url_dialog_message)
.setIcon(ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_share)) .setIcon(R.drawable.ic_share)
.setPositiveButton(R.string.open_in_browser, .setPositiveButton(R.string.open_in_browser,
(dialog, which) -> ShareUtils.openUrlInBrowser(this, url)) (dialog, which) -> ShareUtils.openUrlInBrowser(this, url))
.setNegativeButton(R.string.share, .setNegativeButton(R.string.share,
@ -427,16 +426,16 @@ public class RouterActivity extends AppCompatActivity {
final AdapterChoiceItem videoPlayer = new AdapterChoiceItem( final AdapterChoiceItem videoPlayer = new AdapterChoiceItem(
getString(R.string.video_player_key), getString(R.string.video_player), getString(R.string.video_player_key), getString(R.string.video_player),
resolveResourceIdFromAttr(context, R.attr.ic_play_arrow)); R.drawable.ic_play_arrow);
final AdapterChoiceItem showInfo = new AdapterChoiceItem( final AdapterChoiceItem showInfo = new AdapterChoiceItem(
getString(R.string.show_info_key), getString(R.string.show_info), getString(R.string.show_info_key), getString(R.string.show_info),
resolveResourceIdFromAttr(context, R.attr.ic_info_outline)); R.drawable.ic_info_outline);
final AdapterChoiceItem popupPlayer = new AdapterChoiceItem( final AdapterChoiceItem popupPlayer = new AdapterChoiceItem(
getString(R.string.popup_player_key), getString(R.string.popup_player), getString(R.string.popup_player_key), getString(R.string.popup_player),
resolveResourceIdFromAttr(context, R.attr.ic_popup)); R.drawable.ic_picture_in_picture);
final AdapterChoiceItem backgroundPlayer = new AdapterChoiceItem( final AdapterChoiceItem backgroundPlayer = new AdapterChoiceItem(
getString(R.string.background_player_key), getString(R.string.background_player), getString(R.string.background_player_key), getString(R.string.background_player),
resolveResourceIdFromAttr(context, R.attr.ic_headset)); R.drawable.ic_headset);
if (linkType == LinkType.STREAM) { if (linkType == LinkType.STREAM) {
if (isExtVideoEnabled) { if (isExtVideoEnabled) {
@ -481,7 +480,7 @@ public class RouterActivity extends AppCompatActivity {
returnList.add(new AdapterChoiceItem(getString(R.string.download_key), returnList.add(new AdapterChoiceItem(getString(R.string.download_key),
getString(R.string.download), getString(R.string.download),
resolveResourceIdFromAttr(context, R.attr.ic_file_download))); R.drawable.ic_file_download));
return returnList; return returnList;
} }

Wyświetl plik

@ -394,8 +394,7 @@ public class DownloadDialog extends DialogFragment
} }
toolbar.setTitle(R.string.download_dialog_title); toolbar.setTitle(R.string.download_dialog_title);
toolbar.setNavigationIcon( toolbar.setNavigationIcon(R.drawable.ic_arrow_back);
ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_arrow_back));
toolbar.inflateMenu(R.menu.dialog_url); toolbar.inflateMenu(R.menu.dialog_url);
toolbar.setNavigationOnClickListener(v -> requireDialog().dismiss()); toolbar.setNavigationOnClickListener(v -> requireDialog().dismiss());
toolbar.setNavigationContentDescription(R.string.cancel); toolbar.setNavigationContentDescription(R.string.cancel);

Wyświetl plik

@ -1,7 +1,6 @@
package org.schabi.newpipe.fragments; package org.schabi.newpipe.fragments;
import android.content.Context; import android.content.Context;
import android.content.res.ColorStateList;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -30,7 +29,6 @@ import org.schabi.newpipe.settings.tabs.Tab;
import org.schabi.newpipe.settings.tabs.TabsManager; import org.schabi.newpipe.settings.tabs.TabsManager;
import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ServiceHelper; import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.ThemeHelper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -87,8 +85,6 @@ public class MainFragment extends BaseFragment implements TabLayout.OnTabSelecte
binding = FragmentMainBinding.bind(rootView); binding = FragmentMainBinding.bind(rootView);
binding.mainTabLayout.setTabIconTint(ColorStateList.valueOf(
ThemeHelper.resolveColorFromAttr(requireContext(), R.attr.colorAccent)));
binding.mainTabLayout.setupWithViewPager(binding.pager); binding.mainTabLayout.setupWithViewPager(binding.pager);
binding.mainTabLayout.addOnTabSelectedListener(this); binding.mainTabLayout.addOnTabSelectedListener(this);

Wyświetl plik

@ -923,21 +923,21 @@ public final class VideoDetailFragment
if (shouldShowComments()) { if (shouldShowComments()) {
pageAdapter.addFragment( pageAdapter.addFragment(
CommentsFragment.getInstance(serviceId, url, title), COMMENTS_TAB_TAG); CommentsFragment.getInstance(serviceId, url, title), COMMENTS_TAB_TAG);
tabIcons.add(R.drawable.ic_comment_white_24dp); tabIcons.add(R.drawable.ic_comment);
tabContentDescriptions.add(R.string.comments_tab_description); tabContentDescriptions.add(R.string.comments_tab_description);
} }
if (showRelatedStreams && binding.relatedStreamsLayout == null) { if (showRelatedStreams && binding.relatedStreamsLayout == null) {
// temp empty fragment. will be updated in handleResult // temp empty fragment. will be updated in handleResult
pageAdapter.addFragment(new EmptyFragment(false), RELATED_TAB_TAG); pageAdapter.addFragment(new EmptyFragment(false), RELATED_TAB_TAG);
tabIcons.add(R.drawable.ic_art_track_white_24dp); tabIcons.add(R.drawable.ic_art_track);
tabContentDescriptions.add(R.string.related_streams_tab_description); tabContentDescriptions.add(R.string.related_streams_tab_description);
} }
if (showDescription) { if (showDescription) {
// temp empty fragment. will be updated in handleResult // temp empty fragment. will be updated in handleResult
pageAdapter.addFragment(new EmptyFragment(false), DESCRIPTION_TAB_TAG); pageAdapter.addFragment(new EmptyFragment(false), DESCRIPTION_TAB_TAG);
tabIcons.add(R.drawable.ic_description_white_24dp); tabIcons.add(R.drawable.ic_description);
tabContentDescriptions.add(R.string.description_tab_description); tabContentDescriptions.add(R.string.description_tab_description);
} }
@ -2274,11 +2274,10 @@ public final class VideoDetailFragment
} }
private void setOverlayPlayPauseImage(final boolean playerIsPlaying) { private void setOverlayPlayPauseImage(final boolean playerIsPlaying) {
final int attr = playerIsPlaying final int drawable = playerIsPlaying
? R.attr.ic_pause ? R.drawable.ic_pause
: R.attr.ic_play_arrow; : R.drawable.ic_play_arrow;
binding.overlayPlayPauseButton.setImageResource( binding.overlayPlayPauseButton.setImageResource(drawable);
ThemeHelper.resolveResourceIdFromAttr(activity, attr));
} }
private void setOverlayLook(final AppBarLayout appBar, private void setOverlayLook(final AppBarLayout appBar,

Wyświetl plik

@ -61,7 +61,6 @@ import io.reactivex.rxjava3.disposables.Disposable;
import static org.schabi.newpipe.ktx.ViewUtils.animate; import static org.schabi.newpipe.ktx.ViewUtils.animate;
import static org.schabi.newpipe.ktx.ViewUtils.animateHideRecyclerViewAllowingScrolling; import static org.schabi.newpipe.ktx.ViewUtils.animateHideRecyclerViewAllowingScrolling;
import static org.schabi.newpipe.util.ThemeHelper.resolveResourceIdFromAttr;
public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> { public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
private CompositeDisposable disposables; private CompositeDisposable disposables;
@ -307,7 +306,7 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
getResources().getColor(R.color.transparent_background_color)); getResources().getColor(R.color.transparent_background_color));
headerBinding.uploaderAvatarView.setImageDrawable( headerBinding.uploaderAvatarView.setImageDrawable(
AppCompatResources.getDrawable(requireContext(), AppCompatResources.getDrawable(requireContext(),
resolveResourceIdFromAttr(requireContext(), R.attr.ic_radio)) R.drawable.ic_radio)
); );
} else { } else {
IMAGE_LOADER.displayImage(avatarUrl, headerBinding.uploaderAvatarView, IMAGE_LOADER.displayImage(avatarUrl, headerBinding.uploaderAvatarView,
@ -459,13 +458,13 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
return; return;
} }
final int iconAttr = playlistEntity == null final int drawable = playlistEntity == null
? R.attr.ic_playlist_add : R.attr.ic_playlist_check; ? R.drawable.ic_playlist_add : R.drawable.ic_playlist_add_check;
final int titleRes = playlistEntity == null final int titleRes = playlistEntity == null
? R.string.bookmark_playlist : R.string.unbookmark_playlist; ? R.string.bookmark_playlist : R.string.unbookmark_playlist;
playlistBookmarkButton.setIcon(resolveResourceIdFromAttr(activity, iconAttr)); playlistBookmarkButton.setIcon(drawable);
playlistBookmarkButton.setTitle(titleRes); playlistBookmarkButton.setTitle(titleRes);
} }
} }

Wyświetl plik

@ -117,8 +117,8 @@ public class SuggestionListAdapter
queryView = rootView.findViewById(R.id.suggestion_search); queryView = rootView.findViewById(R.id.suggestion_search);
insertView = rootView.findViewById(R.id.suggestion_insert); insertView = rootView.findViewById(R.id.suggestion_insert);
historyResId = resolveResourceIdFromAttr(rootView.getContext(), R.attr.ic_history); historyResId = R.drawable.ic_history;
searchResId = resolveResourceIdFromAttr(rootView.getContext(), R.attr.ic_search); searchResId = R.drawable.ic_search;
} }
private static int resolveResourceIdFromAttr(final Context context, private static int resolveResourceIdFromAttr(final Context context,

Wyświetl plik

@ -40,7 +40,6 @@ import org.schabi.newpipe.util.KoreUtil;
import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.OnClickGesture; import org.schabi.newpipe.util.OnClickGesture;
import org.schabi.newpipe.util.StreamDialogEntry; import org.schabi.newpipe.util.StreamDialogEntry;
import org.schabi.newpipe.util.ThemeHelper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
@ -312,14 +311,13 @@ public class StatisticsPlaylistFragment
if (sortMode == StatisticSortMode.LAST_PLAYED) { if (sortMode == StatisticSortMode.LAST_PLAYED) {
sortMode = StatisticSortMode.MOST_PLAYED; sortMode = StatisticSortMode.MOST_PLAYED;
setTitle(getString(R.string.title_most_played)); setTitle(getString(R.string.title_most_played));
headerBinding.sortButtonIcon.setImageResource( headerBinding.sortButtonIcon.setImageResource(R.drawable.ic_history);
ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_history));
headerBinding.sortButtonText.setText(R.string.title_last_played); headerBinding.sortButtonText.setText(R.string.title_last_played);
} else { } else {
sortMode = StatisticSortMode.LAST_PLAYED; sortMode = StatisticSortMode.LAST_PLAYED;
setTitle(getString(R.string.title_last_played)); setTitle(getString(R.string.title_last_played));
headerBinding.sortButtonIcon.setImageResource( headerBinding.sortButtonIcon.setImageResource(
ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_filter_list)); R.drawable.ic_filter_list);
headerBinding.sortButtonText.setText(R.string.title_most_played); headerBinding.sortButtonText.setText(R.string.title_most_played);
} }
startLoading(true); startLoading(true);

Wyświetl plik

@ -1,10 +1,7 @@
package org.schabi.newpipe.local.subscription package org.schabi.newpipe.local.subscription
import android.content.Context
import androidx.annotation.AttrRes
import androidx.annotation.DrawableRes import androidx.annotation.DrawableRes
import org.schabi.newpipe.R import org.schabi.newpipe.R
import org.schabi.newpipe.util.ThemeHelper
enum class FeedGroupIcon( enum class FeedGroupIcon(
/** /**
@ -13,51 +10,51 @@ enum class FeedGroupIcon(
val id: Int, val id: Int,
/** /**
* The attribute that points to a drawable resource. "R.attr" is used here to support multiple themes. * The drawable resource.
*/ */
@AttrRes val drawableResourceAttr: Int @DrawableRes val drawableResource: Int
) { ) {
ALL(0, R.attr.ic_asterisk), ALL(0, R.drawable.ic_asterisk),
MUSIC(1, R.attr.ic_music_note), MUSIC(1, R.drawable.ic_music_note),
EDUCATION(2, R.attr.ic_school), EDUCATION(2, R.drawable.ic_school),
FITNESS(3, R.attr.ic_fitness_center), FITNESS(3, R.drawable.ic_fitness_center),
SPACE(4, R.attr.ic_telescope), SPACE(4, R.drawable.ic_telescope),
COMPUTER(5, R.attr.ic_computer), COMPUTER(5, R.drawable.ic_computer),
GAMING(6, R.attr.ic_videogame_asset), GAMING(6, R.drawable.ic_videogame_asset),
SPORTS(7, R.attr.ic_sports), SPORTS(7, R.drawable.ic_directions_bike),
NEWS(8, R.attr.ic_megaphone), NEWS(8, R.drawable.ic_megaphone),
FAVORITES(9, R.attr.ic_heart), FAVORITES(9, R.drawable.ic_favorite),
CAR(10, R.attr.ic_car), CAR(10, R.drawable.ic_directions_car),
MOTORCYCLE(11, R.attr.ic_motorcycle), MOTORCYCLE(11, R.drawable.ic_motorcycle),
TREND(12, R.attr.ic_trending_up), TREND(12, R.drawable.ic_trending_up),
MOVIE(13, R.attr.ic_movie), MOVIE(13, R.drawable.ic_movie),
BACKUP(14, R.attr.ic_backup), BACKUP(14, R.drawable.ic_backup),
ART(15, R.attr.ic_palette), ART(15, R.drawable.ic_palette),
PERSON(16, R.attr.ic_person), PERSON(16, R.drawable.ic_person),
PEOPLE(17, R.attr.ic_people), PEOPLE(17, R.drawable.ic_people),
MONEY(18, R.attr.ic_money), MONEY(18, R.drawable.ic_attach_money),
KIDS(19, R.attr.ic_child_care), KIDS(19, R.drawable.ic_child_care),
FOOD(20, R.attr.ic_fastfood), FOOD(20, R.drawable.ic_fastfood),
SMILE(21, R.attr.ic_smile), SMILE(21, R.drawable.ic_insert_emoticon),
EXPLORE(22, R.attr.ic_explore), EXPLORE(22, R.drawable.ic_explore),
RESTAURANT(23, R.attr.ic_restaurant), RESTAURANT(23, R.drawable.ic_restaurant),
MIC(24, R.attr.ic_mic), MIC(24, R.drawable.ic_mic),
HEADSET(25, R.attr.ic_headset), HEADSET(25, R.drawable.ic_headset),
RADIO(26, R.attr.ic_radio), RADIO(26, R.drawable.ic_radio),
SHOPPING_CART(27, R.attr.ic_shopping_cart), SHOPPING_CART(27, R.drawable.ic_shopping_cart),
WATCH_LATER(28, R.attr.ic_watch_later), WATCH_LATER(28, R.drawable.ic_watch_later),
WORK(29, R.attr.ic_work), WORK(29, R.drawable.ic_work),
HOT(30, R.attr.ic_kiosk_hot), HOT(30, R.drawable.ic_whatshot),
CHANNEL(31, R.attr.ic_channel), CHANNEL(31, R.drawable.ic_tv),
BOOKMARK(32, R.attr.ic_bookmark), BOOKMARK(32, R.drawable.ic_bookmark),
PETS(33, R.attr.ic_pets), PETS(33, R.drawable.ic_pets),
WORLD(34, R.attr.ic_world), WORLD(34, R.drawable.ic_public),
STAR(35, R.attr.ic_stars), STAR(35, R.drawable.ic_stars),
SUN(36, R.attr.ic_sunny), SUN(36, R.drawable.ic_wb_sunny),
RSS(37, R.attr.ic_rss); RSS(37, R.drawable.ic_rss_feed);
@DrawableRes @DrawableRes
fun getDrawableRes(context: Context): Int { fun getDrawableRes(): Int {
return ThemeHelper.resolveResourceIdFromAttr(context, drawableResourceAttr) return drawableResource
} }
} }

Wyświetl plik

@ -62,7 +62,6 @@ import org.schabi.newpipe.util.FilePickerActivityHelper
import org.schabi.newpipe.util.NavigationHelper import org.schabi.newpipe.util.NavigationHelper
import org.schabi.newpipe.util.OnClickGesture import org.schabi.newpipe.util.OnClickGesture
import org.schabi.newpipe.util.ShareUtils import org.schabi.newpipe.util.ShareUtils
import org.schabi.newpipe.util.ThemeHelper
import java.io.File import java.io.File
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Date import java.util.Date
@ -257,7 +256,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
feedGroupsCarousel = FeedGroupCarouselItem(requireContext(), carouselAdapter) feedGroupsCarousel = FeedGroupCarouselItem(requireContext(), carouselAdapter)
feedGroupsSortMenuItem = HeaderWithMenuItem( feedGroupsSortMenuItem = HeaderWithMenuItem(
getString(R.string.feed_groups_header_title), getString(R.string.feed_groups_header_title),
ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_sort), R.drawable.ic_sort,
menuItemOnClickListener = ::openReorderDialog menuItemOnClickListener = ::openReorderDialog
) )
add(Section(feedGroupsSortMenuItem, listOf(feedGroupsCarousel))) add(Section(feedGroupsSortMenuItem, listOf(feedGroupsCarousel)))

Wyświetl plik

@ -306,7 +306,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable {
groupSortOrder = feedGroupEntity?.sortOrder ?: -1 groupSortOrder = feedGroupEntity?.sortOrder ?: -1
val feedGroupIcon = if (selectedIcon == null) icon else selectedIcon!! val feedGroupIcon = if (selectedIcon == null) icon else selectedIcon!!
feedGroupCreateBinding.iconPreview.setImageResource(feedGroupIcon.getDrawableRes(requireContext())) feedGroupCreateBinding.iconPreview.setImageResource(feedGroupIcon.getDrawableRes())
if (feedGroupCreateBinding.groupNameInput.text.isNullOrBlank()) { if (feedGroupCreateBinding.groupNameInput.text.isNullOrBlank()) {
feedGroupCreateBinding.groupNameInput.setText(name) feedGroupCreateBinding.groupNameInput.setText(name)
@ -404,7 +404,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable {
if (groupId == NO_GROUP_SELECTED) { if (groupId == NO_GROUP_SELECTED) {
val icon = selectedIcon ?: FeedGroupIcon.ALL val icon = selectedIcon ?: FeedGroupIcon.ALL
feedGroupCreateBinding.iconPreview.setImageResource(icon.getDrawableRes(requireContext())) feedGroupCreateBinding.iconPreview.setImageResource(icon.getDrawableRes())
} }
} }

Wyświetl plik

@ -25,7 +25,7 @@ data class FeedGroupCardItem(
override fun bind(viewBinding: FeedGroupCardItemBinding, position: Int) { override fun bind(viewBinding: FeedGroupCardItemBinding, position: Int) {
viewBinding.title.text = name viewBinding.title.text = name
viewBinding.icon.setImageResource(icon.getDrawableRes(viewBinding.root.context)) viewBinding.icon.setImageResource(icon.getDrawableRes())
} }
override fun initializeViewBinding(view: View) = FeedGroupCardItemBinding.bind(view) override fun initializeViewBinding(view: View) = FeedGroupCardItemBinding.bind(view)

Wyświetl plik

@ -32,7 +32,7 @@ data class FeedGroupReorderItem(
override fun bind(viewBinding: FeedGroupReorderItemBinding, position: Int) { override fun bind(viewBinding: FeedGroupReorderItemBinding, position: Int) {
viewBinding.groupName.text = name viewBinding.groupName.text = name
viewBinding.groupIcon.setImageResource(icon.getDrawableRes(viewBinding.root.context)) viewBinding.groupIcon.setImageResource(icon.getDrawableRes())
} }
override fun bind(viewHolder: GroupieViewHolder<FeedGroupReorderItemBinding>, position: Int, payloads: MutableList<Any>) { override fun bind(viewHolder: GroupieViewHolder<FeedGroupReorderItemBinding>, position: Int, payloads: MutableList<Any>) {

Wyświetl plik

@ -86,7 +86,7 @@ class FeedImportExportItem(
private fun setupImportFromItems(listHolder: ViewGroup) { private fun setupImportFromItems(listHolder: ViewGroup) {
val previousBackupItem = addItemView( val previousBackupItem = addItemView(
listHolder.context.getString(R.string.previous_export), listHolder.context.getString(R.string.previous_export),
ThemeHelper.resolveResourceIdFromAttr(listHolder.context, R.attr.ic_backup), listHolder R.drawable.ic_backup, listHolder
) )
previousBackupItem.setOnClickListener { onImportPreviousSelected() } previousBackupItem.setOnClickListener { onImportPreviousSelected() }
@ -115,7 +115,7 @@ class FeedImportExportItem(
private fun setupExportToItems(listHolder: ViewGroup) { private fun setupExportToItems(listHolder: ViewGroup) {
val previousBackupItem = addItemView( val previousBackupItem = addItemView(
listHolder.context.getString(R.string.file), listHolder.context.getString(R.string.file),
ThemeHelper.resolveResourceIdFromAttr(listHolder.context, R.attr.ic_save), R.drawable.ic_save,
listHolder listHolder
) )
previousBackupItem.setOnClickListener { onExportSelected() } previousBackupItem.setOnClickListener { onExportSelected() }

Wyświetl plik

@ -13,7 +13,7 @@ class PickerIconItem(
val icon: FeedGroupIcon val icon: FeedGroupIcon
) : BindableItem<PickerIconItemBinding>() { ) : BindableItem<PickerIconItemBinding>() {
@DrawableRes @DrawableRes
val iconRes: Int = icon.getDrawableRes(context) val iconRes: Int = icon.getDrawableRes()
override fun getLayout(): Int = R.layout.picker_icon_item override fun getLayout(): Int = R.layout.picker_icon_item

Wyświetl plik

@ -50,11 +50,11 @@ public final class NotificationConstants {
R.drawable.exo_icon_fastforward, R.drawable.exo_icon_fastforward,
R.drawable.exo_icon_previous, R.drawable.exo_icon_previous,
R.drawable.exo_icon_next, R.drawable.exo_icon_next,
R.drawable.ic_pause_white_24dp, R.drawable.ic_pause,
R.drawable.ic_hourglass_top_white_24dp, R.drawable.ic_hourglass_top,
R.drawable.exo_icon_repeat_all, R.drawable.exo_icon_repeat_all,
R.drawable.exo_icon_shuffle_on, R.drawable.exo_icon_shuffle_on,
R.drawable.ic_close_white_24dp, R.drawable.ic_close,
}; };

Wyświetl plik

@ -273,14 +273,14 @@ public final class NotificationUtil {
|| player.getCurrentState() == Player.STATE_BLOCKED || player.getCurrentState() == Player.STATE_BLOCKED
|| player.getCurrentState() == Player.STATE_BUFFERING) { || player.getCurrentState() == Player.STATE_BUFFERING) {
// null intent -> show hourglass icon that does nothing when clicked // null intent -> show hourglass icon that does nothing when clicked
return new NotificationCompat.Action(R.drawable.ic_hourglass_top_white_24dp_png, return new NotificationCompat.Action(R.drawable.ic_hourglass_top,
player.getContext().getString(R.string.notification_action_buffering), player.getContext().getString(R.string.notification_action_buffering),
null); null);
} }
case NotificationConstants.PLAY_PAUSE: case NotificationConstants.PLAY_PAUSE:
if (player.getCurrentState() == Player.STATE_COMPLETED) { if (player.getCurrentState() == Player.STATE_COMPLETED) {
return getAction(player, R.drawable.ic_replay_white_24dp_png, return getAction(player, R.drawable.ic_replay,
R.string.exo_controls_pause_description, ACTION_PLAY_PAUSE); R.string.exo_controls_pause_description, ACTION_PLAY_PAUSE);
} else if (player.isPlaying() } else if (player.isPlaying()
|| player.getCurrentState() == Player.STATE_PREFLIGHT || player.getCurrentState() == Player.STATE_PREFLIGHT
@ -315,7 +315,7 @@ public final class NotificationUtil {
} }
case NotificationConstants.CLOSE: case NotificationConstants.CLOSE:
return getAction(player, R.drawable.ic_close_white_24dp_png, return getAction(player, R.drawable.ic_close,
R.string.close, ACTION_CLOSE); R.string.close, ACTION_CLOSE);
case NotificationConstants.NOTHING: case NotificationConstants.NOTHING:

Wyświetl plik

@ -589,15 +589,15 @@ public final class PlayQueueActivity extends AppCompatActivity
switch (state) { switch (state) {
case Player.STATE_PAUSED: case Player.STATE_PAUSED:
queueControlBinding.controlPlayPause queueControlBinding.controlPlayPause
.setImageResource(R.drawable.ic_play_arrow_white_24dp); .setImageResource(R.drawable.ic_play_arrow);
break; break;
case Player.STATE_PLAYING: case Player.STATE_PLAYING:
queueControlBinding.controlPlayPause queueControlBinding.controlPlayPause
.setImageResource(R.drawable.ic_pause_white_24dp); .setImageResource(R.drawable.ic_pause);
break; break;
case Player.STATE_COMPLETED: case Player.STATE_COMPLETED:
queueControlBinding.controlPlayPause queueControlBinding.controlPlayPause
.setImageResource(R.drawable.ic_replay_white_24dp); .setImageResource(R.drawable.ic_replay);
break; break;
default: default:
break; break;
@ -670,8 +670,7 @@ public final class PlayQueueActivity extends AppCompatActivity
//2) Icon change accordingly to current App Theme //2) Icon change accordingly to current App Theme
// using rootView.getContext() because getApplicationContext() didn't work // using rootView.getContext() because getApplicationContext() didn't work
final Context context = queueControlBinding.getRoot().getContext(); final Context context = queueControlBinding.getRoot().getContext();
item.setIcon(ThemeHelper.resolveResourceIdFromAttr(context, item.setIcon(player.isMuted() ? R.drawable.ic_volume_off : R.drawable.ic_volume_up);
player.isMuted() ? R.attr.ic_volume_off : R.attr.ic_volume_up));
} }
} }
} }

Wyświetl plik

@ -957,7 +957,7 @@ public final class Player implements
= LinearLayout.LayoutParams.MATCH_PARENT; = LinearLayout.LayoutParams.MATCH_PARENT;
binding.secondaryControls.setVisibility(View.INVISIBLE); binding.secondaryControls.setVisibility(View.INVISIBLE);
binding.moreOptionsButton.setImageDrawable(AppCompatResources.getDrawable(context, binding.moreOptionsButton.setImageDrawable(AppCompatResources.getDrawable(context,
R.drawable.ic_expand_more_white_24dp)); R.drawable.ic_expand_more));
binding.share.setVisibility(View.VISIBLE); binding.share.setVisibility(View.VISIBLE);
binding.openInBrowser.setVisibility(View.VISIBLE); binding.openInBrowser.setVisibility(View.VISIBLE);
binding.switchMute.setVisibility(View.VISIBLE); binding.switchMute.setVisibility(View.VISIBLE);
@ -2020,7 +2020,7 @@ public final class Player implements
animate(binding.loadingPanel, true, 0); animate(binding.loadingPanel, true, 0);
animate(binding.surfaceForeground, true, 100); animate(binding.surfaceForeground, true, 100);
binding.playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp); binding.playPauseButton.setImageResource(R.drawable.ic_play_arrow);
animatePlayButtons(false, 100); animatePlayButtons(false, 100);
binding.getRoot().setKeepScreenOn(false); binding.getRoot().setKeepScreenOn(false);
@ -2049,7 +2049,7 @@ public final class Player implements
animate(binding.playPauseButton, false, 80, AnimationType.SCALE_AND_ALPHA, 0, animate(binding.playPauseButton, false, 80, AnimationType.SCALE_AND_ALPHA, 0,
() -> { () -> {
binding.playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp); binding.playPauseButton.setImageResource(R.drawable.ic_pause);
animatePlayButtons(true, 200); animatePlayButtons(true, 200);
if (!isQueueVisible) { if (!isQueueVisible) {
binding.playPauseButton.requestFocus(); binding.playPauseButton.requestFocus();
@ -2090,7 +2090,7 @@ public final class Player implements
animate(binding.playPauseButton, false, 80, AnimationType.SCALE_AND_ALPHA, 0, animate(binding.playPauseButton, false, 80, AnimationType.SCALE_AND_ALPHA, 0,
() -> { () -> {
binding.playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp); binding.playPauseButton.setImageResource(R.drawable.ic_play_arrow);
animatePlayButtons(true, 200); animatePlayButtons(true, 200);
if (!isQueueVisible) { if (!isQueueVisible) {
binding.playPauseButton.requestFocus(); binding.playPauseButton.requestFocus();
@ -2129,7 +2129,7 @@ public final class Player implements
animate(binding.playPauseButton, false, 0, AnimationType.SCALE_AND_ALPHA, 0, animate(binding.playPauseButton, false, 0, AnimationType.SCALE_AND_ALPHA, 0,
() -> { () -> {
binding.playPauseButton.setImageResource(R.drawable.ic_replay_white_24dp); binding.playPauseButton.setImageResource(R.drawable.ic_replay);
animatePlayButtons(true, DEFAULT_CONTROLS_DURATION); animatePlayButtons(true, DEFAULT_CONTROLS_DURATION);
}); });
@ -2290,7 +2290,7 @@ public final class Player implements
private void setMuteButton(final ImageButton button, final boolean isMuted) { private void setMuteButton(final ImageButton button, final boolean isMuted) {
button.setImageDrawable(AppCompatResources.getDrawable(context, isMuted button.setImageDrawable(AppCompatResources.getDrawable(context, isMuted
? R.drawable.ic_volume_off_white_24dp : R.drawable.ic_volume_up_white_24dp)); ? R.drawable.ic_volume_off : R.drawable.ic_volume_up));
} }
//endregion //endregion
@ -2734,7 +2734,7 @@ public final class Player implements
} }
seekBy(retrieveSeekDurationFromPreferences(this)); seekBy(retrieveSeekDurationFromPreferences(this));
triggerProgressUpdate(); triggerProgressUpdate();
showAndAnimateControl(R.drawable.ic_fast_forward_white_24dp, true); showAndAnimateControl(R.drawable.ic_fast_forward, true);
} }
public void fastRewind() { public void fastRewind() {
@ -2743,7 +2743,7 @@ public final class Player implements
} }
seekBy(-retrieveSeekDurationFromPreferences(this)); seekBy(-retrieveSeekDurationFromPreferences(this));
triggerProgressUpdate(); triggerProgressUpdate();
showAndAnimateControl(R.drawable.ic_fast_rewind_white_24dp, true); showAndAnimateControl(R.drawable.ic_fast_rewind, true);
} }
//endregion //endregion
@ -3691,8 +3691,8 @@ public final class Player implements
|| DeviceUtils.isTablet(context)) || DeviceUtils.isTablet(context))
? View.VISIBLE : View.GONE); ? View.VISIBLE : View.GONE);
binding.screenRotationButton.setImageDrawable(AppCompatResources.getDrawable(context, binding.screenRotationButton.setImageDrawable(AppCompatResources.getDrawable(context,
isFullscreen ? R.drawable.ic_fullscreen_exit_white_24dp isFullscreen ? R.drawable.ic_fullscreen_exit
: R.drawable.ic_fullscreen_white_24dp)); : R.drawable.ic_fullscreen));
} }
private void setResizeMode(@AspectRatioFrameLayout.ResizeMode final int resizeMode) { private void setResizeMode(@AspectRatioFrameLayout.ResizeMode final int resizeMode) {

Wyświetl plik

@ -147,10 +147,10 @@ public class PlayerGestureListener
player.getVolumeImageView().setImageDrawable( player.getVolumeImageView().setImageDrawable(
AppCompatResources.getDrawable(service, currentProgressPercent <= 0 AppCompatResources.getDrawable(service, currentProgressPercent <= 0
? R.drawable.ic_volume_off_white_24dp ? R.drawable.ic_volume_off
: currentProgressPercent < 0.25 ? R.drawable.ic_volume_mute_white_24dp : currentProgressPercent < 0.25 ? R.drawable.ic_volume_mute
: currentProgressPercent < 0.75 ? R.drawable.ic_volume_down_white_24dp : currentProgressPercent < 0.75 ? R.drawable.ic_volume_down
: R.drawable.ic_volume_up_white_24dp) : R.drawable.ic_volume_up)
); );
if (player.getVolumeRelativeLayout().getVisibility() != View.VISIBLE) { if (player.getVolumeRelativeLayout().getVisibility() != View.VISIBLE) {
@ -189,10 +189,10 @@ public class PlayerGestureListener
player.getBrightnessImageView().setImageDrawable( player.getBrightnessImageView().setImageDrawable(
AppCompatResources.getDrawable(service, AppCompatResources.getDrawable(service,
currentProgressPercent < 0.25 currentProgressPercent < 0.25
? R.drawable.ic_brightness_low_white_24dp ? R.drawable.ic_brightness_low
: currentProgressPercent < 0.75 : currentProgressPercent < 0.75
? R.drawable.ic_brightness_medium_white_24dp ? R.drawable.ic_brightness_medium
: R.drawable.ic_brightness_high_white_24dp) : R.drawable.ic_brightness_high)
); );
if (player.getBrightnessRelativeLayout().getVisibility() != View.VISIBLE) { if (player.getBrightnessRelativeLayout().getVisibility() != View.VISIBLE) {

Wyświetl plik

@ -145,10 +145,8 @@ public class PeertubeInstanceListFragment extends Fragment {
final MenuItem restoreItem = menu final MenuItem restoreItem = menu
.add(Menu.NONE, MENU_ITEM_RESTORE_ID, Menu.NONE, R.string.restore_defaults); .add(Menu.NONE, MENU_ITEM_RESTORE_ID, Menu.NONE, R.string.restore_defaults);
restoreItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); restoreItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
restoreItem.setIcon(AppCompatResources.getDrawable(requireContext(),
final int restoreIcon = ThemeHelper R.drawable.ic_settings_backup_restore));
.resolveResourceIdFromAttr(requireContext(), R.attr.ic_restore_defaults);
restoreItem.setIcon(AppCompatResources.getDrawable(requireContext(), restoreIcon));
} }
@Override @Override

Wyświetl plik

@ -14,7 +14,6 @@ import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatImageView; import androidx.appcompat.widget.AppCompatImageView;
import org.schabi.newpipe.R; import org.schabi.newpipe.R;
import org.schabi.newpipe.util.ThemeHelper;
public final class AddTabDialog { public final class AddTabDialog {
private final AlertDialog dialog; private final AlertDialog dialog;
@ -60,7 +59,7 @@ public final class AddTabDialog {
private DialogListAdapter(final Context context, final ChooseTabListItem[] items) { private DialogListAdapter(final Context context, final ChooseTabListItem[] items) {
this.inflater = LayoutInflater.from(context); this.inflater = LayoutInflater.from(context);
this.items = items; this.items = items;
this.fallbackIcon = ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_kiosk_hot); this.fallbackIcon = R.drawable.ic_whatshot;
} }
@Override @Override

Wyświetl plik

@ -113,9 +113,8 @@ public class ChooseTabsFragment extends Fragment {
R.string.restore_defaults); R.string.restore_defaults);
restoreItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); restoreItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
final int restoreIcon = ThemeHelper.resolveResourceIdFromAttr(requireContext(), restoreItem.setIcon(AppCompatResources.getDrawable(requireContext(),
R.attr.ic_restore_defaults); R.drawable.ic_settings_backup_restore));
restoreItem.setIcon(AppCompatResources.getDrawable(requireContext(), restoreIcon));
} }
@Override @Override
@ -241,7 +240,7 @@ public class ChooseTabsFragment extends Fragment {
case KIOSK: case KIOSK:
returnList.add(new ChooseTabListItem(tab.getTabId(), returnList.add(new ChooseTabListItem(tab.getTabId(),
getString(R.string.kiosk_page_summary), getString(R.string.kiosk_page_summary),
ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_kiosk_hot))); R.drawable.ic_whatshot));
break; break;
case CHANNEL: case CHANNEL:
returnList.add(new ChooseTabListItem(tab.getTabId(), returnList.add(new ChooseTabListItem(tab.getTabId(),
@ -252,8 +251,7 @@ public class ChooseTabsFragment extends Fragment {
if (!tabList.contains(tab)) { if (!tabList.contains(tab)) {
returnList.add(new ChooseTabListItem(tab.getTabId(), returnList.add(new ChooseTabListItem(tab.getTabId(),
getString(R.string.default_kiosk_page_summary), getString(R.string.default_kiosk_page_summary),
ThemeHelper.resolveResourceIdFromAttr(context, R.drawable.ic_whatshot));
R.attr.ic_kiosk_hot)));
} }
break; break;
case PLAYLIST: case PLAYLIST:

Wyświetl plik

@ -30,7 +30,6 @@ import org.schabi.newpipe.local.playlist.LocalPlaylistFragment;
import org.schabi.newpipe.local.subscription.SubscriptionFragment; import org.schabi.newpipe.local.subscription.SubscriptionFragment;
import org.schabi.newpipe.util.KioskTranslator; import org.schabi.newpipe.util.KioskTranslator;
import org.schabi.newpipe.util.ServiceHelper; import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.ThemeHelper;
import java.util.Objects; import java.util.Objects;
@ -188,7 +187,7 @@ public abstract class Tab {
@DrawableRes @DrawableRes
@Override @Override
public int getTabIconRes(final Context context) { public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_blank_page); return R.drawable.ic_crop_portrait;
} }
@Override @Override
@ -213,7 +212,7 @@ public abstract class Tab {
@DrawableRes @DrawableRes
@Override @Override
public int getTabIconRes(final Context context) { public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_channel); return R.drawable.ic_tv;
} }
@Override @Override
@ -239,7 +238,7 @@ public abstract class Tab {
@DrawableRes @DrawableRes
@Override @Override
public int getTabIconRes(final Context context) { public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_rss); return R.drawable.ic_rss_feed;
} }
@Override @Override
@ -264,7 +263,7 @@ public abstract class Tab {
@DrawableRes @DrawableRes
@Override @Override
public int getTabIconRes(final Context context) { public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_bookmark); return R.drawable.ic_bookmark;
} }
@Override @Override
@ -289,7 +288,7 @@ public abstract class Tab {
@DrawableRes @DrawableRes
@Override @Override
public int getTabIconRes(final Context context) { public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_history); return R.drawable.ic_history;
} }
@Override @Override
@ -409,7 +408,7 @@ public abstract class Tab {
@DrawableRes @DrawableRes
@Override @Override
public int getTabIconRes(final Context context) { public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_channel); return R.drawable.ic_tv;
} }
@Override @Override
@ -541,7 +540,7 @@ public abstract class Tab {
@DrawableRes @DrawableRes
@Override @Override
public int getTabIconRes(final Context context) { public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_bookmark); return R.drawable.ic_bookmark;
} }
@Override @Override

Wyświetl plik

@ -63,20 +63,20 @@ public final class KioskTranslator {
case "Top 50": case "Top 50":
case "New & hot": case "New & hot":
case "conferences": case "conferences":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_kiosk_hot); return R.drawable.ic_whatshot;
case "Local": case "Local":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_kiosk_local); return R.drawable.ic_home;
case "Recently added": case "Recently added":
case "recent": case "recent":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_kiosk_recent); return R.drawable.ic_add_circle_outline;
case "Most liked": case "Most liked":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_thumb_up); return R.drawable.ic_thumb_up;
case "live": case "live":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_live_tv); return R.drawable.ic_live_tv;
case "Featured": case "Featured":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_stars); return R.drawable.ic_stars;
case "Radio": case "Radio":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_radio); return R.drawable.ic_radio;
default: default:
return 0; return 0;
} }

Wyświetl plik

@ -224,10 +224,9 @@ public class MissionsFragment extends Fragment {
mList.setAdapter(mAdapter); mList.setAdapter(mAdapter);
if (mSwitch != null) { if (mSwitch != null) {
mSwitch.setIcon(ThemeHelper.resolveResourceIdFromAttr( mSwitch.setIcon(mLinear
requireContext(), mLinear ? R.drawable.ic_apps
? R.attr.ic_grid : R.drawable.ic_list);
: R.attr.ic_list));
mSwitch.setTitle(mLinear ? R.string.grid : R.string.list); mSwitch.setTitle(mLinear ? R.string.grid : R.string.list);
mPrefs.edit().putBoolean("linear", mLinear).apply(); mPrefs.edit().putBoolean("linear", mLinear).apply();
} }

Wyświetl plik

@ -182,12 +182,12 @@ public class Utility {
public static int getIconForFileType(FileType type) { public static int getIconForFileType(FileType type) {
switch (type) { switch (type) {
case MUSIC: case MUSIC:
return R.drawable.ic_headset_white_24dp; return R.drawable.ic_headset;
default: default:
case VIDEO: case VIDEO:
return R.drawable.ic_movie_white_24dp; return R.drawable.ic_movie;
case SUBTITLE: case SUBTITLE:
return R.drawable.ic_subtitles_white_24dp; return R.drawable.ic_subtitles;
} }
} }

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 358 B

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 358 B

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 262 B

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 262 B

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 511 B

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 511 B

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 244 B

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 244 B

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 223 B

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 223 B

Wyświetl plik

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 345 B

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 345 B

Some files were not shown because too many files have changed in this diff Show More