diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java index 8c7cd676f..b62b1d1ab 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java @@ -80,6 +80,7 @@ public class ChannelFragment extends BaseListInfoFragment { private TextView headerTitleView; private TextView headerSubscribersTextView; private Button headerSubscribeButton; + private View playlistCtrl; private LinearLayout headerPlayAllButton; private LinearLayout headerPopupButton; @@ -140,10 +141,12 @@ public class ChannelFragment extends BaseListInfoFragment { headerTitleView = headerRootLayout.findViewById(R.id.channel_title_view); headerSubscribersTextView = headerRootLayout.findViewById(R.id.channel_subscriber_view); headerSubscribeButton = headerRootLayout.findViewById(R.id.channel_subscribe_button); + playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control); - headerPlayAllButton = headerRootLayout.findViewById(R.id.channel_play_all_button); - headerPopupButton = headerRootLayout.findViewById(R.id.channel_play_popup_button); - headerBackgroundButton = headerRootLayout.findViewById(R.id.channel_play_bg_button); + + headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button); + headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button); + headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button); return headerRootLayout; } @@ -197,6 +200,8 @@ public class ChannelFragment extends BaseListInfoFragment { ActionBar supportActionBar = activity.getSupportActionBar(); if(useAsFrontPage) { supportActionBar.setDisplayHomeAsUpEnabled(false); + menuRssButton.setVisible(false); + } else { inflater.inflate(R.menu.menu_channel, menu); @@ -441,6 +446,7 @@ public class ChannelFragment extends BaseListInfoFragment { } else headerSubscribersTextView.setVisibility(View.GONE); if (menuRssButton != null) menuRssButton.setVisible(!TextUtils.isEmpty(result.feed_url)); + playlistCtrl.setVisibility(View.VISIBLE); if (!result.errors.isEmpty()) { showSnackBarError(result.errors, UserAction.REQUESTED_CHANNEL, NewPipe.getNameOfService(result.service_id), result.url, 0); diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java index 4e6fb14ec..878dbf385 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java @@ -51,10 +51,11 @@ public class PlaylistFragment extends BaseListInfoFragment { private TextView headerUploaderName; private ImageView headerUploaderAvatar; private TextView headerStreamCount; + private View playlistCtrl; - private LinearLayout headerPlayAllButton; - private LinearLayout headerPopupButton; - private LinearLayout headerBackgroundButton; + private View headerPlayAllButton; + private View headerPopupButton; + private View headerBackgroundButton; public static PlaylistFragment getInstance(int serviceId, String url, String name) { PlaylistFragment instance = new PlaylistFragment(); @@ -82,10 +83,11 @@ public class PlaylistFragment extends BaseListInfoFragment { headerUploaderName = headerRootLayout.findViewById(R.id.uploader_name); headerUploaderAvatar = headerRootLayout.findViewById(R.id.uploader_avatar_view); headerStreamCount = headerRootLayout.findViewById(R.id.playlist_stream_count); + playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control); - headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_play_all_button); - headerPopupButton = headerRootLayout.findViewById(R.id.playlist_play_popup_button); - headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_play_bg_button); + headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button); + headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button); + headerBackgroundButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_bg_button); return headerRootLayout; } @@ -190,6 +192,8 @@ public class PlaylistFragment extends BaseListInfoFragment { } } + playlistCtrl.setVisibility(View.VISIBLE); + imageLoader.displayImage(result.uploader_avatar_url, headerUploaderAvatar, DISPLAY_AVATAR_OPTIONS); headerStreamCount.setText(getResources().getQuantityString(R.plurals.videos, (int) result.stream_count, (int) result.stream_count)); diff --git a/app/src/main/res/layout/channel_header.xml b/app/src/main/res/layout/channel_header.xml index 9fc61ca1c..ca795d9db 100644 --- a/app/src/main/res/layout/channel_header.xml +++ b/app/src/main/res/layout/channel_header.xml @@ -86,86 +86,10 @@ + android:layout_height="wrap_content" + android:layout_below="@id/channel_metadata"> - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/app/src/main/res/layout/playlist_control.xml b/app/src/main/res/layout/playlist_control.xml new file mode 100644 index 000000000..821158bba --- /dev/null +++ b/app/src/main/res/layout/playlist_control.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/playlist_header.xml b/app/src/main/res/layout/playlist_header.xml index 1cbadb55e..f49ca295d 100644 --- a/app/src/main/res/layout/playlist_header.xml +++ b/app/src/main/res/layout/playlist_header.xml @@ -84,86 +84,10 @@ + android:layout_height="wrap_content" + android:layout_below="@id/playlist_meta"> - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 829c412e5..aa39322e0 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -59,6 +59,8 @@ 60dp + 50dp + 10dp 14sp 16sp