1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-24 00:50:32 +00:00

Don't show sub-channel thumbnail by default

This commit is contained in:
wb9688 2020-05-07 20:51:54 +02:00
parent b7d4a4f604
commit 235394d96c
5 changed files with 1029 additions and 1026 deletions

View File

@ -1160,7 +1160,6 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
} else if (!TextUtils.isEmpty(info.getUploaderName())) {
displayUploaderAsSubChannel(info);
} else {
subChannelThumb.setVisibility(View.GONE);
uploaderTextView.setVisibility(View.GONE);
uploaderThumb.setVisibility(View.GONE);
}
@ -1296,11 +1295,11 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
viewPager.setVisibility(View.GONE);
tabLayout.setVisibility(View.GONE);
}
private void displayUploaderAsSubChannel(final StreamInfo info) {
subChannelTextView.setText(info.getUploaderName());
subChannelTextView.setVisibility(View.VISIBLE);
subChannelTextView.setSelected(true);
subChannelThumb.setVisibility(View.GONE);
uploaderTextView.setVisibility(View.GONE);
}
@ -1309,6 +1308,8 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
subChannelTextView.setVisibility(View.VISIBLE);
subChannelTextView.setSelected(true);
subChannelThumb.setVisibility(View.VISIBLE);
if (!TextUtils.isEmpty(info.getUploaderName())) {
uploaderTextView.setText(
String.format(getString(R.string.video_detail_by), info.getUploaderName()));

View File

@ -480,9 +480,9 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo>
currentInfo.getSubChannelName())
);
headerSubChannelTitleView.setVisibility(View.VISIBLE);
headerSubChannelAvatarView.setVisibility(View.VISIBLE);
} else {
headerSubChannelTitleView.setVisibility(View.GONE);
headerSubChannelAvatarView.setVisibility(View.GONE);
}
if (menuRssButton != null) {

View File

@ -5,26 +5,26 @@
android:id="@+id/video_item_detail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:focusableInTouchMode="true"
tools:ignore="RtlHardcoded"
android:orientation="horizontal"
android:baselineAligned="false">
tools:ignore="RtlHardcoded">
<org.schabi.newpipe.views.FocusAwareCoordinator
android:id="@+id/detail_main_content"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="5"
android:isScrollContainer="true"
android:fitsSystemWindows="true">
android:fitsSystemWindows="true"
android:isScrollContainer="true">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbarlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:touchscreenBlocksFocus="false"
android:fitsSystemWindows="true"
android:touchscreenBlocksFocus="false"
app:elevation="0dp"
app:layout_behavior="com.google.android.material.appbar.FlingBehavior">
@ -246,30 +246,31 @@
android:layout_toStartOf="@id/details_panel"
android:layout_toLeftOf="@id/details_panel"
android:background="?attr/selectableItemBackground"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:focusable="true"
android:padding="6dp">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
android:layout_height="wrap_content">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/detail_uploader_thumbnail_view"
android:layout_width="@dimen/playlist_detail_uploader_image_size"
android:layout_height="@dimen/playlist_detail_uploader_image_size"
android:layout_gravity="bottom|right"
android:layout_width="@dimen/video_item_detail_uploader_image_size"
android:layout_height="@dimen/video_item_detail_uploader_image_size"
android:contentDescription="@string/detail_uploader_thumbnail_view_description"
android:src="@drawable/buddy" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/detail_sub_channel_thumbnail_view"
android:layout_width="@dimen/video_item_detail_uploader_image_size"
android:layout_height="@dimen/video_item_detail_uploader_image_size"
android:layout_width="@dimen/video_item_detail_sub_channel_image_size"
android:layout_height="@dimen/video_item_detail_sub_channel_image_size"
android:layout_gravity="bottom|right"
android:contentDescription="@string/detail_uploader_thumbnail_view_description"
android:src="@drawable/buddy" />
android:contentDescription="@string/detail_sub_channel_thumbnail_view_description"
android:src="@drawable/buddy"
android:visibility="gone"
tools:visibility="visible" />
</FrameLayout>
@ -418,9 +419,9 @@
android:id="@+id/detail_control_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:focusable="true"
android:descendantFocusability="afterDescendants"
android:focusable="true"
android:orientation="horizontal"
android:padding="6dp">
<!-- CONTROLS -->
@ -507,10 +508,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:descendantFocusability="afterDescendants"
android:focusable="true"
android:orientation="vertical"
android:visibility="gone"
android:focusable="true"
android:descendantFocusability="afterDescendants"
tools:visibility="visible">
<TextView
@ -526,17 +527,17 @@
<TextView
android:id="@+id/detail_description_view"
android:nextFocusUp="@+id/detail_control_panel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="3dp"
android:layout_marginRight="12dp"
android:layout_marginBottom="8dp"
android:focusable="false"
android:nextFocusUp="@+id/detail_control_panel"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textIsSelectable="true"
android:textSize="@dimen/video_item_detail_description_text_size"
android:focusable="false"
tools:text="Description Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a ultricies ex. Integer sit amet sodales risus. Duis non mi et urna pretium bibendum." />
<View

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/channel_header_layout"
@ -36,8 +35,7 @@
android:layout_height="@dimen/channel_avatar_size"
android:src="@drawable/buddy"
app:civ_border_color="#ffffff"
app:civ_border_width="2dp"
tools:ignore="RtlHardcoded" />
app:civ_border_width="2dp" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/sub_channel_avatar_view"
@ -45,9 +43,11 @@
android:layout_height="35dp"
android:layout_gravity="bottom|right"
android:src="@drawable/buddy"
android:visibility="gone"
app:civ_border_color="#ffffff"
app:civ_border_width="2dp"
tools:ignore="RtlHardcoded" />
tools:ignore="RtlHardcoded"
tools:visibility="visible" />
</FrameLayout>
<TextView
@ -102,8 +102,8 @@
android:id="@+id/channel_subscribe_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/channel_banner_image"
android:layout_alignParentRight="true"
android:layout_gravity="center_vertical|right"
android:layout_marginRight="2dp"
android:text="@string/subscribe_button_title"

View File

@ -254,8 +254,7 @@
android:layout_width="@dimen/video_item_detail_uploader_image_size"
android:layout_height="@dimen/video_item_detail_uploader_image_size"
android:contentDescription="@string/detail_uploader_thumbnail_view_description"
android:src="@drawable/buddy"
tools:ignore="RtlHardcoded" />
android:src="@drawable/buddy" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/detail_sub_channel_thumbnail_view"
@ -264,7 +263,9 @@
android:layout_gravity="bottom|right"
android:contentDescription="@string/detail_sub_channel_thumbnail_view_description"
android:src="@drawable/buddy"
tools:ignore="RtlHardcoded" />
android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:visibility="visible" />
</FrameLayout>