Player/handleIntent: keep current player when clicking timestamp
This was always a bit weird, that clicking a timestamp would unconditionally switch to the popup player. With the new enum, it’s trivial to change it to always stay at the selected player now ;)
This commit is contained in:
parent
ae610587a3
commit
bbc93610bb
1 changed files with 2 additions and 8 deletions
|
|
@ -122,7 +122,6 @@ import org.schabi.newpipe.util.DependentPreferenceHelper;
|
||||||
import org.schabi.newpipe.util.ExtractorHelper;
|
import org.schabi.newpipe.util.ExtractorHelper;
|
||||||
import org.schabi.newpipe.util.ListHelper;
|
import org.schabi.newpipe.util.ListHelper;
|
||||||
import org.schabi.newpipe.util.NavigationHelper;
|
import org.schabi.newpipe.util.NavigationHelper;
|
||||||
import org.schabi.newpipe.util.PermissionHelper;
|
|
||||||
import org.schabi.newpipe.util.SerializedCache;
|
import org.schabi.newpipe.util.SerializedCache;
|
||||||
import org.schabi.newpipe.util.StreamTypeUtil;
|
import org.schabi.newpipe.util.StreamTypeUtil;
|
||||||
import org.schabi.newpipe.util.image.PicassoHelper;
|
import org.schabi.newpipe.util.image.PicassoHelper;
|
||||||
|
|
@ -362,13 +361,8 @@ public final class Player implements PlaybackListener, Listener {
|
||||||
// can move the initUIs stuff without breaking the setup for edge cases somehow.
|
// can move the initUIs stuff without breaking the setup for edge cases somehow.
|
||||||
switch (playerIntentType) {
|
switch (playerIntentType) {
|
||||||
case TimestampChange -> {
|
case TimestampChange -> {
|
||||||
// TODO: this breaks out of the pattern of asking for the permission before
|
// when playing from a timestamp, keep the current player as-is.
|
||||||
// sending the PlayerIntent, but I’m not sure yet how to combine the permissions
|
newPlayerType = playerType;
|
||||||
// with the new enum approach. Maybe it’s better that the player asks anyway?
|
|
||||||
if (!PermissionHelper.isPopupEnabledElseAsk(context)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
newPlayerType = PlayerType.POPUP;
|
|
||||||
}
|
}
|
||||||
default -> {
|
default -> {
|
||||||
newPlayerType = PlayerType.retrieveFromIntent(intent);
|
newPlayerType = PlayerType.retrieveFromIntent(intent);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue