mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-13 05:37:48 +02:00
feat(core/ui_tweaks): hide unread chat hint
This commit is contained in:
@ -752,7 +752,8 @@
|
||||
"hide_chat_call_buttons": "Remove Chat Call Buttons",
|
||||
"hide_live_location_share_button": "Remove Live Location Share Button",
|
||||
"hide_stickers_button": "Remove Stickers Button",
|
||||
"hide_voice_record_button": "Remove Voice Record Button"
|
||||
"hide_voice_record_button": "Remove Voice Record Button",
|
||||
"hide_unread_chat_hint": "Remove Unread Chat Hint"
|
||||
},
|
||||
"hide_story_sections": {
|
||||
"hide_friend_suggestions": "Hide friend suggestions",
|
||||
|
@ -41,7 +41,8 @@ class UserInterfaceTweaks : ConfigContainer() {
|
||||
"hide_stickers_button",
|
||||
"hide_live_location_share_button",
|
||||
"hide_chat_call_buttons",
|
||||
"hide_profile_call_buttons"
|
||||
"hide_profile_call_buttons",
|
||||
"hide_unread_chat_hint",
|
||||
) { requireRestart() }
|
||||
val operaMediaQuickInfo = boolean("opera_media_quick_info") { requireRestart() }
|
||||
val oldBitmojiSelfie = unique("old_bitmoji_selfie", "2d", "3d") { requireCleanCache() }
|
||||
|
@ -9,8 +9,8 @@ import me.rhunk.snapenhance.core.features.FeatureLoadParams
|
||||
import java.nio.ByteBuffer
|
||||
import kotlin.coroutines.suspendCoroutine
|
||||
|
||||
class Stories : Feature("Stories", loadParams = FeatureLoadParams.ACTIVITY_CREATE_SYNC) {
|
||||
override fun onActivityCreate() {
|
||||
class Stories : Feature("Stories", loadParams = FeatureLoadParams.INIT_SYNC) {
|
||||
override fun init() {
|
||||
val disablePublicStories by context.config.global.disablePublicStories
|
||||
|
||||
context.event.subscribe(NetworkApiRequestEvent::class) { event ->
|
||||
|
@ -50,6 +50,7 @@ class UITweaks : Feature("UITweaks", loadParams = FeatureLoadParams.ACTIVITY_CRE
|
||||
val callButton2 = getId("friend_action_button4", "id")
|
||||
|
||||
val chatNoteRecordButton = getId("chat_note_record_button", "id")
|
||||
val unreadHintButton = getId("unread_hint_button", "id")
|
||||
|
||||
View::class.java.hook("setVisibility", HookStage.BEFORE) { methodParam ->
|
||||
val viewId = (methodParam.thisObject() as View).id
|
||||
@ -145,6 +146,9 @@ class UITweaks : Feature("UITweaks", loadParams = FeatureLoadParams.ACTIVITY_CRE
|
||||
}
|
||||
}
|
||||
}
|
||||
if (viewId == unreadHintButton && hiddenElements.contains("hide_unread_chat_hint")) {
|
||||
event.canceled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user