-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement ability to ignore back-queue for main view #7273
Changes from all commits
58dbf67
d55d339
f00d184
2f6cdf0
618aea4
e84cac1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,6 +161,9 @@ public final class VideoDetailFragment | |
private boolean showComments; | ||
private boolean showRelatedItems; | ||
private boolean showDescription; | ||
|
||
private boolean ignoreQueue; | ||
|
||
private String selectedTabTag; | ||
@AttrRes @NonNull final List<Integer> tabIcons = new ArrayList<>(); | ||
@StringRes @NonNull final List<Integer> tabContentDescriptions = new ArrayList<>(); | ||
|
@@ -288,6 +291,10 @@ public void onCreate(final Bundle savedInstanceState) { | |
showComments = prefs.getBoolean(getString(R.string.show_comments_key), true); | ||
showRelatedItems = prefs.getBoolean(getString(R.string.show_next_video_key), true); | ||
showDescription = prefs.getBoolean(getString(R.string.show_description_key), true); | ||
ignoreQueue = prefs.getBoolean( | ||
getString(R.string.enable_ignore_backstack_key), | ||
DeviceUtils.isTv(activity) | ||
); | ||
Comment on lines
+294
to
+297
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if the user changes preference while the fragment is open? You need to update this variable in the shared preference change listener. |
||
selectedTabTag = prefs.getString( | ||
getString(R.string.stream_info_selected_tab_key), COMMENTS_TAB_TAG); | ||
prefs.registerOnSharedPreferenceChangeListener(this); | ||
|
@@ -782,6 +789,11 @@ public boolean onBackPressed() { | |
return true; | ||
} | ||
|
||
// when queue should be ignored, directly skip checks and let MainActivity handle everything | ||
if (ignoreQueue) { | ||
return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you should also |
||
} | ||
|
||
// If we have something in history of played items we replay it here | ||
if (isPlayerAvailable() | ||
&& player.getPlayQueue() != null | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the variable and remove spaces