From 7a9c61b71b47e9b8ef60c83e51f3e490151c6f99 Mon Sep 17 00:00:00 2001 From: OxrxL <108184954+OxrxL@users.noreply.github.com> Date: Thu, 30 Jun 2022 13:32:08 +0200 Subject: [PATCH] refactor: Strings closes #29 --- .../adremover/whitelist/Whitelist.java | 4 +- .../adremover/whitelist/WhitelistType.java | 6 +- .../requests/WhitelistRequester.java | 6 +- .../integrations/ryd/dialog/Dialogs.java | 10 +- .../integrations/settings/Settings.java | 2 +- .../integrations/settings/SettingsEnum.java | 10 +- .../settingsmenu/RYDSettingsFragment.java | 8 +- .../ReVancedSettingsFragment.java | 16 +- .../settingsmenu/XSettingActivity.java | 4 +- .../sponsorblock/player/ui/AdButton.java | 2 +- .../sponsorblock/player/ui/CopyButton.java | 2 +- .../player/ui/CopyWithTimestamp.java | 2 +- .../player/ui/SBBrowserButton.java | 2 +- .../player/ui/SBWhitelistButton.java | 2 +- .../player/ui/SponsorBlockVoting.java | 2 +- .../seekbar/BrightnessSeekBar.java | 8 +- app/src/main/res/values/arrays.xml | 12 +- app/src/main/res/values/strings.xml | 356 +++++++++--------- app/src/main/res/xml/revanced_prefs.xml | 92 +++++ ...agment (stuff to add on original file).xml | 9 + 20 files changed, 319 insertions(+), 236 deletions(-) create mode 100644 app/src/main/res/xml/revanced_prefs.xml create mode 100644 app/src/main/res/xml/settings_fragment (stuff to add on original file).xml diff --git a/app/src/main/java/app/revanced/integrations/adremover/whitelist/Whitelist.java b/app/src/main/java/app/revanced/integrations/adremover/whitelist/Whitelist.java index 786e6308..031646ec 100644 --- a/app/src/main/java/app/revanced/integrations/adremover/whitelist/Whitelist.java +++ b/app/src/main/java/app/revanced/integrations/adremover/whitelist/Whitelist.java @@ -147,9 +147,9 @@ public class Whitelist { boolean success = updateWhitelist(whitelistType, channels, context); String friendlyName = whitelistType.getFriendlyName(); if (success) { - Toast.makeText(context, str("vanced_whitelisting_removed", channelName, friendlyName), Toast.LENGTH_SHORT).show(); + Toast.makeText(context, str("revanced_whitelisting_removed", channelName, friendlyName), Toast.LENGTH_SHORT).show(); } else { - Toast.makeText(context, str("vanced_whitelisting_remove_failed", channelName, friendlyName), Toast.LENGTH_SHORT).show(); + Toast.makeText(context, str("revanced_whitelisting_remove_failed", channelName, friendlyName), Toast.LENGTH_SHORT).show(); } } diff --git a/app/src/main/java/app/revanced/integrations/adremover/whitelist/WhitelistType.java b/app/src/main/java/app/revanced/integrations/adremover/whitelist/WhitelistType.java index a4cb1d16..cbef35bc 100644 --- a/app/src/main/java/app/revanced/integrations/adremover/whitelist/WhitelistType.java +++ b/app/src/main/java/app/revanced/integrations/adremover/whitelist/WhitelistType.java @@ -5,8 +5,8 @@ import static app.revanced.integrations.sponsorblock.StringRef.str; import app.revanced.integrations.utils.SharedPrefHelper; public enum WhitelistType { - ADS(SharedPrefHelper.SharedPrefNames.YOUTUBE, "vanced_whitelist_ads_enabled"), - SPONSORBLOCK(SharedPrefHelper.SharedPrefNames.SPONSOR_BLOCK, "vanced_whitelist_sb_enabled"); + ADS(SharedPrefHelper.SharedPrefNames.YOUTUBE, "revanced_whitelist_ads_enabled"), + SPONSORBLOCK(SharedPrefHelper.SharedPrefNames.SPONSOR_BLOCK, "revanced_whitelist_sb_enabled"); private final String friendlyName; private final String preferencesName; @@ -14,7 +14,7 @@ public enum WhitelistType { private final SharedPrefHelper.SharedPrefNames name; WhitelistType(SharedPrefHelper.SharedPrefNames name, String preferenceEnabledName) { - this.friendlyName = str("vanced_whitelisting_" + name().toLowerCase()); + this.friendlyName = str("revanced_whitelisting_" + name().toLowerCase()); this.name = name; this.preferencesName = "whitelist_" + name(); this.preferenceEnabledName = preferenceEnabledName; diff --git a/app/src/main/java/app/revanced/integrations/adremover/whitelist/requests/WhitelistRequester.java b/app/src/main/java/app/revanced/integrations/adremover/whitelist/requests/WhitelistRequester.java index e3116f9b..d0671fde 100644 --- a/app/src/main/java/app/revanced/integrations/adremover/whitelist/requests/WhitelistRequester.java +++ b/app/src/main/java/app/revanced/integrations/adremover/whitelist/requests/WhitelistRequester.java @@ -58,17 +58,17 @@ public class WhitelistRequester { runOnMainThread(() -> { if (success) { buttonIcon.setEnabled(whitelistType != WhitelistType.SPONSORBLOCK); - Toast.makeText(context, str("vanced_whitelisting_added", author, whitelistTypeName), Toast.LENGTH_SHORT).show(); + Toast.makeText(context, str("revanced_whitelisting_added", author, whitelistTypeName), Toast.LENGTH_SHORT).show(); } else { buttonIcon.setEnabled(whitelistType == WhitelistType.SPONSORBLOCK); - Toast.makeText(context, str("vanced_whitelisting_add_failed", author, whitelistTypeName), Toast.LENGTH_SHORT).show(); + Toast.makeText(context, str("revanced_whitelisting_add_failed", author, whitelistTypeName), Toast.LENGTH_SHORT).show(); } view.setEnabled(true); }); } else { LogHelper.debug("WhitelistRequester", "player fetch response was " + responseCode); runOnMainThread(() -> { - Toast.makeText(context, str("vanced_whitelisting_fetch_failed", responseCode), Toast.LENGTH_SHORT).show(); + Toast.makeText(context, str("revanced_whitelisting_fetch_failed", responseCode), Toast.LENGTH_SHORT).show(); buttonIcon.setEnabled(true); view.setEnabled(true); }); diff --git a/app/src/main/java/app/revanced/integrations/ryd/dialog/Dialogs.java b/app/src/main/java/app/revanced/integrations/ryd/dialog/Dialogs.java index eb2ba894..37883a3a 100644 --- a/app/src/main/java/app/revanced/integrations/ryd/dialog/Dialogs.java +++ b/app/src/main/java/app/revanced/integrations/ryd/dialog/Dialogs.java @@ -44,25 +44,25 @@ public class Dialogs { } else { builder = new AlertDialog.Builder(activity); } - builder.setTitle(str("vanced_ryd")); + builder.setTitle(str("revanced_ryd")); builder.setIcon(ReVancedUtils.getIdentifier("reel_dislike_icon", "drawable")); builder.setCancelable(false); - builder.setMessage(str("vanced_ryd_firstrun")); - builder.setPositiveButton(str("vanced_enable"), + builder.setMessage(str("revanced_ryd_firstrun")); + builder.setPositiveButton(str("revanced_enable"), (dialog, id) -> { SharedPrefHelper.saveBoolean(context, SharedPrefHelper.SharedPrefNames.RYD, PREFERENCES_KEY_RYD_HINT_SHOWN, true); SharedPrefHelper.saveBoolean(context, SharedPrefHelper.SharedPrefNames.RYD, PREFERENCES_KEY_RYD_ENABLED, true); dialog.dismiss(); }); - builder.setNegativeButton(str("vanced_disable"), + builder.setNegativeButton(str("revanced_disable"), (dialog, id) -> { SharedPrefHelper.saveBoolean(context, SharedPrefHelper.SharedPrefNames.RYD, PREFERENCES_KEY_RYD_HINT_SHOWN, true); SharedPrefHelper.saveBoolean(context, SharedPrefHelper.SharedPrefNames.RYD, PREFERENCES_KEY_RYD_ENABLED, false); dialog.dismiss(); }); - builder.setNeutralButton(str("vanced_learnmore"), null); + builder.setNeutralButton(str("revanced_learnmore"), null); AlertDialog dialog = builder.create(); dialog.show(); diff --git a/app/src/main/java/app/revanced/integrations/settings/Settings.java b/app/src/main/java/app/revanced/integrations/settings/Settings.java index 2ab8054b..5637f68a 100644 --- a/app/src/main/java/app/revanced/integrations/settings/Settings.java +++ b/app/src/main/java/app/revanced/integrations/settings/Settings.java @@ -60,7 +60,7 @@ public class Settings { } public static void setOldLayout(SharedPreferences sharedPreferences, String config, long timeStamp) { - if (!SettingsEnum.OLD_LAYOUT_XFILE_ENABLED_BOOLEAN.getBoolean()) { + if (!SettingsEnum.OLD_LAYOUT_ENABLED_BOOLEAN.getBoolean()) { sharedPreferences.edit().putString("com.google.android.libraries.youtube.innertube.cold_config_group", config).putLong("com.google.android.libraries.youtube.innertube.cold_stored_timestamp", timeStamp).apply(); LogHelper.debug("Settings", "setOldLayout: true"); return; diff --git a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java index 114b3139..9ade6a05 100644 --- a/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java +++ b/app/src/main/java/app/revanced/integrations/settings/SettingsEnum.java @@ -8,10 +8,10 @@ import app.revanced.integrations.utils.SharedPrefHelper; public enum SettingsEnum { - DEBUG_BOOLEAN("debug_xfile_enabled", false), + DEBUG_BOOLEAN("debug_revanced_enabled", false), MANUFACTURER_OVERRIDE_STRING("override_manufacturer", null), MODEL_OVERRIDE_STRING("override_model", null), - CODEC_OVERRIDE_BOOLEAN("override_resolution_xfile_enabled", true), + CODEC_OVERRIDE_BOOLEAN("revanced_vp9_enabled", true), PREFERRED_RESOLUTION_WIFI_INTEGER("pref_video_quality_wifi", -2), PREFERRED_RESOLUTION_MOBILE_INTEGER("pref_video_quality_mobile", -2), PREFERRED_VIDEO_SPEED_FLOAT("pref_video_speed", -2.0f), @@ -22,12 +22,12 @@ public enum SettingsEnum { REEL_BUTTON_SHOWN_BOOLEAN("reel_button_enabled", false), SHORTS_BUTTON_SHOWN_BOOLEAN("shorts_button_enabled", false), CAST_BUTTON_SHOWN_BOOLEAN("cast_button_enabled", false), - CREATE_BUTTON_SHOWN_BOOLEAN("xfile_create_button_enabled", false), + CREATE_BUTTON_SHOWN_BOOLEAN("revanced_create_button_enabled", false), SUGGESTIONS_SHOWN_BOOLEAN("info_card_suggestions_enabled", false), INFO_CARDS_SHOWN_BOOLEAN("info_cards_enabled", false), BRANDING_SHOWN_BOOLEAN("branding_watermark_enabled", false), USE_TABLET_MINIPLAYER_BOOLEAN("tablet_miniplayer", false), - USE_NEW_ACTIONBAR_BOOLEAN("xfile_new_actionbar", false), + USE_NEW_ACTIONBAR_BOOLEAN("revanced_new_actionbar", false), USE_DARK_THEME_BOOLEAN("app_theme_dark", false), USE_HDR_BRIGHTNESS_BOOLEAN("pref_hdr_autobrightness", true), ENABLE_SWIPE_BRIGHTNESS_BOOLEAN("pref_xfenster_brightness", true), @@ -39,7 +39,7 @@ public enum SettingsEnum { PLAYBACK_MAX_BUFFER_INTEGER("pref_buffer_for_playback_ms", 2500), MAX_PLAYBACK_BUFFER_AFTER_REBUFFER_INTEGER("pref_buffer_for_playback_after_rebuffer_ms", 5000), OLD_STYLE_QUALITY_SETTINGS_BOOLEAN("old_style_quality_settings", true), - TAP_SEEKING_ENABLED_BOOLEAN("xfile_enable_tap_seeking", true), + TAP_SEEKING_ENABLED_BOOLEAN("revanced_enable_tap_seeking", true), ; private final String path; diff --git a/app/src/main/java/app/revanced/integrations/settingsmenu/RYDSettingsFragment.java b/app/src/main/java/app/revanced/integrations/settingsmenu/RYDSettingsFragment.java index 154ac16b..3eedf60e 100644 --- a/app/src/main/java/app/revanced/integrations/settingsmenu/RYDSettingsFragment.java +++ b/app/src/main/java/app/revanced/integrations/settingsmenu/RYDSettingsFragment.java @@ -38,8 +38,8 @@ public class RYDSettingsFragment extends PreferenceFragment { preference.setKey(PREFERENCES_KEY_RYD_ENABLED); preference.setDefaultValue(false); preference.setChecked(SharedPrefHelper.getBoolean(context, SharedPrefHelper.SharedPrefNames.RYD, PREFERENCES_KEY_RYD_ENABLED)); - preference.setTitle(str("vanced_ryd_title")); - preference.setSummary(str("vanced_ryd_summary")); + preference.setTitle(str("revanced_ryd_title")); + preference.setSummary(str("revanced_ryd_summary")); preference.setOnPreferenceChangeListener((pref, newValue) -> { final boolean value = (Boolean) newValue; ReturnYouTubeDislikes.onEnabledChange(value); @@ -71,8 +71,8 @@ public class RYDSettingsFragment extends PreferenceFragment { { Preference preference = new Preference(context); screen.addPreference(preference); - preference.setTitle(str("vanced_ryd_attribution_title")); - preference.setSummary(str("vanced_ryd_attribution_summary")); + preference.setTitle(str("revanced_ryd_attribution_title")); + preference.setSummary(str("revanced_ryd_attribution_summary")); preference.setOnPreferenceClickListener(pref -> { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse("https://returnyoutubedislike.com")); diff --git a/app/src/main/java/app/revanced/integrations/settingsmenu/ReVancedSettingsFragment.java b/app/src/main/java/app/revanced/integrations/settingsmenu/ReVancedSettingsFragment.java index e5a1b5dc..a79bb905 100644 --- a/app/src/main/java/app/revanced/integrations/settingsmenu/ReVancedSettingsFragment.java +++ b/app/src/main/java/app/revanced/integrations/settingsmenu/ReVancedSettingsFragment.java @@ -205,7 +205,7 @@ public class ReVancedSettingsFragment extends PreferenceFragment { SwipeGestureListener.TOP_PADDING = val; SettingsEnum.SWIPE_PADDING_TOP_INTEGER.setValue(val); } - } else if ("vanced_ryd_enabled".equals(str) && ReVancedUtils.getContext() != null && settingsInitialized) { + } else if ("revanced_ryd_enabled".equals(str) && ReVancedUtils.getContext() != null && settingsInitialized) { rebootDialog(ReVancedSettingsFragment.this.getActivity()); } else if (str.equals("pref_auto_repeat_button")) { AutoRepeatLinks(); @@ -224,7 +224,7 @@ public class ReVancedSettingsFragment extends PreferenceFragment { super.onCreate(bundle); getPreferenceManager().setSharedPreferencesName("youtube"); try { - int identifier = getResources().getIdentifier("xfile_prefs", "xml", getPackageName()); + int identifier = getResources().getIdentifier("revanced_prefs", "xml", getPackageName()); addPreferencesFromResource(identifier); String stringByName = ReVancedUtils.getStringByName(getActivity(), "quality_auto"); @@ -237,11 +237,11 @@ public class ReVancedSettingsFragment extends PreferenceFragment { } else { this.videoSpeedEntries[4] = stringByName2; } - this.minimizedVideoEntries[1] = ReVancedUtils.getStringByName(getActivity(), "xfile_miniplayer_style_video"); - this.minimizedVideoEntries[2] = ReVancedUtils.getStringByName(getActivity(), "xfile_miniplayer_style_video_controls"); + this.minimizedVideoEntries[1] = ReVancedUtils.getStringByName(getActivity(), "revanced_miniplayer_style_video"); + this.minimizedVideoEntries[2] = ReVancedUtils.getStringByName(getActivity(), "revanced_miniplayer_style_video_controls"); SharedPreferences sharedPreferences = getPreferenceManager().getSharedPreferences(); this.sharedPreferences = sharedPreferences; - this.settingsInitialized = sharedPreferences.getBoolean("xfile_initialized", false); + this.settingsInitialized = sharedPreferences.getBoolean("revanced_initialized", false); this.sharedPreferences.registerOnSharedPreferenceChangeListener(this.listener); this.Registered = true; this.codecPreferenceScreen = (PreferenceScreen) getPreferenceScreen().findPreference("codec_override"); @@ -252,7 +252,7 @@ public class ReVancedSettingsFragment extends PreferenceFragment { this.bufferSettingsPreferenceScreen = (PreferenceScreen) getPreferenceScreen().findPreference("buffer_screen"); this.miscsPreferenceScreen = (PreferenceScreen) getPreferenceScreen().findPreference("misc_screen"); this.xSwipeControlPreferenceScreen = (PreferenceScreen) getPreferenceScreen().findPreference("xfenster_screen"); - this.vp9Override = (SwitchPreference) this.codecPreferenceScreen.findPreference("vp9_xfile_enabled"); + this.vp9Override = (SwitchPreference) this.codecPreferenceScreen.findPreference("revanced_vp9_enabled"); this.manufacturerOverride = (EditTextPreference) this.codecPreferenceScreen.findPreference("override_manufacturer"); this.modelOverride = (EditTextPreference) this.codecPreferenceScreen.findPreference("override_model"); this.codecDefault = this.codecPreferenceScreen.findPreference("pref_default_override"); @@ -303,10 +303,10 @@ public class ReVancedSettingsFragment extends PreferenceFragment { } - this.sharedPreferences.edit().putBoolean("xfile_initialized", true); + this.sharedPreferences.edit().putBoolean("revanced_initialized", true); this.settingsInitialized = true; } catch (Throwable th) { - LogHelper.printException("XSettingsFragment", "Unable to retrieve resourceId for xfile_prefs", th); + LogHelper.printException("ReVancedSettingsFragment", "Unable to retrieve resourceId for revanced_prefs", th); } } diff --git a/app/src/main/java/app/revanced/integrations/settingsmenu/XSettingActivity.java b/app/src/main/java/app/revanced/integrations/settingsmenu/XSettingActivity.java index 222169f5..3925af22 100644 --- a/app/src/main/java/app/revanced/integrations/settingsmenu/XSettingActivity.java +++ b/app/src/main/java/app/revanced/integrations/settingsmenu/XSettingActivity.java @@ -36,10 +36,10 @@ public class XSettingActivity extends Activity { trySetTitle(getIdentifier("sb_settings", "string")); getFragmentManager().beginTransaction().replace(getIdentifier("xsettings_fragments", "id"), new SponsorBlockSettingsFragment()).commit(); } else if (dataString.equalsIgnoreCase("ryd_settings")) { - trySetTitle(getIdentifier("vanced_ryd_settings_title", "string")); + trySetTitle(getIdentifier("revanced_ryd_settings_title", "string")); getFragmentManager().beginTransaction().replace(getIdentifier("xsettings_fragments", "id"), new RYDSettingsFragment()).commit(); } else { - trySetTitle(getIdentifier("xfile_settings", "string")); + trySetTitle(getIdentifier("revanced_settings", "string")); getFragmentManager().beginTransaction().replace(getIdentifier("xsettings_fragments", "id"), new ReVancedSettingsFragment()).commit(); } context = getApplicationContext(); diff --git a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/AdButton.java b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/AdButton.java index ac328b90..ae96d49f 100644 --- a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/AdButton.java +++ b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/AdButton.java @@ -26,7 +26,7 @@ public class AdButton extends SlimButton { } private void initialize() { - this.button_icon.setImageResource(ReVancedUtils.getIdentifier("vanced_yt_ad_button", "drawable")); + this.button_icon.setImageResource(ReVancedUtils.getIdentifier("revanced_yt_ad_button", "drawable")); this.button_text.setText(str("action_ads")); changeEnabled(Whitelist.shouldShowAds()); } diff --git a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/CopyButton.java b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/CopyButton.java index 27298a7b..1d75277b 100644 --- a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/CopyButton.java +++ b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/CopyButton.java @@ -17,7 +17,7 @@ public class CopyButton extends SlimButton { } private void initialize() { - this.button_icon.setImageResource(ReVancedUtils.getIdentifier("vanced_yt_copy_icon", "drawable")); + this.button_icon.setImageResource(ReVancedUtils.getIdentifier("revanced_yt_copy_icon", "drawable")); this.button_text.setText(str("action_copy")); } diff --git a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/CopyWithTimestamp.java b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/CopyWithTimestamp.java index 3bc6f6cc..2c9f32e4 100644 --- a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/CopyWithTimestamp.java +++ b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/CopyWithTimestamp.java @@ -17,7 +17,7 @@ public class CopyWithTimestamp extends SlimButton { } private void initialize() { - this.button_icon.setImageResource(ReVancedUtils.getIdentifier("vanced_yt_copy_icon_with_time", "drawable")); + this.button_icon.setImageResource(ReVancedUtils.getIdentifier("revanced_yt_copy_icon_with_time", "drawable")); this.button_text.setText(str("action_tcopy")); } diff --git a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SBBrowserButton.java b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SBBrowserButton.java index d426225a..02ab4bc6 100644 --- a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SBBrowserButton.java +++ b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SBBrowserButton.java @@ -24,7 +24,7 @@ public class SBBrowserButton extends SlimButton { } private void initialize() { - this.button_icon.setImageResource(ReVancedUtils.getIdentifier("vanced_sb_browser", "drawable")); + this.button_icon.setImageResource(ReVancedUtils.getIdentifier("revanced_sb_browser", "drawable")); this.button_text.setText(str("action_browser")); } diff --git a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SBWhitelistButton.java b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SBWhitelistButton.java index cdfc05dc..bd4f519a 100644 --- a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SBWhitelistButton.java +++ b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SBWhitelistButton.java @@ -26,7 +26,7 @@ public class SBWhitelistButton extends SlimButton { } private void initialize() { - this.button_icon.setImageResource(ReVancedUtils.getIdentifier("vanced_yt_sb_button", "drawable")); + this.button_icon.setImageResource(ReVancedUtils.getIdentifier("revanced_yt_sb_button", "drawable")); this.button_text.setText(str("action_segments")); changeEnabled(Whitelist.isChannelSBWhitelisted()); } diff --git a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SponsorBlockVoting.java b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SponsorBlockVoting.java index 01a860f7..13c876c8 100644 --- a/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SponsorBlockVoting.java +++ b/app/src/main/java/app/revanced/integrations/sponsorblock/player/ui/SponsorBlockVoting.java @@ -15,7 +15,7 @@ public class SponsorBlockVoting extends SlimButton { } private void initialize() { - this.button_icon.setImageResource(ReVancedUtils.getIdentifier("vanced_sb_voting", "drawable")); + this.button_icon.setImageResource(ReVancedUtils.getIdentifier("revanced_sb_voting", "drawable")); this.button_text.setText("SB Voting"); } diff --git a/app/src/main/java/app/revanced/integrations/videoswipecontrols/seekbar/BrightnessSeekBar.java b/app/src/main/java/app/revanced/integrations/videoswipecontrols/seekbar/BrightnessSeekBar.java index b922079a..e9a23baa 100644 --- a/app/src/main/java/app/revanced/integrations/videoswipecontrols/seekbar/BrightnessSeekBar.java +++ b/app/src/main/java/app/revanced/integrations/videoswipecontrols/seekbar/BrightnessSeekBar.java @@ -19,7 +19,7 @@ public class BrightnessSeekBar { public int Progress; private boolean enabled; Handler handler; - private final String mBrightnessKey = "xfile_brightness_value"; + private final String mBrightnessKey = "revanced_brightness_value"; Context mContext; TextView mTextView; ViewGroup mViewGroup; @@ -30,7 +30,7 @@ public class BrightnessSeekBar { this.mContext = context; float systemBrightness = android.provider.Settings.System.getFloat(this.mContext.getContentResolver(), "screen_brightness", -1.0f); int _systemBrightness = (int) ((systemBrightness / 255.0f) * 100.0f); - this.Progress = SharedPrefHelper.getInt(this.mContext, SharedPrefHelper.SharedPrefNames.YOUTUBE, "xfile_brightness_value", Integer.valueOf(_systemBrightness)).intValue(); + this.Progress = SharedPrefHelper.getInt(this.mContext, SharedPrefHelper.SharedPrefNames.YOUTUBE, "revanced_brightness_value", Integer.valueOf(_systemBrightness)).intValue(); this.Max = 100; this.mTextView = new TextView(context); this.mTextView.setTextSize(24.0f); @@ -111,7 +111,7 @@ public class BrightnessSeekBar { public void disable() { this.enabled = false; - SharedPrefHelper.saveInt(this.mContext, SharedPrefHelper.SharedPrefNames.YOUTUBE,"xfile_brightness_value", Integer.valueOf(this.Progress)); + SharedPrefHelper.saveInt(this.mContext, SharedPrefHelper.SharedPrefNames.YOUTUBE,"revanced_brightness_value", Integer.valueOf(this.Progress)); disableBrightness(); LogHelper.debug("XDebug", "Brightness swipe disabled"); } @@ -120,7 +120,7 @@ public class BrightnessSeekBar { this.enabled = true; float systemBrightness = android.provider.Settings.System.getFloat(this.mContext.getContentResolver(), "screen_brightness", -1.0f); int _systemBrightness = (int) ((systemBrightness / 255.0f) * 100.0f); - int brightness = SharedPrefHelper.getInt(this.mContext, SharedPrefHelper.SharedPrefNames.YOUTUBE,"xfile_brightness_value", Integer.valueOf(_systemBrightness)).intValue(); + int brightness = SharedPrefHelper.getInt(this.mContext, SharedPrefHelper.SharedPrefNames.YOUTUBE,"revanced_brightness_value", Integer.valueOf(_systemBrightness)).intValue(); if (brightness < 0) { brightness = 0; } else if (brightness > 100) { diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 2c2d2057..43475602 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -1,12 +1,12 @@ - - @string/vanced_button_location_entry_none - @string/vanced_button_location_entry_player - @string/vanced_button_location_entry_buttoncontainer - @string/vanced_button_location_entry_both + + @string/revanced_button_location_entry_none + @string/revanced_button_location_entry_player + @string/revanced_button_location_entry_buttoncontainer + @string/revanced_button_location_entry_both - + NONE PLAYER BUTTON_CONTAINER diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1366333a..25208797 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,128 +1,118 @@ - " -- xfileFIN (Mods, Theming, Support) -- Laura (Theming, Support) -- ZaneZam (Publishing, Support) -- KevinX8 (Overlord, Support)" - About - "Doesn't show auto repeat button in the player overlay. Use the toggle below to control auto repeat" - Auto repeat button is shown in the player overlay - Auto repeat button - Auto repeat is off - Auto repeat is on - Auto repeat - Video watermark is hidden - Video watermark is shown - Video watermark - ExoPlayer v2 has to be enabled for buffer settings - Buffer settings - Cast button is hidden - Cast button is shown - Cast button - Codec override - Override manufacturer - Override model - Extra debug logging is disabled - Extra debug logging is enabled - Debug mode - Tap to set your device\'s default codec - Default codec - Tap to join Vanced on Discord - Discord Server - ExoPlayer v2 is experimental. DO NOT report errors that occur when ExoPlayer v2 is enabled - Warning - Tap to enable hardware HDR - Samsung Galaxy S8+ - Video brightness will follow your device\'s brightness on HDR landscape videos - Video brightness is set to max on HDR landscape videos - HDR Max brightness - taps needed to enable hidden settings - No need, hidden settings are already enabled - Hidden settings have been enabled - Info cards are hidden - Info cards are shown - Info cards - Layout settings - "The maximum duration of media that the player will attempt to buffer (in milliseconds) + " +- xfileFIN (First creator) +- oSumAtrIX (Mods, Patcher, Support) +- TheJeterLP (Integrations) +- bogadana (Mods, Support) +- Sculas (Manager, Patcher) +- baiorett (Manager)" + About + "Doesn't show auto-repeat button in the player overlay. Use the toggle below to control auto-repeat" + Auto-repeat button is shown in the player overlay + Auto-repeat button + Auto-repeat is off + Auto-repeat is on + Auto-repeat + Video watermark is hidden + Video watermark is shown + Video watermark + Buffer settings + Cast button is hidden + Cast button is shown + Cast button + Codec override + Manufacturer override + Model override + Extra debug logging is disabled + Extra Debug logging is enabled + Debug mode + Tap to set your device\'s default codec + Default codec + Tap to join ReVanced on Discord + Discord server + Tap to enable hardware HDR + Samsung Galaxy S8+ + Video brightness will follow your device\'s brightness on HDR landscape videos + Video brightness is set to max on HDR landscape videos + HDR max brightness + Info cards are hidden + Info cards are shown + Info cards + Layout settings + "The maximum duration of media that the player will attempt to buffer (in milliseconds) Default: 120000" - Maximum buffer - Select the preferred minimized video type - Minimized video type - Video only - Video with media controls - Misc - Video resolution is following your device screen resolution - Video resolution is being overridden to max - Max resolution - "The duration of media that must be buffered for playback to start or resume following a user action such as seeking (in milliseconds) + Maximum buffer + Misc. + Video resolution is following your device screen resolution + Video resolution is being overridden to max + Max resolution + "The duration of media that must be buffered for playback to start or resume following a user action such as seeking (in milliseconds) Default: 2500" - Playback start - Select preferred video resolution on Cellular Network - Preferred video quality Cellular - Select preferred video resolution on Wi-Fi Network - Preferred video quality Wi-Fi - Select preferred video speed - Preferred video speed - "The duration of media that must be buffered for playback to resume after a rebuffer (in milliseconds). A rebuffer is defined to be caused by buffer depletion rather than a user action + Playback start + Select preferred video resolution on Cellular Network + Preferred video quality Cellular + Select preferred video resolution on Wi-Fi Network + Preferred video quality Wi-Fi + Select preferred video speed + Preferred video speed + "The duration of media that must be buffered for playback to resume after a rebuffer (in milliseconds). A rebuffer is defined to be caused by buffer depletion rather than a user action Default: 5000" - Rebuffer - Vanced settings - Tap to enable software HDR - Google Pixel XL - End screens are hidden - End screens are shown - End screens - Support links - Support - Video settings - Tap to force usage of the VP9 codec - VP9 codec not forced - VP9 codec is enabled by default for supported devices, disable if you encounter stuttering/slowness in videos - VP9 codec - Tap to open the XDA post - XDA thread - Wide search bar - Search bar style is defined by the app - Forcing wide search bar - Dynamic player - Dynamic player is defined automatically - Dynamic player is forced on square and vertical videos - New official theme toggle is in the General settings. This theme toggle is \"Developer\" toggle - Theme info - Accessibility controls aren\'t displayed in the player - Accessibility controls are displayed in the player - Accessibility player - Captions aren\'t enabled automatically at 0% volume - Captions are enabled automatically at 0% volume - Auto captions - Amount of pixels excluded from swiping at the top of the display to prevent swipe controls when dragging down notifications - Swipe padding - Amount of pixels you have to swipe until detecting starts to prevent unintended swiping - Swipe threshold - Swipe controls for brightness are disabled - Swipe controls for brightness are enabled - Swipe controls for Brightness - Swipe controls for Brightness and Volume - Swipe controls - Swipe controls for volume are disabled - Swipe controls for volume are enabled - Swipe controls for Volume - Tap to open our website - Vanced website - Home ads are hidden - Home ads are shown - Home ads (Experimental) - Stories are hidden - Stories are shown - YouTube stories (Experimental) - Ad settings - Credits for people who have contributed - Credits - Home ads removing enhancement and showed other kinds of debugging methods + Rebuffer + Vanced settings + Tap to enable software HDR + Google Pixel XL + End screens are hidden + End screens are shown + End screens + Support links + Support + Video settings + Tap to force usage of the VP9 codec + VP9 codec not forced + VP9 codec is enabled by default for supported devices, disable if you encounter stuttering/slowness in videos + VP9 codec + Wide search bar + Search bar style is defined by the app + Forcing wide search bar + Dynamic player + Dynamic player is defined automatically + Dynamic player is forced on square and vertical videos + New official theme toggle is in the General settings. This theme toggle is \"Developer\" toggle + Theme info + Accessibility controls aren\'t displayed in the player + Accessibility controls are displayed in the player + Accessibility player + Captions aren\'t enabled automatically at 0% volume + Captions are enabled automatically at 0% volume + Auto captions + Amount of pixels excluded from swiping at the top of the display to prevent swipe controls when dragging down notifications + Swipe padding + Amount of pixels you have to swipe until detecting starts to prevent unintended swiping + Swipe threshold + Swipe controls for brightness are disabled + Swipe controls for brightness are enabled + Swipe controls for Brightness + Swipe controls for Brightness and Volume + Swipe controls + Swipe controls for volume are disabled + Swipe controls for volume are enabled + Swipe controls for Volume + Tap to open our website + Vanced website + Home ADS are hidden + Home ADS are shown + Home ADS (Experimental) + Stories are hidden + Stories are shown + YouTube stories (Experimental) + AD settings + Credits for people who have contributed + Credits + Home ADS removing enhancement and showed other kinds of debugging methods souramoo SponsorBlock implementation JakubWeg @@ -130,14 +120,11 @@ cane Bug fixing/helping out Oizaro - Comments are shown at the top (new place) - Comments are shown at the bottom (old place). This feature can break things. For example swipe features will not work - Comments location (Alpha) - Tablet miniplayer is not being used - Tablet miniplayer is being used - Tablet miniplayer - Vanced translators - Link to Crowdin where you can contribute by translating Vanced to your language + Tablet miniplayer is not being used + Tablet miniplayer is being used + Tablet miniplayer + ReVanced translators + Link to Crowdin where you can contribute by translating ReVanced to your language Enable SponsorBlock SponsorBlock is a crowd-sourced system for skipping annoying parts in YouTube videos @@ -277,44 +264,39 @@ Uses the sponsor.ajay.app API Notification settings - "1. Google device registration and Google Cloud Messaging need to be enabled for notifications. -2. Vanced needs to be shown as registered under GCM. -3. Current State in GCM must not be Disconnected. -4. GCM -> Advanced (three dots top right) and switch Wi-Fi ping interval back and forth once to connect." + "1. Google device registration and Cloud Messaging need to be enabled for notifications. +2. ReVanced needs to be shown as registered under Cloud Messaging. +3. Current State in Cloud Messaging must be Connected." MicroG settings - Vanced settings + ReVanced settings - Tapping on seek bar - Tapping on seek bar (video progress bar) is disabled - Tapping on seek bar (video progress bar) is enabled + Seekbar Tapping + Seekbar Tapping (video progress bar) is disabled + Seekbar Tapping (video progress bar) is enabled Normal - ExoPlayer V2 - ExoPlayer V2 is disabled (ExoPlayer V1 is being used) - ExoPlayer V2 is enabled (Default). ExoPlayer V1 might have a better performance + Shorts Shelf + Shorts Shelf removal is turned off + Shorts Shelf removal is turned on - Shorts shelf - Shorts shelf removal is turned off - Shorts shelf removal is turned on + Create Button has default visibility + Create Button is forcefully disabled + Create Button - Create button has default visibility - Create button is forcefully disabled - Create button + Community Guidelines + Community Guidelines removal is turned off + Community Guidelines removal is turned on - Community guidelines - Community guidelines removal is turned off - Community guidelines removal is turned on + Copy Link Button is hidden from the player overlay + Copy Link Button is shown in the player overlay + Copy Link Button With Timestamp is hidden from the player overlay + Copy Link Button With Timestamp is shown in the player overlay + Copy Link Button With Timestamp + Copy Link Button - Button to copy link is hidden from the player overlay - Button to copy link is shown in the player overlay - Button to copy link with timestamp is hidden from the player overlay - Button to copy link with timestamp is shown in the player overlay - Copy link (with timestamp) - Copy link - - Quality settings style - Using default style video quality settings - Using old style video quality settings + Quality Settings style + Using default style video quality settings + Using old style video quality settings Show time without segments This time appears in brackets next to the current time. This shows the total video duration minus any segments. @@ -348,7 +330,7 @@ Copy link Timestamp - Ads + ADS Segments SB Browser @@ -356,37 +338,37 @@ API URL reset Provided API URL is invalid - Video ad settings - Video ad whitelisting - Video ad whitelisting is turned off - Video ad whitelisting is turned on. Use the Ads button under the player to whitelist a channel - Ads - SponsorBlock - Channel %s was added to the %s whitelist - Channel %s was removed from the %s whitelist - Failed to add channel %s to the %s whitelist - Failed to remove channel %s from the %s whitelist - Failed to retrieve channel details, received code %d - Hidden - In player - Under player (ALPHA) - Both - Return YouTube Dislike settings - Uses the RYD API - Enable RYD (ALPHA) - Switch this on to see the dislike counts again - Return YouTube Dislike Integration - This integration uses the RYD API from https://returnyoutubedislike.com. Tap to learn more + Video ad settings + Video ad whitelisting + Video ad whitelisting is turned off + Video ad whitelisting is turned on. Use the ADS button under the player to whitelist a channel + ADS + SponsorBlock + Channel %s was added to the %s whitelist + Channel %s was removed from the %s whitelist + Failed to add channel %s to the %s whitelist + Failed to remove channel %s from the %s whitelist + Failed to retrieve channel details, received code %d + Hidden + In player + Under player + Both + Return YouTube Dislike settings + Uses the RYD API + Enable RYD + Switch this on to see the dislike counts again + Return YouTube Dislike Integration + This integration uses the RYD API from https://returnyoutubedislike.com. Tap to learn more - Tablet style - Tablet style is turned on. For example suggested videos are only partially working - Tablet style is turned off + Tablet style + Tablet style is turned on. For example suggested videos are only partially working + Tablet style is turned off - Return YouTube Dislike - Want to enable Return YouTube Dislikes to see dislikes again? Your likes/dislikes will be sent to RYD API (anonymously) after enabling RYD integration. You can enable/disable this in the settings at any time. - SponsorBlock - Are you aware of the SponsorBlock integration in Vanced? With it you can skip sponsored segments in the videos. You can enable/disable this in the settings at any time. - Learn more - Disable - Enable + Return YouTube Dislike + Want to enable Return YouTube Dislikes to see dislikes again? Your likes/dislikes will be sent to RYD API (anonymously) after enabling RYD integration. You can enable/disable this in the settings at any time. + SponsorBlock + Are you aware of the SponsorBlock integration in Vanced? With it you can skip sponsored segments in the videos. You can enable/disable this in the settings at any time. + Learn more + Disable + Enable diff --git a/app/src/main/res/xml/revanced_prefs.xml b/app/src/main/res/xml/revanced_prefs.xml new file mode 100644 index 00000000..25c8ddd6 --- /dev/null +++ b/app/src/main/res/xml/revanced_prefs.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/xml/settings_fragment (stuff to add on original file).xml b/app/src/main/res/xml/settings_fragment (stuff to add on original file).xml new file mode 100644 index 00000000..8b3111fb --- /dev/null +++ b/app/src/main/res/xml/settings_fragment (stuff to add on original file).xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file