fix(YouTube - Old video quality menu): Fix toast error on tablet devices (#500)

This commit is contained in:
LisoUseInAIKyrios 2023-10-15 18:58:21 +03:00 committed by GitHub
parent 12e663c548
commit d3eba27c90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,10 +27,13 @@ public final class OldVideoQualityMenuPatch {
// Check if the current view is the quality menu. // Check if the current view is the quality menu.
if (VideoQualityMenuFilterPatch.isVideoQualityMenuVisible) { if (VideoQualityMenuFilterPatch.isVideoQualityMenuVisible) {
VideoQualityMenuFilterPatch.isVideoQualityMenuVisible = false; VideoQualityMenuFilterPatch.isVideoQualityMenuVisible = false;
((ViewGroup) recyclerView.getParent().getParent().getParent()).setVisibility(View.GONE);
// Click the "Advanced" quality menu to show the "old" quality menu. ((ViewGroup) recyclerView.getParent().getParent().getParent()).setVisibility(View.GONE);
((ViewGroup) recyclerView.getChildAt(0)).getChildAt(3).performClick(); View advancedQualityView = ((ViewGroup) recyclerView.getChildAt(0)).getChildAt(3);
if (advancedQualityView != null) {
// Click the "Advanced" quality menu to show the "old" quality menu.
advancedQualityView.performClick();
}
} }
} catch (Exception ex) { } catch (Exception ex) {
LogHelper.printException(() -> "onFlyoutMenuCreate failure", ex); LogHelper.printException(() -> "onFlyoutMenuCreate failure", ex);