mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 08:30:44 +00:00
show subscriber count on player page
This commit is contained in:
parent
1d53389ca9
commit
86ee94eb04
@ -1561,9 +1561,9 @@ public final class VideoDetailFragment
|
|||||||
binding.detailSubChannelThumbnailView.setVisibility(View.GONE);
|
binding.detailSubChannelThumbnailView.setVisibility(View.GONE);
|
||||||
|
|
||||||
if (!isEmpty(info.getSubChannelName())) {
|
if (!isEmpty(info.getSubChannelName())) {
|
||||||
displayBothUploaderAndSubChannel(info);
|
displayBothUploaderAndSubChannel(info, activity);
|
||||||
} else if (!isEmpty(info.getUploaderName())) {
|
} else if (!isEmpty(info.getUploaderName())) {
|
||||||
displayUploaderAsSubChannel(info);
|
displayUploaderAsSubChannel(info, activity);
|
||||||
} else {
|
} else {
|
||||||
binding.detailUploaderTextView.setVisibility(View.GONE);
|
binding.detailUploaderTextView.setVisibility(View.GONE);
|
||||||
binding.detailUploaderThumbnailView.setVisibility(View.GONE);
|
binding.detailUploaderThumbnailView.setVisibility(View.GONE);
|
||||||
@ -1676,23 +1676,42 @@ public final class VideoDetailFragment
|
|||||||
noVideoStreams ? R.drawable.ic_headset_shadow : R.drawable.ic_play_arrow_shadow);
|
noVideoStreams ? R.drawable.ic_headset_shadow : R.drawable.ic_play_arrow_shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayUploaderAsSubChannel(final StreamInfo info) {
|
private void displayUploaderAsSubChannel(final StreamInfo info, final Context context) {
|
||||||
binding.detailSubChannelTextView.setText(info.getUploaderName());
|
binding.detailSubChannelTextView.setText(info.getUploaderName());
|
||||||
binding.detailSubChannelTextView.setVisibility(View.VISIBLE);
|
binding.detailSubChannelTextView.setVisibility(View.VISIBLE);
|
||||||
binding.detailSubChannelTextView.setSelected(true);
|
binding.detailSubChannelTextView.setSelected(true);
|
||||||
|
|
||||||
|
if (info.getUploaderSubscriberCount() > -1) {
|
||||||
|
binding.detailUploaderTextView.setText(
|
||||||
|
Localization.shortSubscriberCount(context, info.getUploaderSubscriberCount()));
|
||||||
|
binding.detailUploaderTextView.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
binding.detailUploaderTextView.setVisibility(View.GONE);
|
binding.detailUploaderTextView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void displayBothUploaderAndSubChannel(final StreamInfo info) {
|
private void displayBothUploaderAndSubChannel(final StreamInfo info, final Context context) {
|
||||||
binding.detailSubChannelTextView.setText(info.getSubChannelName());
|
binding.detailSubChannelTextView.setText(info.getSubChannelName());
|
||||||
binding.detailSubChannelTextView.setVisibility(View.VISIBLE);
|
binding.detailSubChannelTextView.setVisibility(View.VISIBLE);
|
||||||
binding.detailSubChannelTextView.setSelected(true);
|
binding.detailSubChannelTextView.setSelected(true);
|
||||||
|
|
||||||
binding.detailSubChannelThumbnailView.setVisibility(View.VISIBLE);
|
binding.detailSubChannelThumbnailView.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
final StringBuilder subText = new StringBuilder();
|
||||||
if (!isEmpty(info.getUploaderName())) {
|
if (!isEmpty(info.getUploaderName())) {
|
||||||
binding.detailUploaderTextView.setText(
|
subText.append(
|
||||||
String.format(getString(R.string.video_detail_by), info.getUploaderName()));
|
String.format(getString(R.string.video_detail_by), info.getUploaderName()));
|
||||||
|
}
|
||||||
|
if (info.getUploaderSubscriberCount() > -1) {
|
||||||
|
if (subText.length() > 0) {
|
||||||
|
subText.append(Localization.DOT_SEPARATOR);
|
||||||
|
}
|
||||||
|
subText.append(
|
||||||
|
Localization.shortSubscriberCount(context, info.getUploaderSubscriberCount()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subText.length() > 0) {
|
||||||
|
binding.detailUploaderTextView.setText(subText);
|
||||||
binding.detailUploaderTextView.setVisibility(View.VISIBLE);
|
binding.detailUploaderTextView.setVisibility(View.VISIBLE);
|
||||||
binding.detailUploaderTextView.setSelected(true);
|
binding.detailUploaderTextView.setSelected(true);
|
||||||
} else {
|
} else {
|
||||||
|
@ -321,7 +321,6 @@
|
|||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:textSize="@dimen/video_item_detail_uploader_text_size"
|
android:textSize="@dimen/video_item_detail_uploader_text_size"
|
||||||
android:textStyle="bold"
|
|
||||||
tools:ignore="RtlHardcoded"
|
tools:ignore="RtlHardcoded"
|
||||||
tools:text="Uploader" />
|
tools:text="Uploader" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -308,7 +308,6 @@
|
|||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
android:textSize="@dimen/video_item_detail_uploader_text_size"
|
android:textSize="@dimen/video_item_detail_uploader_text_size"
|
||||||
android:textStyle="bold"
|
|
||||||
tools:ignore="RtlHardcoded"
|
tools:ignore="RtlHardcoded"
|
||||||
tools:text="Uploader" />
|
tools:text="Uploader" />
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user