1
mirror of https://github.com/revanced/revanced-integrations synced 2025-11-21 18:35:37 +01:00

Compare commits

...

2 Commits

Author SHA1 Message Date
semantic-release-bot
1351358268 chore(release): 0.78.1 [skip ci]
## [0.78.1](https://github.com/revanced/revanced-integrations/compare/v0.78.0...v0.78.1) (2022-11-29)

### Bug Fixes

* **twitch/settings:** add missing classes ([#226](https://github.com/revanced/revanced-integrations/issues/226)) ([35aa4f9](35aa4f92c6))
2022-11-29 23:48:47 +00:00
Tim Schneeberger
35aa4f92c6 fix(twitch/settings): add missing classes (#226) 2022-11-30 00:45:05 +01:00
6 changed files with 80 additions and 1 deletions

View File

@@ -1,3 +1,10 @@
## [0.78.1](https://github.com/revanced/revanced-integrations/compare/v0.78.0...v0.78.1) (2022-11-29)
### Bug Fixes
* **twitch/settings:** add missing classes ([#226](https://github.com/revanced/revanced-integrations/issues/226)) ([35aa4f9](https://github.com/revanced/revanced-integrations/commit/35aa4f92c6fc36d5421d41fb005e2298e1e8ed70))
# [0.78.0](https://github.com/revanced/revanced-integrations/compare/v0.77.1...v0.78.0) (2022-11-25)

View File

@@ -0,0 +1,9 @@
package app.revanced.twitch.patches;
import app.revanced.twitch.settings.SettingsEnum;
public class AudioAdsPatch {
public static boolean shouldBlockAudioAds() {
return SettingsEnum.BLOCK_AUDIO_ADS.getBoolean();
}
}

View File

@@ -0,0 +1,10 @@
package app.revanced.twitch.patches;
import app.revanced.twitch.settings.SettingsEnum;
public class DebugModePatch {
public static boolean isDebugModeEnabled() {
return SettingsEnum.DEBUG_MODE.getBoolean();
}
}

View File

@@ -0,0 +1,44 @@
package app.revanced.twitch.patches;
import android.graphics.Color;
import android.graphics.Typeface;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.SpannedString;
import android.text.style.ForegroundColorSpan;
import android.text.style.StrikethroughSpan;
import android.text.style.StyleSpan;
import java.util.Objects;
import app.revanced.twitch.settings.SettingsEnum;
import app.revanced.twitch.utils.ReVancedUtils;
import tv.twitch.android.shared.chat.util.ClickableUsernameSpan;
public class ShowDeletedMessagesPatch {
public static boolean shouldUseSpoiler() {
return Objects.equals(SettingsEnum.SHOW_DELETED_MESSAGES.getString(), "spoiler");
}
public static boolean shouldCrossOut() {
return Objects.equals(SettingsEnum.SHOW_DELETED_MESSAGES.getString(), "cross-out");
}
public static Spanned reformatDeletedMessage(Spanned original) {
if (!shouldCrossOut())
return null;
SpannableStringBuilder ssb = new SpannableStringBuilder(original);
ssb.setSpan(new StrikethroughSpan(), 0, original.length(), 0);
ssb.append(" (").append(ReVancedUtils.getString("revanced_deleted_msg")).append(")");
ssb.setSpan(new StyleSpan(Typeface.ITALIC), original.length(), ssb.length(), 0);
// Gray-out username
ClickableUsernameSpan[] usernameSpans = original.getSpans(0, original.length(), ClickableUsernameSpan.class);
if (usernameSpans.length > 0) {
ssb.setSpan(new ForegroundColorSpan(Color.parseColor("#ADADB8")), 0, original.getSpanEnd(usernameSpans[0]), 0);
}
return new SpannedString(ssb);
}
}

View File

@@ -0,0 +1,9 @@
package app.revanced.twitch.patches;
import app.revanced.twitch.settings.SettingsEnum;
public class VideoAdsPatch {
public static boolean shouldBlockVideoAds() {
return SettingsEnum.BLOCK_VIDEO_ADS.getBoolean();
}
}

View File

@@ -1,3 +1,3 @@
org.gradle.jvmargs = -Xmx2048m
android.useAndroidX = true
version = 0.78.0
version = 0.78.1