Skip to content

Commit

Permalink
refactor: cleanup key names
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Feb 22, 2024
1 parent 5074709 commit c96d0e9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,64 +108,59 @@ object SettingsPatch :

object PreferenceScreen : BasePreferenceScreen() {
// Sort screens in the root menu by key, to not scatter related items apart
// (sorting key is set in 'revanced_prefs.xml').
// (sorting key is set in revanced_prefs.xml).
// If no preferences are added to a screen, the screen will not be added to the settings.
val ADS = Screen(
"revanced_settings_screen_01",
"revanced_ads_screen_title",
null,
key = "revanced_settings_screen_01_ads",
summaryKey = null,
)
val ALTERNATIVE_THUMBNAILS = Screen(
"revanced_settings_screen_02",
"revanced_alt_thumbnail_screen_title",
null,
key = "revanced_settings_screen_02_alt_thumbnails",
summaryKey = null,
sorting = Sorting.UNSORTED,
)
val LAYOUT_FEED = Screen(
"revanced_settings_screen_03",
"revanced_layout_feed_screen_title",
null,
key = "revanced_settings_screen_03_layout_feed",
summaryKey = null,
)
val LAYOUT_PLAYER = Screen(
"revanced_settings_screen_04",
"revanced_layout_player_screen_title",
null,
key = "revanced_settings_screen_04_layout_player",
summaryKey = null,
)
val LAYOUT_GENERAL = Screen(
"revanced_settings_screen_05",
"revanced_layout_general_screen_title",
null,
key = "revanced_settings_screen_05_layout_general",
summaryKey = null,
)

// Don't sort, as preferences are scattered apart.
// Don't sort, as related preferences are scattered apart.
// Can use title sorting after PreferenceCategory support is added.
val SHORTS = Screen(
"revanced_settings_screen_06",
"revanced_shorts_screen_title",
null,
key = "revanced_settings_screen_06_shorts",
summaryKey = null,
sorting = Sorting.UNSORTED,
)

// Don't sort, because title sorting scatters the custom color preferences.
val SEEKBAR = Screen(
"revanced_settings_screen_07",
"revanced_seekbar_screen_title",
null,
key = "revanced_settings_screen_07_seekbar",
summaryKey = null,
sorting = Sorting.UNSORTED,
)

val SWIPE_CONTROLS = Screen(
"revanced_settings_screen_08",
"revanced_swipe_controls_screen_title",
null,
key = "revanced_settings_screen_08_swipe_controls",
summaryKey = null,
sorting = Sorting.UNSORTED,
)

// RYD and SB are items 9 and 10.
// Menus are added in their own patch because they use an Intent and not a Screen.

val MISC = Screen("revanced_settings_screen_11", "revanced_misc_screen_title", null)
val VIDEO = Screen("revanced_settings_screen_12", "revanced_video_screen_title", null)
val MISC = Screen(
key = "revanced_settings_screen_11_misc",
summaryKey = null,
)
val VIDEO = Screen(
key = "revanced_settings_screen_12_video",
summaryKey = null,
)

override fun commit(screen: app.revanced.patches.shared.misc.settings.preference.PreferenceScreen) {
SettingsResourcePatch += screen
Expand Down
20 changes: 10 additions & 10 deletions src/main/resources/addresources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@
<string name="revanced_pref_import_export_summary">Import / Export ReVanced settings</string>
</patch>
<patch id="misc.settings.SettingsPatch">
<string name="revanced_ads_screen_title">Ads</string>
<string name="revanced_layout_feed_screen_title">Feed layout</string>
<string name="revanced_layout_player_screen_title">Player layout</string>
<string name="revanced_layout_general_screen_title">General layout</string>
<string name="revanced_shorts_screen_title">Shorts</string>
<string name="revanced_seekbar_screen_title">Seekbar</string>
<string name="revanced_misc_screen_title">Misc</string>
<string name="revanced_video_screen_title">Video</string>
<string name="revanced_settings_screen_01_ads_title">Ads</string>
<string name="revanced_settings_screen_02_alt_thumbnails_title">Alternative thumbnails</string>
<string name="revanced_settings_screen_03_layout_feed_title">Feed layout</string>
<string name="revanced_settings_screen_04_layout_player_title">Player layout</string>
<string name="revanced_settings_screen_05_layout_general_title">General layout</string>
<string name="revanced_settings_screen_06_shorts_title">Shorts</string>
<string name="revanced_settings_screen_07_seekbar_title">Seekbar</string>
<string name="revanced_settings_screen_08_swipe_controls_title">Swipe controls</string>
<string name="revanced_settings_screen_11_misc_title">Misc</string>
<string name="revanced_settings_screen_12_video_title">Video</string>
</patch>
<patch id="misc.debugging.DebuggingPatch">
<string name="revanced_debug_title">Debug logging</string>
Expand Down Expand Up @@ -245,7 +247,6 @@
<string name="revanced_seekbar_tapping_summary_off">Seekbar tapping is disabled</string>
</patch>
<patch id="interaction.swipecontrols.SwipeControlsResourcePatch">
<string name="revanced_swipe_controls_screen_title">Swipe controls</string>
<string name="revanced_swipe_brightness_title">Enable brightness gesture</string>
<string name="revanced_swipe_brightness_summary_on">Brightness swipe is enabled</string>
<string name="revanced_swipe_brightness_summary_off">Brightness swipe is disabled</string>
Expand Down Expand Up @@ -807,7 +808,6 @@
<string name="revanced_seekbar_custom_color_invalid">Invalid seekbar color value. Using default value.</string>
</patch>
<patch id="layout.thumbnails.AlternativeThumbnailsPatch">
<string name="revanced_alt_thumbnail_screen_title">Alternative thumbnails</string>
<string name="revanced_alt_thumbnail_about_title">Thumbnails in use</string>
<string name="revanced_alt_thumbnail_dearrow_title">Enable DeArrow thumbnails</string>
<string name="revanced_alt_thumbnail_dearrow_summary_on">Using DeArrow thumbnails</string>
Expand Down

0 comments on commit c96d0e9

Please sign in to comment.