Skip to content

Commit

Permalink
feat(core/ui_tweaks): hide unread chat hint
Browse files Browse the repository at this point in the history
  • Loading branch information
rhunk committed Dec 4, 2023
1 parent c952693 commit d762040
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion common/src/main/assets/lang/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -145,6 +146,9 @@ class UITweaks : Feature("UITweaks", loadParams = FeatureLoadParams.ACTIVITY_CRE
}
}
}
if (viewId == unreadHintButton && hiddenElements.contains("hide_unread_chat_hint")) {
event.canceled = true
}
}
}
}

0 comments on commit d762040

Please sign in to comment.