1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00

Fix video detail controls visibility set inconsistently

This commit is contained in:
Stypox 2020-10-02 16:03:43 +02:00
parent fbcdaa77e3
commit dbb86d25e1
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -1550,22 +1550,16 @@ public class VideoDetailFragment
0); 0);
} }
switch (info.getStreamType()) { detailControlsDownload.setVisibility(info.getStreamType() == StreamType.LIVE_STREAM
case LIVE_STREAM: || info.getStreamType() == StreamType.AUDIO_LIVE_STREAM ? View.GONE : View.VISIBLE);
case AUDIO_LIVE_STREAM: detailControlsBackground.setVisibility(info.getAudioStreams().isEmpty()
detailControlsDownload.setVisibility(View.GONE); ? View.GONE : View.VISIBLE);
break;
default: final boolean noVideoStreams =
if (info.getAudioStreams().isEmpty()) { info.getVideoStreams().isEmpty() && info.getVideoOnlyStreams().isEmpty();
detailControlsBackground.setVisibility(View.GONE); detailControlsPopup.setVisibility(noVideoStreams ? View.GONE : View.VISIBLE);
} thumbnailPlayButton.setImageResource(
if (!info.getVideoStreams().isEmpty() || !info.getVideoOnlyStreams().isEmpty()) { noVideoStreams ? R.drawable.ic_headset_shadow : R.drawable.ic_play_arrow_shadow);
break;
}
detailControlsPopup.setVisibility(View.GONE);
thumbnailPlayButton.setImageResource(R.drawable.ic_headset_shadow);
break;
}
} }
private void hideAgeRestrictedContent() { private void hideAgeRestrictedContent() {