commit f16eb3a009a30c6347927a6bfdfe04baa6edfae6 parent d147dc5ce0a92cc803ec7cc6ffbeb5091bc10144 Author: rhunk <101876869+rhunk@users.noreply.github.com> Date: Sat, 18 Nov 2023 11:06:22 +0100 feat(core/ui): hide settings gear option Diffstat:
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/common/src/main/assets/lang/en_US.json b/common/src/main/assets/lang/en_US.json @@ -290,9 +290,9 @@ "name": "Disable Spotlight", "description": "Disables the Spotlight page" }, - "startup_tab": { - "name": "Startup Tab", - "description": "Change the tab that opens on startup" + "hide_settings_gear": { + "name": "Hide Settings Gear", + "description": "Hides the SnapEnhance Settings Gear in friend feed" }, "story_viewer_override": { "name": "Story Viewer Override", diff --git a/common/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/UserInterfaceTweaks.kt b/common/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/UserInterfaceTweaks.kt @@ -44,5 +44,6 @@ class UserInterfaceTweaks : ConfigContainer() { ) { requireRestart() } val oldBitmojiSelfie = unique("old_bitmoji_selfie", "2d", "3d") { requireCleanCache() } val disableSpotlight = boolean("disable_spotlight") { requireRestart() } + val hideSettingsGear = boolean("hide_settings_gear") { requireRestart() } val storyViewerOverride = unique("story_viewer_override", "DISCOVER_PLAYBACK_SEEKBAR", "VERTICAL_STORY_VIEWER") { requireRestart() } } diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/ui/menu/impl/SettingsGearInjector.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/ui/menu/impl/SettingsGearInjector.kt @@ -14,6 +14,7 @@ import me.rhunk.snapenhance.core.util.ktx.getStyledAttributes @SuppressLint("DiscouragedApi") class SettingsGearInjector : AbstractMenu() { override fun inject(parent: ViewGroup, view: View, viewConsumer: (View) -> Unit) { + if (context.config.userInterface.hideSettingsGear.get()) return val firstView = (view as ViewGroup).getChildAt(0) val ngsHovaHeaderSearchIconBackgroundMarginLeft = context.resources.getDimens("ngs_hova_header_search_icon_background_margin_left")