feat(core/ui): hide settings gear option

This commit is contained in:
rhunk
2023-11-18 11:06:22 +01:00
parent d147dc5ce0
commit f16eb3a009
3 changed files with 5 additions and 3 deletions

View File

@ -290,9 +290,9 @@
"name": "Disable Spotlight", "name": "Disable Spotlight",
"description": "Disables the Spotlight page" "description": "Disables the Spotlight page"
}, },
"startup_tab": { "hide_settings_gear": {
"name": "Startup Tab", "name": "Hide Settings Gear",
"description": "Change the tab that opens on startup" "description": "Hides the SnapEnhance Settings Gear in friend feed"
}, },
"story_viewer_override": { "story_viewer_override": {
"name": "Story Viewer Override", "name": "Story Viewer Override",

View File

@ -44,5 +44,6 @@ class UserInterfaceTweaks : ConfigContainer() {
) { requireRestart() } ) { requireRestart() }
val oldBitmojiSelfie = unique("old_bitmoji_selfie", "2d", "3d") { requireCleanCache() } val oldBitmojiSelfie = unique("old_bitmoji_selfie", "2d", "3d") { requireCleanCache() }
val disableSpotlight = boolean("disable_spotlight") { requireRestart() } 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() } val storyViewerOverride = unique("story_viewer_override", "DISCOVER_PLAYBACK_SEEKBAR", "VERTICAL_STORY_VIEWER") { requireRestart() }
} }

View File

@ -14,6 +14,7 @@ import me.rhunk.snapenhance.core.util.ktx.getStyledAttributes
@SuppressLint("DiscouragedApi") @SuppressLint("DiscouragedApi")
class SettingsGearInjector : AbstractMenu() { class SettingsGearInjector : AbstractMenu() {
override fun inject(parent: ViewGroup, view: View, viewConsumer: (View) -> Unit) { 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 firstView = (view as ViewGroup).getChildAt(0)
val ngsHovaHeaderSearchIconBackgroundMarginLeft = context.resources.getDimens("ngs_hova_header_search_icon_background_margin_left") val ngsHovaHeaderSearchIconBackgroundMarginLeft = context.resources.getDimens("ngs_hova_header_search_icon_background_margin_left")