Merge pull request #3430 from Royosef/DisplayParentChannelDetails

Display parent channel details
This commit is contained in:
Tobias Groza 2020-05-08 23:29:28 +02:00 committed by GitHub
commit 9cf76a918e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 1248 additions and 1011 deletions

View file

@ -66,6 +66,7 @@ android {
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
encoding 'utf-8'
} }
// Required and used only by groupie // Required and used only by groupie
@ -157,7 +158,7 @@ dependencies {
exclude module: 'support-annotations' exclude module: 'support-annotations'
}) })
implementation 'com.github.TeamNewPipe:NewPipeExtractor:665c69b5306d335985d5c0692f5119b5172c1b7a' implementation 'com.github.TeamNewPipe:NewPipeExtractor:f3913e241e379adf0091319091e8f895c5fcfd07'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0' testImplementation 'org.mockito:mockito-core:2.23.0'

View file

@ -175,6 +175,8 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
private View uploaderRootLayout; private View uploaderRootLayout;
private TextView uploaderTextView; private TextView uploaderTextView;
private ImageView uploaderThumb; private ImageView uploaderThumb;
private TextView subChannelTextView;
private ImageView subChannelThumb;
private TextView thumbsUpTextView; private TextView thumbsUpTextView;
private ImageView thumbsUpImageView; private ImageView thumbsUpImageView;
@ -419,18 +421,17 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
} }
break; break;
case R.id.detail_uploader_root_layout: case R.id.detail_uploader_root_layout:
if (TextUtils.isEmpty(currentInfo.getUploaderUrl())) { if (TextUtils.isEmpty(currentInfo.getSubChannelUrl())) {
Log.w(TAG, "Can't open channel because we got no channel URL"); if (!TextUtils.isEmpty(currentInfo.getUploaderUrl())) {
} else { openChannel(currentInfo.getUploaderUrl(), currentInfo.getUploaderName());
try {
NavigationHelper.openChannelFragment(
getFragmentManager(),
currentInfo.getServiceId(),
currentInfo.getUploaderUrl(),
currentInfo.getUploaderName());
} catch (Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
} }
if (DEBUG) {
Log.i(TAG, "Can't open sub-channel because we got no channel URL");
}
} else {
openChannel(currentInfo.getSubChannelUrl(),
currentInfo.getSubChannelName());
} }
break; break;
case R.id.detail_thumbnail_root_layout: case R.id.detail_thumbnail_root_layout:
@ -447,6 +448,18 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
} }
} }
private void openChannel(final String subChannelUrl, final String subChannelName) {
try {
NavigationHelper.openChannelFragment(
getFragmentManager(),
currentInfo.getServiceId(),
subChannelUrl,
subChannelName);
} catch (Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
}
}
@Override @Override
public boolean onLongClick(final View v) { public boolean onLongClick(final View v) {
if (isLoading.get() || currentInfo == null) { if (isLoading.get() || currentInfo == null) {
@ -463,6 +476,15 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
case R.id.detail_controls_download: case R.id.detail_controls_download:
NavigationHelper.openDownloads(getActivity()); NavigationHelper.openDownloads(getActivity());
break; break;
case R.id.detail_uploader_root_layout:
if (TextUtils.isEmpty(currentInfo.getSubChannelUrl())) {
Log.w(TAG,
"Can't open parent channel because we got no parent channel URL");
} else {
openChannel(currentInfo.getUploaderUrl(), currentInfo.getUploaderName());
}
break;
} }
return true; return true;
@ -525,6 +547,8 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
uploaderRootLayout = rootView.findViewById(R.id.detail_uploader_root_layout); uploaderRootLayout = rootView.findViewById(R.id.detail_uploader_root_layout);
uploaderTextView = rootView.findViewById(R.id.detail_uploader_text_view); uploaderTextView = rootView.findViewById(R.id.detail_uploader_text_view);
uploaderThumb = rootView.findViewById(R.id.detail_uploader_thumbnail_view); uploaderThumb = rootView.findViewById(R.id.detail_uploader_thumbnail_view);
subChannelTextView = rootView.findViewById(R.id.detail_sub_channel_text_view);
subChannelThumb = rootView.findViewById(R.id.detail_sub_channel_thumbnail_view);
appBarLayout = rootView.findViewById(R.id.appbarlayout); appBarLayout = rootView.findViewById(R.id.appbarlayout);
viewPager = rootView.findViewById(R.id.viewpager); viewPager = rootView.findViewById(R.id.viewpager);
@ -554,8 +578,9 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
protected void initListeners() { protected void initListeners() {
super.initListeners(); super.initListeners();
videoTitleRoot.setOnClickListener(this);
uploaderRootLayout.setOnClickListener(this); uploaderRootLayout.setOnClickListener(this);
uploaderRootLayout.setOnLongClickListener(this);
videoTitleRoot.setOnClickListener(this);
thumbnailBackgroundButton.setOnClickListener(this); thumbnailBackgroundButton.setOnClickListener(this);
detailControlsBackground.setOnClickListener(this); detailControlsBackground.setOnClickListener(this);
detailControlsPopup.setOnClickListener(this); detailControlsPopup.setOnClickListener(this);
@ -603,6 +628,11 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS, onFailListener); ImageDisplayConstants.DISPLAY_THUMBNAIL_OPTIONS, onFailListener);
} }
if (!TextUtils.isEmpty(info.getSubChannelAvatarUrl())) {
IMAGE_LOADER.displayImage(info.getSubChannelAvatarUrl(), subChannelThumb,
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
}
if (!TextUtils.isEmpty(info.getUploaderAvatarUrl())) { if (!TextUtils.isEmpty(info.getUploaderAvatarUrl())) {
IMAGE_LOADER.displayImage(info.getUploaderAvatarUrl(), uploaderThumb, IMAGE_LOADER.displayImage(info.getUploaderAvatarUrl(), uploaderThumb,
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS); ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
@ -964,7 +994,7 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
@NonNull final StreamInfo info, @NonNull final StreamInfo info,
@NonNull final Stream selectedStream) { @NonNull final Stream selectedStream) {
NavigationHelper.playOnExternalPlayer(context, currentInfo.getName(), NavigationHelper.playOnExternalPlayer(context, currentInfo.getName(),
currentInfo.getUploaderName(), selectedStream); currentInfo.getSubChannelName(), selectedStream);
final HistoryRecordManager recordManager = new HistoryRecordManager(requireContext()); final HistoryRecordManager recordManager = new HistoryRecordManager(requireContext());
disposables.add(recordManager.onViewed(info).onErrorComplete() disposables.add(recordManager.onViewed(info).onErrorComplete()
@ -1097,9 +1127,9 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
} }
IMAGE_LOADER.cancelDisplayTask(thumbnailImageView); IMAGE_LOADER.cancelDisplayTask(thumbnailImageView);
IMAGE_LOADER.cancelDisplayTask(uploaderThumb); IMAGE_LOADER.cancelDisplayTask(subChannelThumb);
thumbnailImageView.setImageBitmap(null); thumbnailImageView.setImageBitmap(null);
uploaderThumb.setImageBitmap(null); subChannelThumb.setImageBitmap(null);
} }
@Override @Override
@ -1127,13 +1157,16 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
animateView(thumbnailPlayButton, true, 200); animateView(thumbnailPlayButton, true, 200);
videoTitleTextView.setText(name); videoTitleTextView.setText(name);
if (!TextUtils.isEmpty(info.getUploaderName())) { if (!TextUtils.isEmpty(info.getSubChannelName())) {
uploaderTextView.setText(info.getUploaderName()); displayBothUploaderAndSubChannel(info);
uploaderTextView.setVisibility(View.VISIBLE); } else if (!TextUtils.isEmpty(info.getUploaderName())) {
uploaderTextView.setSelected(true); displayUploaderAsSubChannel(info);
} else { } else {
uploaderTextView.setVisibility(View.GONE); uploaderTextView.setVisibility(View.GONE);
uploaderThumb.setVisibility(View.GONE);
} }
subChannelThumb.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.buddy));
uploaderThumb.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.buddy)); uploaderThumb.setImageDrawable(ContextCompat.getDrawable(activity, R.drawable.buddy));
if (info.getViewCount() >= 0) { if (info.getViewCount() >= 0) {
@ -1265,6 +1298,31 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
tabLayout.setVisibility(View.GONE); tabLayout.setVisibility(View.GONE);
} }
private void displayUploaderAsSubChannel(final StreamInfo info) {
subChannelTextView.setText(info.getUploaderName());
subChannelTextView.setVisibility(View.VISIBLE);
subChannelTextView.setSelected(true);
uploaderTextView.setVisibility(View.GONE);
}
private void displayBothUploaderAndSubChannel(final StreamInfo info) {
subChannelTextView.setText(info.getSubChannelName());
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()));
uploaderTextView.setVisibility(View.VISIBLE);
uploaderTextView.setSelected(true);
} else {
uploaderTextView.setVisibility(View.GONE);
}
}
public void openDownloadDialog() { public void openDownloadDialog() {
try { try {
DownloadDialog downloadDialog = DownloadDialog.newInstance(currentInfo); DownloadDialog downloadDialog = DownloadDialog.newInstance(currentInfo);

View file

@ -21,6 +21,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import com.jakewharton.rxbinding2.view.RxView; import com.jakewharton.rxbinding2.view.RxView;
@ -38,6 +39,7 @@ import org.schabi.newpipe.fragments.list.BaseListInfoFragment;
import org.schabi.newpipe.local.subscription.SubscriptionManager; import org.schabi.newpipe.local.subscription.SubscriptionManager;
import org.schabi.newpipe.player.playqueue.ChannelPlayQueue; import org.schabi.newpipe.player.playqueue.ChannelPlayQueue;
import org.schabi.newpipe.player.playqueue.PlayQueue; import org.schabi.newpipe.player.playqueue.PlayQueue;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction; import org.schabi.newpipe.report.UserAction;
import org.schabi.newpipe.util.AnimationUtils; import org.schabi.newpipe.util.AnimationUtils;
import org.schabi.newpipe.util.ExtractorHelper; import org.schabi.newpipe.util.ExtractorHelper;
@ -65,7 +67,8 @@ import static org.schabi.newpipe.util.AnimationUtils.animateBackgroundColor;
import static org.schabi.newpipe.util.AnimationUtils.animateTextColor; import static org.schabi.newpipe.util.AnimationUtils.animateTextColor;
import static org.schabi.newpipe.util.AnimationUtils.animateView; import static org.schabi.newpipe.util.AnimationUtils.animateView;
public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> { public class ChannelFragment extends BaseListInfoFragment<ChannelInfo>
implements View.OnClickListener {
private static final int BUTTON_DEBOUNCE_INTERVAL = 100; private static final int BUTTON_DEBOUNCE_INTERVAL = 100;
private final CompositeDisposable disposables = new CompositeDisposable(); private final CompositeDisposable disposables = new CompositeDisposable();
private Disposable subscribeButtonMonitor; private Disposable subscribeButtonMonitor;
@ -79,6 +82,8 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
private ImageView headerChannelBanner; private ImageView headerChannelBanner;
private ImageView headerAvatarView; private ImageView headerAvatarView;
private TextView headerTitleView; private TextView headerTitleView;
private ImageView headerSubChannelAvatarView;
private TextView headerSubChannelTitleView;
private TextView headerSubscribersTextView; private TextView headerSubscribersTextView;
private Button headerSubscribeButton; private Button headerSubscribeButton;
private View playlistCtrl; private View playlistCtrl;
@ -156,7 +161,10 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
headerSubscribersTextView = headerRootLayout.findViewById(R.id.channel_subscriber_view); headerSubscribersTextView = headerRootLayout.findViewById(R.id.channel_subscriber_view);
headerSubscribeButton = headerRootLayout.findViewById(R.id.channel_subscribe_button); headerSubscribeButton = headerRootLayout.findViewById(R.id.channel_subscribe_button);
playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control); playlistCtrl = headerRootLayout.findViewById(R.id.playlist_control);
headerSubChannelAvatarView =
headerRootLayout.findViewById(R.id.sub_channel_avatar_view);
headerSubChannelTitleView =
headerRootLayout.findViewById(R.id.sub_channel_title_view);
headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button); headerPlayAllButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_all_button);
headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button); headerPopupButton = headerRootLayout.findViewById(R.id.playlist_ctrl_play_popup_button);
@ -165,6 +173,14 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
return headerRootLayout; return headerRootLayout;
} }
@Override
protected void initListeners() {
super.initListeners();
headerSubChannelTitleView.setOnClickListener(this);
headerSubChannelAvatarView.setOnClickListener(this);
}
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////
// Menu // Menu
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
@ -394,6 +410,34 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
return ExtractorHelper.getChannelInfo(serviceId, url, forceLoad); return ExtractorHelper.getChannelInfo(serviceId, url, forceLoad);
} }
/*//////////////////////////////////////////////////////////////////////////
// OnClick
//////////////////////////////////////////////////////////////////////////*/
@Override
public void onClick(final View v) {
if (isLoading.get() || currentInfo == null) {
return;
}
switch (v.getId()) {
case R.id.sub_channel_avatar_view:
case R.id.sub_channel_title_view:
if (!TextUtils.isEmpty(currentInfo.getParentChannelUrl())) {
try {
NavigationHelper.openChannelFragment(getFragmentManager(),
currentInfo.getServiceId(), currentInfo.getParentChannelUrl(),
currentInfo.getParentChannelName());
} catch (Exception e) {
ErrorActivity.reportUiError((AppCompatActivity) getActivity(), e);
}
} else if (DEBUG) {
Log.i(TAG, "Can't open parent channel because we got no channel URL");
}
break;
}
}
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////
// Contract // Contract
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
@ -404,6 +448,7 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
IMAGE_LOADER.cancelDisplayTask(headerChannelBanner); IMAGE_LOADER.cancelDisplayTask(headerChannelBanner);
IMAGE_LOADER.cancelDisplayTask(headerAvatarView); IMAGE_LOADER.cancelDisplayTask(headerAvatarView);
IMAGE_LOADER.cancelDisplayTask(headerSubChannelAvatarView);
animateView(headerSubscribeButton, false, 100); animateView(headerSubscribeButton, false, 100);
} }
@ -416,6 +461,8 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
ImageDisplayConstants.DISPLAY_BANNER_OPTIONS); ImageDisplayConstants.DISPLAY_BANNER_OPTIONS);
IMAGE_LOADER.displayImage(result.getAvatarUrl(), headerAvatarView, IMAGE_LOADER.displayImage(result.getAvatarUrl(), headerAvatarView,
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS); ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
IMAGE_LOADER.displayImage(result.getParentChannelAvatarUrl(), headerSubChannelAvatarView,
ImageDisplayConstants.DISPLAY_AVATAR_OPTIONS);
headerSubscribersTextView.setVisibility(View.VISIBLE); headerSubscribersTextView.setVisibility(View.VISIBLE);
if (result.getSubscriberCount() >= 0) { if (result.getSubscriberCount() >= 0) {
@ -425,6 +472,17 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
headerSubscribersTextView.setText(R.string.subscribers_count_not_available); headerSubscribersTextView.setText(R.string.subscribers_count_not_available);
} }
if (!TextUtils.isEmpty(currentInfo.getParentChannelName())) {
headerSubChannelTitleView.setText(String.format(
getString(R.string.channel_created_by),
currentInfo.getParentChannelName())
);
headerSubChannelTitleView.setVisibility(View.VISIBLE);
headerSubChannelAvatarView.setVisibility(View.VISIBLE);
} else {
headerSubChannelTitleView.setVisibility(View.GONE);
}
if (menuRssButton != null) { if (menuRssButton != null) {
menuRssButton.setVisible(!TextUtils.isEmpty(result.getFeedUrl())); menuRssButton.setVisible(!TextUtils.isEmpty(result.getFeedUrl()));
} }

View file

@ -711,7 +711,8 @@ public class Mp4FromDashWriter {
for (int i = 0; i < tracks.length; i++) { for (int i = 0; i < tracks.length; i++) {
if (tracks[i].trak.tkhd.matrix.length != 36) { if (tracks[i].trak.tkhd.matrix.length != 36) {
throw new RuntimeException("bad track matrix length (expected 36) in track n°" + i); throw
new RuntimeException("bad track matrix length (expected 36) in track n°" + i);
} }
makeTrak(i, durations[i], defaultMediaTime[i], tablesInfo[i], is64); makeTrak(i, durations[i], defaultMediaTime[i], tablesInfo[i], is64);
} }

View file

@ -5,26 +5,26 @@
android:id="@+id/video_item_detail" android:id="@+id/video_item_detail"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:baselineAligned="false"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
tools:ignore="RtlHardcoded"
android:orientation="horizontal" android:orientation="horizontal"
android:baselineAligned="false"> tools:ignore="RtlHardcoded">
<org.schabi.newpipe.views.FocusAwareCoordinator <org.schabi.newpipe.views.FocusAwareCoordinator
android:id="@+id/detail_main_content" android:id="@+id/detail_main_content"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="5" android:layout_weight="5"
android:isScrollContainer="true" android:fitsSystemWindows="true"
android:fitsSystemWindows="true"> android:isScrollContainer="true">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbarlayout" android:id="@+id/appbarlayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/transparent" android:background="@android:color/transparent"
android:touchscreenBlocksFocus="false"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:touchscreenBlocksFocus="false"
app:elevation="0dp" app:elevation="0dp"
app:layout_behavior="com.google.android.material.appbar.FlingBehavior"> app:layout_behavior="com.google.android.material.appbar.FlingBehavior">
@ -246,11 +246,15 @@
android:layout_toStartOf="@id/details_panel" android:layout_toStartOf="@id/details_panel"
android:layout_toLeftOf="@id/details_panel" android:layout_toLeftOf="@id/details_panel"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:focusable="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:focusable="true"
android:padding="6dp"> android:padding="6dp">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<de.hdodenhof.circleimageview.CircleImageView <de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/detail_uploader_thumbnail_view" android:id="@+id/detail_uploader_thumbnail_view"
android:layout_width="@dimen/video_item_detail_uploader_image_size" android:layout_width="@dimen/video_item_detail_uploader_image_size"
@ -258,6 +262,40 @@
android:contentDescription="@string/detail_uploader_thumbnail_view_description" android:contentDescription="@string/detail_uploader_thumbnail_view_description"
android:src="@drawable/buddy" /> android:src="@drawable/buddy" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/detail_sub_channel_thumbnail_view"
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_sub_channel_thumbnail_view_description"
android:src="@drawable/buddy"
android:visibility="gone"
tools:visibility="visible" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/detail_sub_channel_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="@dimen/video_item_detail_sub_channel_text_size"
android:textStyle="bold"
tools:ignore="RtlHardcoded"
tools:text="Channel" />
<TextView <TextView
android:id="@+id/detail_uploader_text_view" android:id="@+id/detail_uploader_text_view"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -273,6 +311,7 @@
android:textStyle="bold" android:textStyle="bold"
tools:ignore="RtlHardcoded" tools:ignore="RtlHardcoded"
tools:text="Uploader" /> tools:text="Uploader" />
</LinearLayout>
<!--<Button <!--<Button
android:id="@+id/detail_uploader_subscribe" android:id="@+id/detail_uploader_subscribe"
@ -380,9 +419,9 @@
android:id="@+id/detail_control_panel" android:id="@+id/detail_control_panel"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"
android:focusable="true"
android:descendantFocusability="afterDescendants" android:descendantFocusability="afterDescendants"
android:focusable="true"
android:orientation="horizontal"
android:padding="6dp"> android:padding="6dp">
<!-- CONTROLS --> <!-- CONTROLS -->
@ -469,10 +508,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:descendantFocusability="afterDescendants"
android:focusable="true"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone" android:visibility="gone"
android:focusable="true"
android:descendantFocusability="afterDescendants"
tools:visibility="visible"> tools:visibility="visible">
<TextView <TextView
@ -488,17 +527,17 @@
<TextView <TextView
android:id="@+id/detail_description_view" android:id="@+id/detail_description_view"
android:nextFocusUp="@+id/detail_control_panel"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:layout_marginRight="12dp" android:layout_marginRight="12dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:focusable="false"
android:nextFocusUp="@+id/detail_control_panel"
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:textIsSelectable="true" android:textIsSelectable="true"
android:textSize="@dimen/video_item_detail_description_text_size" 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." /> 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

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/channel_header_layout" android:id="@+id/channel_header_layout"
@ -23,17 +22,33 @@
android:src="@drawable/channel_banner" android:src="@drawable/channel_banner"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<FrameLayout
android:id="@+id/avatars_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginTop="50dp">
<de.hdodenhof.circleimageview.CircleImageView <de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/channel_avatar_view" android:id="@+id/channel_avatar_view"
android:layout_width="@dimen/channel_avatar_size" android:layout_width="@dimen/channel_avatar_size"
android:layout_height="@dimen/channel_avatar_size" android:layout_height="@dimen/channel_avatar_size"
android:layout_alignTop="@id/channel_banner_image"
android:layout_marginLeft="8dp"
android:layout_marginTop="50dp"
android:src="@drawable/buddy" android:src="@drawable/buddy"
app:civ_border_color="#ffffff" app:civ_border_color="#ffffff"
app:civ_border_width="2dp" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/sub_channel_avatar_view"
android:layout_width="@dimen/sub_channel_avatar_size"
android:layout_height="@dimen/sub_channel_avatar_size"
android:layout_gravity="bottom|right"
android:src="@drawable/buddy"
android:visibility="gone"
app:civ_border_color="#ffffff"
app:civ_border_width="2dp" app:civ_border_width="2dp"
tools:ignore="RtlHardcoded"/> tools:ignore="RtlHardcoded"
tools:visibility="visible" />
</FrameLayout>
<TextView <TextView
android:id="@+id/channel_title_view" android:id="@+id/channel_title_view"
@ -41,10 +56,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/channel_banner_image" android:layout_below="@id/channel_banner_image"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:layout_toLeftOf="@+id/channel_subscribe_button" android:layout_marginRight="8dp"
android:layout_toRightOf="@+id/channel_avatar_view" android:layout_toLeftOf="@id/channel_subscribe_button"
android:layout_toRightOf="@id/avatars_layout"
android:ellipsize="end" android:ellipsize="end"
android:lines="1" android:lines="1"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
@ -52,15 +67,30 @@
tools:ignore="RtlHardcoded" tools:ignore="RtlHardcoded"
tools:text="Lorem ipsum dolor" /> tools:text="Lorem ipsum dolor" />
<TextView
android:id="@+id/sub_channel_title_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/channel_title_view"
android:layout_alignLeft="@id/channel_title_view"
android:layout_alignRight="@id/channel_title_view"
android:ellipsize="end"
android:gravity="center|left"
android:lines="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="12dp"
tools:ignore="RtlHardcoded"
tools:layout_below="@id/channel_title_view"
tools:text="Lorem ipsum dolor" />
<TextView <TextView
android:id="@+id/channel_subscriber_view" android:id="@+id/channel_subscriber_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignLeft="@+id/channel_title_view" android:layout_below="@id/sub_channel_title_view"
android:layout_alignRight="@+id/channel_title_view" android:layout_alignLeft="@id/channel_title_view"
android:layout_below="@+id/channel_title_view" android:layout_alignRight="@id/channel_title_view"
android:ellipsize="end" android:ellipsize="end"
android:gravity="left|center"
android:maxLines="2" android:maxLines="2"
android:textSize="@dimen/channel_subscribers_text_size" android:textSize="@dimen/channel_subscribers_text_size"
android:visibility="gone" android:visibility="gone"
@ -72,8 +102,8 @@
android:id="@+id/channel_subscribe_button" android:id="@+id/channel_subscribe_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/channel_banner_image" android:layout_below="@+id/channel_banner_image"
android:layout_alignParentRight="true"
android:layout_gravity="center_vertical|right" android:layout_gravity="center_vertical|right"
android:layout_marginRight="2dp" android:layout_marginRight="2dp"
android:text="@string/subscribe_button_title" android:text="@string/subscribe_button_title"

View file

@ -245,19 +245,56 @@
android:orientation="horizontal" android:orientation="horizontal"
android:padding="6dp"> android:padding="6dp">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<de.hdodenhof.circleimageview.CircleImageView <de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/detail_uploader_thumbnail_view" android:id="@+id/detail_uploader_thumbnail_view"
android:layout_width="@dimen/video_item_detail_uploader_image_size" android:layout_width="@dimen/video_item_detail_uploader_image_size"
android:layout_height="@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: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_sub_channel_image_size"
android:layout_height="@dimen/video_item_detail_sub_channel_image_size"
android:layout_gravity="bottom|right"
android:contentDescription="@string/detail_sub_channel_thumbnail_view_description"
android:src="@drawable/buddy" android:src="@drawable/buddy"
tools:ignore="RtlHardcoded" /> android:visibility="gone"
tools:ignore="RtlHardcoded"
tools:visibility="visible" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/detail_sub_channel_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="@dimen/video_item_detail_sub_channel_text_size"
android:textStyle="normal|bold"
tools:ignore="RtlHardcoded"
tools:text="Channel" />
<TextView <TextView
android:id="@+id/detail_uploader_text_view" android:id="@+id/detail_uploader_text_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:ellipsize="marquee" android:ellipsize="marquee"
android:fadingEdge="horizontal" android:fadingEdge="horizontal"
android:marqueeRepeatLimit="marquee_forever" android:marqueeRepeatLimit="marquee_forever"
@ -269,6 +306,8 @@
tools:ignore="RtlHardcoded" tools:ignore="RtlHardcoded"
tools:text="Uploader" /> tools:text="Uploader" />
</LinearLayout>
<!--<Button <!--<Button
android:id="@+id/detail_uploader_subscribe" android:id="@+id/detail_uploader_subscribe"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View file

@ -25,7 +25,8 @@
<dimen name="video_item_detail_title_text_size">16sp</dimen> <dimen name="video_item_detail_title_text_size">16sp</dimen>
<dimen name="video_item_detail_views_text_size">14sp</dimen> <dimen name="video_item_detail_views_text_size">14sp</dimen>
<dimen name="video_item_detail_likes_text_size">13sp</dimen> <dimen name="video_item_detail_likes_text_size">13sp</dimen>
<dimen name="video_item_detail_uploader_text_size">16sp</dimen> <dimen name="video_item_detail_uploader_text_size">12sp</dimen>
<dimen name="video_item_detail_sub_channel_text_size">16sp</dimen>
<dimen name="video_item_detail_upload_date_text_size">14sp</dimen> <dimen name="video_item_detail_upload_date_text_size">14sp</dimen>
<dimen name="video_item_detail_description_text_size">14sp</dimen> <dimen name="video_item_detail_description_text_size">14sp</dimen>
<dimen name="video_item_detail_next_text_size">17sp</dimen> <dimen name="video_item_detail_next_text_size">17sp</dimen>
@ -33,9 +34,11 @@
<dimen name="channel_rss_title_size">14sp</dimen> <dimen name="channel_rss_title_size">14sp</dimen>
<!-- Elements Size --> <!-- Elements Size -->
<dimen name="video_item_detail_uploader_image_size">42dp</dimen> <dimen name="video_item_detail_uploader_image_size">42dp</dimen>
<dimen name="video_item_detail_sub_channel_image_size">21dp</dimen>
<dimen name="video_item_detail_like_image_height">20sp</dimen> <dimen name="video_item_detail_like_image_height">20sp</dimen>
<dimen name="video_item_detail_like_image_width">20sp</dimen> <dimen name="video_item_detail_like_image_width">20sp</dimen>
<dimen name="channel_avatar_size">90dp</dimen> <dimen name="channel_avatar_size">90dp</dimen>
<dimen name="sub_channel_avatar_size">45dp</dimen>
<!-- Paddings & Margins --> <!-- Paddings & Margins -->
<dimen name="video_item_detail_like_margin">8dp</dimen> <dimen name="video_item_detail_like_margin">8dp</dimen>
<dimen name="video_item_detail_error_panel_margin">4dp</dimen> <dimen name="video_item_detail_error_panel_margin">4dp</dimen>

View file

@ -8,12 +8,14 @@
<dimen name="video_item_detail_title_text_size">16sp</dimen> <dimen name="video_item_detail_title_text_size">16sp</dimen>
<dimen name="video_item_detail_views_text_size">16sp</dimen> <dimen name="video_item_detail_views_text_size">16sp</dimen>
<dimen name="video_item_detail_likes_text_size">14sp</dimen> <dimen name="video_item_detail_likes_text_size">14sp</dimen>
<dimen name="video_item_detail_uploader_text_size">16sp</dimen> <dimen name="video_item_detail_sub_channel_text_size">16sp</dimen>
<dimen name="video_item_detail_uploader_text_size">12sp</dimen>
<dimen name="video_item_detail_upload_date_text_size">16sp</dimen> <dimen name="video_item_detail_upload_date_text_size">16sp</dimen>
<dimen name="video_item_detail_description_text_size">16sp</dimen> <dimen name="video_item_detail_description_text_size">16sp</dimen>
<dimen name="video_item_detail_next_text_size">18sp</dimen> <dimen name="video_item_detail_next_text_size">18sp</dimen>
<!-- Elements Size --> <!-- Elements Size -->
<dimen name="video_item_detail_uploader_image_size">45dp</dimen> <dimen name="video_item_detail_uploader_image_size">40dp</dimen>
<dimen name="video_item_detail_sub_channel_image_size">20dp</dimen>
<dimen name="video_item_detail_like_image_height">18sp</dimen> <dimen name="video_item_detail_like_image_height">18sp</dimen>
<dimen name="video_item_detail_like_image_width">18sp</dimen> <dimen name="video_item_detail_like_image_width">18sp</dimen>
<!-- Paddings & Margins --> <!-- Paddings & Margins -->

View file

@ -54,17 +54,20 @@
<dimen name="video_item_detail_title_text_size">15sp</dimen> <dimen name="video_item_detail_title_text_size">15sp</dimen>
<dimen name="video_item_detail_views_text_size">13sp</dimen> <dimen name="video_item_detail_views_text_size">13sp</dimen>
<dimen name="video_item_detail_likes_text_size">12sp</dimen> <dimen name="video_item_detail_likes_text_size">12sp</dimen>
<dimen name="video_item_detail_uploader_text_size">14sp</dimen> <dimen name="video_item_detail_uploader_text_size">12sp</dimen>
<dimen name="video_item_detail_sub_channel_text_size">14sp</dimen>
<dimen name="video_item_detail_upload_date_text_size">13sp</dimen> <dimen name="video_item_detail_upload_date_text_size">13sp</dimen>
<dimen name="video_item_detail_description_text_size">13sp</dimen> <dimen name="video_item_detail_description_text_size">13sp</dimen>
<dimen name="video_item_detail_next_text_size">15sp</dimen> <dimen name="video_item_detail_next_text_size">15sp</dimen>
<dimen name="channel_subscribers_text_size">12sp </dimen> <dimen name="channel_subscribers_text_size">12sp </dimen>
<dimen name="channel_rss_title_size">12sp</dimen> <dimen name="channel_rss_title_size">12sp</dimen>
<!-- Elements Size --> <!-- Elements Size -->
<dimen name="video_item_detail_uploader_image_size">28dp</dimen> <dimen name="video_item_detail_uploader_image_size">32dp</dimen>
<dimen name="video_item_detail_sub_channel_image_size">16dp</dimen>
<dimen name="video_item_detail_like_image_height">18sp</dimen> <dimen name="video_item_detail_like_image_height">18sp</dimen>
<dimen name="video_item_detail_like_image_width">18sp</dimen> <dimen name="video_item_detail_like_image_width">18sp</dimen>
<dimen name="channel_avatar_size">70dp</dimen> <dimen name="channel_avatar_size">70dp</dimen>
<dimen name="sub_channel_avatar_size">35dp</dimen>
<!-- Paddings & Margins --> <!-- Paddings & Margins -->
<dimen name="video_item_detail_like_margin">5dp</dimen> <dimen name="video_item_detail_like_margin">5dp</dimen>
<dimen name="video_item_detail_error_panel_margin">50dp</dimen> <dimen name="video_item_detail_error_panel_margin">50dp</dimen>

View file

@ -651,4 +651,7 @@
<string name="feed_use_dedicated_fetch_method_disable_button">Disable fast mode</string> <string name="feed_use_dedicated_fetch_method_disable_button">Disable fast mode</string>
<string name="feed_use_dedicated_fetch_method_help_text">Do you think feed loading is too slow? If so, try enabling fast loading (you can change it in settings or by pressing the button below).\n\nNewPipe offers two feed loading strategies:\n• Fetching the whole subscription channel, which is slow but complete.\n• Using a dedicated service endpoint, which is fast but usually not complete.\n\nThe difference between the two is that the fast one usually lacks some information, like the item\'s duration or type (can\'t distinguish between live videos and normal ones) and it may return less items.\n\nYouTube is an example of a service that offers this fast method with its RSS feed.\n\nSo the choice boils down to what you prefer: speed or precise information.</string> <string name="feed_use_dedicated_fetch_method_help_text">Do you think feed loading is too slow? If so, try enabling fast loading (you can change it in settings or by pressing the button below).\n\nNewPipe offers two feed loading strategies:\n• Fetching the whole subscription channel, which is slow but complete.\n• Using a dedicated service endpoint, which is fast but usually not complete.\n\nThe difference between the two is that the fast one usually lacks some information, like the item\'s duration or type (can\'t distinguish between live videos and normal ones) and it may return less items.\n\nYouTube is an example of a service that offers this fast method with its RSS feed.\n\nSo the choice boils down to what you prefer: speed or precise information.</string>
<string name="content_not_supported">This content is not yet supported by NewPipe.\n\nIt will hopefully be supported in a future version.</string> <string name="content_not_supported">This content is not yet supported by NewPipe.\n\nIt will hopefully be supported in a future version.</string>
<string name="detail_sub_channel_thumbnail_view_description">Channel\'s avatar thumbnail</string>
<string name="channel_created_by">Created by %s</string>
<string name="video_detail_by">By %s</string>
</resources> </resources>