Hide tabs when a video is age restricted

This commit is contained in:
wb9688 2020-04-11 09:30:12 +02:00
parent 90f9819cbd
commit 70ede70ea8
1 changed files with 11 additions and 1 deletions

View File

@ -816,7 +816,7 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
isLoading.set(false);
if (result.getAgeLimit() != NO_AGE_LIMIT && !prefs.getBoolean(
getString(R.string.show_age_restricted_content), false)) {
showError(getString(R.string.restricted_video), false);
hideAgeRestrictedContent();
} else {
currentInfo = result;
handleResult(result);
@ -1239,6 +1239,16 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
}
}
private void hideAgeRestrictedContent() {
showError(getString(R.string.restricted_video), false);
if (relatedStreamsLayout != null) { // tablet
relatedStreamsLayout.setVisibility(View.INVISIBLE);
}
viewPager.setVisibility(View.GONE);
tabLayout.setVisibility(View.GONE);
}
public void openDownloadDialog() {
try {