mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 08:30:44 +00:00
Hide tabs when a video is age restricted
This commit is contained in:
parent
90f9819cbd
commit
70ede70ea8
@ -816,7 +816,7 @@ public class VideoDetailFragment extends BaseStateFragment<StreamInfo>
|
|||||||
isLoading.set(false);
|
isLoading.set(false);
|
||||||
if (result.getAgeLimit() != NO_AGE_LIMIT && !prefs.getBoolean(
|
if (result.getAgeLimit() != NO_AGE_LIMIT && !prefs.getBoolean(
|
||||||
getString(R.string.show_age_restricted_content), false)) {
|
getString(R.string.show_age_restricted_content), false)) {
|
||||||
showError(getString(R.string.restricted_video), false);
|
hideAgeRestrictedContent();
|
||||||
} else {
|
} else {
|
||||||
currentInfo = result;
|
currentInfo = result;
|
||||||
handleResult(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() {
|
public void openDownloadDialog() {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user