fix more issues with buttons i don't even know anymore

This commit is contained in:
caneleex 2021-04-29 22:47:40 +02:00
parent f57c5e1ee0
commit c389cd04b0
2 changed files with 12 additions and 8 deletions

View File

@ -204,9 +204,6 @@ public class PlayerController {
return;
}
SponsorBlockUtils.showShieldButton(); // skipping from end to the video will show the buttons again
SponsorBlockUtils.showVoteButton();
SponsorSegment[] segments = sponsorSegmentsOfCurrentVideo;
if (segments == null || segments.length == 0) return;
@ -275,6 +272,10 @@ public class PlayerController {
* Called very high frequency (once every about 100ms), also in background. It sometimes triggers when a video is paused (couple times in the row with the same value)
*/
public static void setCurrentVideoTimeHighPrecision(final long millis) {
if ((millis < lastKnownVideoTime && lastKnownVideoTime >= currentVideoLength) || millis == 0) {
SponsorBlockUtils.showShieldButton(); // skipping from end to the video will show the buttons again
SponsorBlockUtils.showVoteButton();
}
if (lastKnownVideoTime > 0) {
lastKnownVideoTime = millis;
VideoInformation.lastKnownVideoTime = lastKnownVideoTime;

View File

@ -83,8 +83,8 @@ public class SponsorBlockSettings {
if (!isSponsorBlockEnabled) {
SkipSegmentView.hide();
NewSegmentHelperLayout.hide();
ShieldButton.changeVisibilityImmediate(false);
VotingButton.changeVisibilityImmediate(false);
SponsorBlockUtils.hideShieldButton();
SponsorBlockUtils.hideVoteButton();
PlayerController.sponsorSegmentsOfCurrentVideo = null;
} else if (/*isAddNewSegmentEnabled*/false) {
SponsorBlockUtils.showShieldButton();
@ -93,13 +93,16 @@ public class SponsorBlockSettings {
isAddNewSegmentEnabled = preferences.getBoolean(PREFERENCES_KEY_NEW_SEGMENT_ENABLED, isAddNewSegmentEnabled);
if (!isAddNewSegmentEnabled) {
NewSegmentHelperLayout.hide();
ShieldButton.changeVisibilityImmediate(false);
SponsorBlockUtils.hideShieldButton();
} else {
ShieldButton.changeVisibilityImmediate(true);
SponsorBlockUtils.showShieldButton();
}
isVotingEnabled = preferences.getBoolean(PREFERENCES_KEY_VOTING_ENABLED, isVotingEnabled);
VotingButton.changeVisibilityImmediate(isVotingEnabled);
if (!isVotingEnabled)
SponsorBlockUtils.hideVoteButton();
else
SponsorBlockUtils.showVoteButton();
SegmentBehaviour[] possibleBehaviours = SegmentBehaviour.values();
final ArrayList<String> enabledCategories = new ArrayList<>(possibleBehaviours.length);