Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,14 @@ private void initToolbar(final Toolbar toolbar) {
}

toolbar.setTitle(R.string.download_dialog_title);
toolbar.setNavigationIcon(
ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_arrow_back));
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);

toolbar.inflateMenu(R.menu.dialog_url);
toolbar.setNavigationOnClickListener(v -> requireDialog().dismiss());
toolbar.setNavigationContentDescription(R.string.cancel);

okButton = toolbar.findViewById(R.id.okay);
okButton.setTextColor(getResources().getColor(R.color.white));
okButton.setEnabled(false); // disable until the download service connection is done

toolbar.setOnMenuItemClickListener(item -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import org.schabi.newpipe.settings.tabs.TabsManager;
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.ThemeHelper;
import org.schabi.newpipe.views.ScrollableTabLayout;

import java.util.ArrayList;
Expand Down Expand Up @@ -93,7 +92,7 @@ protected void initViews(final View rootView, final Bundle savedInstanceState) {
viewPager = rootView.findViewById(R.id.pager);

tabLayout.setTabIconTint(ColorStateList.valueOf(
ThemeHelper.resolveColorFromAttr(requireContext(), R.attr.colorAccent)));
getResources().getColor(R.color.white)));
tabLayout.setupWithViewPager(viewPager);
tabLayout.addOnTabSelectedListener(this);

Expand Down Expand Up @@ -184,8 +183,10 @@ private void setupTabs() {
}

private void updateTabsIconAndDescription() {

for (int i = 0; i < tabsList.size(); i++) {
final TabLayout.Tab tabToSet = tabLayout.getTabAt(i);

if (tabToSet != null) {
final Tab tab = tabsList.get(i);
tabToSet.setIcon(tab.getTabIconRes(requireContext()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,9 @@ private void setupActionBar(final StreamInfo info) {
public void onItemSelected(final AdapterView<?> parent, final View view,
final int position, final long id) {
selectedVideoStreamIndex = position;
RelativeLayout r = (RelativeLayout) parent.getChildAt(0);
((TextView) r.getChildAt(1)).setTextColor(getResources().getColor(R.color.white));
((TextView) r.getChildAt(2)).setTextColor(getResources().getColor(R.color.white));
Comment on lines +746 to +748
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there any other way to do this? It seems to be a workaround to me, though if there is no other way then ok, I guess the toolbar inflated layout is always the same.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any direct way of styling just the first element of a spinner, so had to use this approach.

}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.ShareUtils;
import org.schabi.newpipe.util.StreamDialogEntry;
import org.schabi.newpipe.util.ThemeHelper;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -470,13 +469,12 @@ private void updateBookmarkButtons() {
return;
}

final int iconAttr = playlistEntity == null
? R.attr.ic_playlist_add : R.attr.ic_playlist_check;
playlistBookmarkButton.setIcon(playlistEntity == null
? R.drawable.ic_playlist_add_white_24dp
: R.drawable.ic_playlist_add_check_white_24dp);

final int titleRes = playlistEntity == null
? R.string.bookmark_playlist : R.string.unbookmark_playlist;

playlistBookmarkButton.setIcon(ThemeHelper.resolveResourceIdFromAttr(activity, iconAttr));
playlistBookmarkButton.setTitle(titleRes);
playlistBookmarkButton.setTitle(playlistEntity == null
? R.string.bookmark_playlist
: R.string.unbookmark_playlist);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,8 @@ private void onMaybeMuteChanged() {
//2) Icon change accordingly to current App Theme
// using rootView.getContext() because getApplicationContext() didn't work
item.setIcon(player.isMuted()
? ThemeHelper.resolveResourceIdFromAttr(rootView.getContext(),
R.attr.ic_volume_off)
: ThemeHelper.resolveResourceIdFromAttr(rootView.getContext(),
R.attr.ic_volume_up));
? R.drawable.ic_volume_off_white_24dp
: R.drawable.ic_volume_up_white_24dp);
}
}
}
13 changes: 6 additions & 7 deletions app/src/main/java/org/schabi/newpipe/settings/tabs/Tab.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.KioskTranslator;
import org.schabi.newpipe.util.ServiceHelper;
import org.schabi.newpipe.util.ThemeHelper;

import java.util.Objects;

Expand Down Expand Up @@ -180,7 +179,7 @@ public String getTabName(final Context context) {
@DrawableRes
@Override
public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_blank_page);
return R.drawable.ic_crop_portrait_white_24dp;
}

@Override
Expand All @@ -205,7 +204,7 @@ public String getTabName(final Context context) {
@DrawableRes
@Override
public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_channel);
return R.drawable.ic_tv_white_24dp;
}

@Override
Expand All @@ -231,7 +230,7 @@ public String getTabName(final Context context) {
@DrawableRes
@Override
public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_rss);
return R.drawable.ic_rss_feed_white_24dp;
}

@Override
Expand All @@ -256,7 +255,7 @@ public String getTabName(final Context context) {
@DrawableRes
@Override
public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_bookmark);
return R.drawable.ic_bookmark_white_24dp;
}

@Override
Expand All @@ -281,7 +280,7 @@ public String getTabName(final Context context) {
@DrawableRes
@Override
public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_history);
return R.drawable.ic_history_white_24dp;
}

@Override
Expand Down Expand Up @@ -401,7 +400,7 @@ public String getTabName(final Context context) {
@DrawableRes
@Override
public int getTabIconRes(final Context context) {
return ThemeHelper.resolveResourceIdFromAttr(context, R.attr.ic_channel);
return R.drawable.ic_tv_white_24dp;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ public static int getKioskIcon(final String kioskId, final Context c) {
case "Top 50":
case "New & hot":
case "conferences":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_kiosk_hot);
return R.drawable.ic_whatshot_white_24dp;
case "Local":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_kiosk_local);
return R.drawable.ic_home_white_24dp;
case "Recently added":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_kiosk_recent);
return R.drawable.ic_add_circle_outline_white_24dp;
case "Most liked":
return ThemeHelper.resolveResourceIdFromAttr(c, R.attr.ic_thumb_up);
return R.drawable.ic_thumb_up_white_24dp;
default:
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ private void updateList() {

if (mSwitch != null) {
mSwitch.setIcon(mLinear
? ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_grid)
: ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_list));
? R.drawable.ic_apps_white_24dp
: R.drawable.ic_list_white_24dp);
mSwitch.setTitle(mLinear ? R.string.grid : R.string.list);
mPrefs.edit().putBoolean("linear", mLinear).apply();
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/color_cursor.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<size android:width="2dp" />
<solid android:color="@color/white" />
</shape>
7 changes: 5 additions & 2 deletions app/src/main/res/layout/activity_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/appbar_padding_top"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar">
android:theme="@style/ToolbarTheme"
app:popupTheme="@style/ToolbarTheme">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
app:titleTextColor="@color/white"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"/>

<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs"
app:tabIndicatorColor="@color/white"
app:tabTextColor="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/activity_player_queue_control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar">
android:theme="@style/ToolbarTheme"
app:popupTheme="@style/ToolbarTheme">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_weight="1"
app:titleTextColor="@color/white"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:title="@string/app_name"/>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/fragment_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
android:layout_alignParentTop="true"
android:background="?attr/colorPrimary"
app:tabMinWidth="60dp"
app:tabIndicatorColor="@color/white"
app:tabGravity="fill"/>

<androidx.viewpager.widget.ViewPager
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/res/layout/toolbar_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:gravity="center_vertical"
app:subtitleTextColor="@color/light_gray"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.ActionBar"
app:titleTextColor="@color/white"
android:theme="@style/ToolbarTheme"
app:popupTheme="@style/ToolbarTheme"
app:titleTextAppearance="@style/Toolbar.Title">

<Spinner
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/res/layout/toolbar_search_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
android:background="?attr/colorPrimary"
android:focusable="true"
android:focusableInTouchMode="true"
android:textColor="@color/white"
android:textColorHint="@color/light_gray"
android:nextFocusDown="@+id/suggestions_list"
android:hint="@string/search"
android:textCursorDrawable="@drawable/color_cursor"
android:imeOptions="actionSearch|flagNoFullscreen"
android:inputType="textFilter|textNoSuggestions"
android:maxLines="1"
Expand All @@ -44,7 +47,7 @@
android:layout_gravity="center"
android:contentDescription="@string/search"
android:scaleType="fitCenter"
app:srcCompat="?attr/ic_close"
app:srcCompat="@drawable/ic_close_white_24dp"
tools:ignore="RtlHardcoded"/>
</FrameLayout>

Expand Down
93 changes: 93 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,98 @@
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
</style>

<!-- DrawerArrowStyle is used to change the color of hamburger-icon to white -->
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="color">@android:color/white</item>
</style>

<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.ActionBar">
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
<item name="colorControlNormal">@color/white</item>

<item name="android:textColorHint">@color/light_gray</item>

<item name="ic_thumb_up">@drawable/ic_thumb_up_white_24dp</item>
<item name="ic_thumb_down">@drawable/ic_thumb_down_white_24dp</item>
<item name="ic_headset">@drawable/ic_headset_white_24dp</item>
<item name="ic_info_outline">@drawable/ic_info_outline_white_24dp</item>
<item name="ic_bug_report">@drawable/ic_bug_report_white_24dp</item>
<item name="ic_file_download">@drawable/ic_file_download_white_24dp</item>
<item name="ic_share">@drawable/ic_share_white_24dp</item>
<item name="ic_cast">@drawable/ic_cast_white_24dp</item>
<item name="ic_rss">@drawable/ic_rss_feed_white_24dp</item>
<item name="ic_search">@drawable/ic_search_white_24dp</item>
<item name="ic_close">@drawable/ic_close_white_24dp</item>
<item name="ic_filter_list">@drawable/ic_filter_list_white_24dp</item>
<item name="ic_popup">@drawable/ic_picture_in_picture_white_24dp</item>
<item name="ic_expand_more">@drawable/ic_expand_more_white_24dp</item>
<item name="ic_expand_less">@drawable/ic_expand_less_white_24dp</item>
<item name="ic_volume_off">@drawable/ic_volume_off_white_24dp</item>
<item name="ic_volume_up">@drawable/ic_volume_up_white_24dp</item>
<item name="ic_palette">@drawable/ic_palette_white_24dp</item>
<item name="ic_language">@drawable/ic_language_white_24dp</item>
<item name="ic_history">@drawable/ic_history_white_24dp</item>
<item name="ic_drag_handle">@drawable/ic_drag_handle_white_24dp</item>
<item name="ic_search_add">@drawable/ic_search_add_white_24dp</item>
<item name="ic_options">@drawable/ic_more_vert_white_24dp</item>
<item name="ic_play_arrow">@drawable/ic_play_arrow_white_24dp</item>
<item name="ic_settings">@drawable/ic_settings_white_24dp</item>
<item name="ic_kiosk_hot">@drawable/ic_whatshot_white_24dp</item>
<item name="ic_kiosk_local">@drawable/ic_home_white_24dp</item>
<item name="ic_kiosk_recent">@drawable/ic_add_circle_outline_white_24dp</item>
<item name="ic_bookmark">@drawable/ic_bookmark_white_24dp</item>
<item name="ic_playlist_add">@drawable/ic_playlist_add_white_24dp</item>
<item name="ic_playlist_check">@drawable/ic_playlist_add_check_white_24dp</item>
<item name="ic_import_export">@drawable/ic_import_export_white_24dp</item>
<item name="ic_save">@drawable/ic_save_white_24dp</item>
<item name="ic_backup">@drawable/ic_backup_white_24dp</item>
<item name="ic_add">@drawable/ic_add_white_24dp</item>
<item name="ic_restore_defaults">@drawable/ic_settings_backup_restore_white_24dp</item>
<item name="ic_blank_page">@drawable/ic_crop_portrait_white_24dp</item>
<item name="ic_list">@drawable/ic_list_white_24dp</item>
<item name="ic_grid">@drawable/ic_apps_white_24dp</item>
<item name="ic_delete">@drawable/ic_delete_white_24dp</item>
<item name="ic_pause">@drawable/ic_pause_white_24dp</item>
<item name="ic_settings_update">@drawable/ic_cloud_download_white_24dp</item>
<item name="ic_done">@drawable/ic_done_white_24dp</item>
<item name="ic_refresh">@drawable/ic_refresh_white_24dp</item>
<item name="ic_computer">@drawable/ic_computer_white_24dp</item>
<item name="ic_videogame_asset">@drawable/ic_videogame_asset_white_24dp</item>
<item name="ic_music_note">@drawable/ic_music_note_white_24dp</item>
<item name="ic_stars">@drawable/ic_stars_white_24dp</item>
<item name="ic_sports">@drawable/ic_directions_bike_white_24dp</item>
<item name="ic_money">@drawable/ic_attach_money_white_24dp</item>
<item name="ic_person">@drawable/ic_person_white_24dp</item>
<item name="ic_people">@drawable/ic_people_white_24dp</item>
<item name="ic_heart">@drawable/ic_favorite_white_24dp</item>
<item name="ic_child_care">@drawable/ic_child_care_white_24dp</item>
<item name="ic_fastfood">@drawable/ic_fastfood_white_24dp</item>
<item name="ic_car">@drawable/ic_directions_car_white_24dp</item>
<item name="ic_motorcycle">@drawable/ic_motorcycle_white_24dp</item>
<item name="ic_trending_up">@drawable/ic_trending_up_white_24dp</item>
<item name="ic_school">@drawable/ic_school_white_24dp</item>
<item name="ic_asterisk">@drawable/ic_asterisk_white_24dp</item>
<item name="ic_smile">@drawable/ic_insert_emoticon_white_24dp</item>
<item name="ic_edit">@drawable/ic_edit_white_24dp</item>
<item name="ic_explore">@drawable/ic_explore_white_24dp</item>
<item name="ic_fitness_center">@drawable/ic_fitness_center_white_24dp</item>
<item name="ic_restaurant">@drawable/ic_restaurant_white_24dp</item>
<item name="ic_mic">@drawable/ic_mic_white_24dp</item>
<item name="ic_radio">@drawable/ic_radio_white_24dp</item>
<item name="ic_shopping_cart">@drawable/ic_shopping_cart_white_24dp</item>
<item name="ic_watch_later">@drawable/ic_watch_later_white_24dp</item>
<item name="ic_work">@drawable/ic_work_white_24dp</item>
<item name="ic_movie">@drawable/ic_movie_white_24dp</item>
<item name="ic_pets">@drawable/ic_pets_white_24dp</item>
<item name="ic_world">@drawable/ic_public_white_24dp</item>
<item name="ic_sunny">@drawable/ic_wb_sunny_white_24dp</item>
<item name="ic_telescope">@drawable/ic_telescope_white_24dp</item>
<item name="ic_megaphone">@drawable/ic_megaphone_white_24dp</item>
<item name="ic_sort">@drawable/ic_sort_white_24dp</item>
<item name="ic_help">@drawable/ic_help_white_24dp</item>
<item name="ic_arrow_back">@drawable/ic_arrow_back_white_24dp</item>
</style>

<style name="Base.V7.DarkTheme" parent="Theme.AppCompat.NoActionBar" />
<style name="Base.DarkTheme" parent="Base.V7.DarkTheme" />
<style name="DarkTheme" parent="Base.DarkTheme">
Expand Down Expand Up @@ -285,6 +377,7 @@

<style name="Toolbar.Title" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
<item name="android:textSize">18sp</item>
<item name="android:textColor">@color/white</item>
</style>

<style name="OldVideoPlayerTheme" parent="Theme.AppCompat.Light.DarkActionBar">
Expand Down