refactor: Show SB buttons with other overlay buttons when the video has ended
This commit is contained in:
+2
-3
@@ -5,10 +5,10 @@ import android.view.View;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import app.revanced.extension.shared.Logger;
|
import app.revanced.extension.shared.Logger;
|
||||||
import app.revanced.extension.youtube.patches.VideoInformation;
|
|
||||||
import app.revanced.extension.youtube.settings.Settings;
|
import app.revanced.extension.youtube.settings.Settings;
|
||||||
import app.revanced.extension.youtube.videoplayer.PlayerControlButton;
|
import app.revanced.extension.youtube.videoplayer.PlayerControlButton;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public class CreateSegmentButton {
|
public class CreateSegmentButton {
|
||||||
@Nullable
|
@Nullable
|
||||||
private static PlayerControlButton instance;
|
private static PlayerControlButton instance;
|
||||||
@@ -51,7 +51,6 @@ public class CreateSegmentButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean shouldBeShown() {
|
private static boolean shouldBeShown() {
|
||||||
return Settings.SB_ENABLED.get() && Settings.SB_CREATE_NEW_SEGMENT.get()
|
return Settings.SB_ENABLED.get() && Settings.SB_CREATE_NEW_SEGMENT.get();
|
||||||
&& !VideoInformation.isAtEndOfVideo();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -5,12 +5,12 @@ import android.view.View;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
import app.revanced.extension.shared.Logger;
|
import app.revanced.extension.shared.Logger;
|
||||||
import app.revanced.extension.youtube.patches.VideoInformation;
|
|
||||||
import app.revanced.extension.youtube.settings.Settings;
|
import app.revanced.extension.youtube.settings.Settings;
|
||||||
import app.revanced.extension.youtube.sponsorblock.SegmentPlaybackController;
|
import app.revanced.extension.youtube.sponsorblock.SegmentPlaybackController;
|
||||||
import app.revanced.extension.youtube.sponsorblock.SponsorBlockUtils;
|
import app.revanced.extension.youtube.sponsorblock.SponsorBlockUtils;
|
||||||
import app.revanced.extension.youtube.videoplayer.PlayerControlButton;
|
import app.revanced.extension.youtube.videoplayer.PlayerControlButton;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
public class VotingButton {
|
public class VotingButton {
|
||||||
@Nullable
|
@Nullable
|
||||||
private static PlayerControlButton instance;
|
private static PlayerControlButton instance;
|
||||||
@@ -54,6 +54,6 @@ public class VotingButton {
|
|||||||
|
|
||||||
private static boolean shouldBeShown() {
|
private static boolean shouldBeShown() {
|
||||||
return Settings.SB_ENABLED.get() && Settings.SB_VOTING_BUTTON.get()
|
return Settings.SB_ENABLED.get() && Settings.SB_VOTING_BUTTON.get()
|
||||||
&& SegmentPlaybackController.videoHasSegments() && !VideoInformation.isAtEndOfVideo();
|
&& SegmentPlaybackController.videoHasSegments();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user