feat(core/mark_as_seen): close menu on click
- sort rule features
This commit is contained in:
@@ -31,8 +31,8 @@ enum class MessagingRuleType(
|
||||
val listMode: Boolean,
|
||||
val showInFriendMenu: Boolean = true
|
||||
) {
|
||||
AUTO_DOWNLOAD("auto_download", true),
|
||||
STEALTH("stealth", true),
|
||||
AUTO_DOWNLOAD("auto_download", true),
|
||||
AUTO_SAVE("auto_save", true),
|
||||
HIDE_FRIEND_FEED("hide_friend_feed", false, showInFriendMenu = false),
|
||||
E2E_ENCRYPTION("e2e_encryption", false),
|
||||
|
||||
@@ -58,7 +58,7 @@ class FeatureManager(
|
||||
return features.find { it::class == featureClass } as? T
|
||||
}
|
||||
|
||||
fun getRuleFeatures() = features.filterIsInstance<MessagingRuleFeature>()
|
||||
fun getRuleFeatures() = features.filterIsInstance<MessagingRuleFeature>().sortedBy { it.ruleType.ordinal }
|
||||
|
||||
override fun init() {
|
||||
register(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package me.rhunk.snapenhance.core.ui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
@@ -70,6 +71,10 @@ fun View.triggerCloseTouchEvent() {
|
||||
}
|
||||
}
|
||||
|
||||
fun Activity.triggerRootCloseTouchEvent() {
|
||||
findViewById<View>(android.R.id.content).triggerCloseTouchEvent()
|
||||
}
|
||||
|
||||
fun ViewGroup.children(): List<View> {
|
||||
val children = mutableListOf<View>()
|
||||
for (i in 0 until childCount) {
|
||||
|
||||
@@ -28,6 +28,7 @@ import me.rhunk.snapenhance.core.features.impl.spying.MessageLogger
|
||||
import me.rhunk.snapenhance.core.ui.ViewAppearanceHelper
|
||||
import me.rhunk.snapenhance.core.ui.applyTheme
|
||||
import me.rhunk.snapenhance.core.ui.menu.AbstractMenu
|
||||
import me.rhunk.snapenhance.core.ui.triggerRootCloseTouchEvent
|
||||
import java.net.HttpURLConnection
|
||||
import java.net.URL
|
||||
import java.text.DateFormat
|
||||
@@ -305,7 +306,10 @@ class FriendFeedInfoMenu : AbstractMenu() {
|
||||
viewConsumer(Button(view.context).apply {
|
||||
text = modContext.translation["friend_menu_option.mark_as_seen"]
|
||||
applyTheme(view.width, hasRadius = true)
|
||||
setOnClickListener { markAsSeen(conversationId) }
|
||||
setOnClickListener {
|
||||
this@FriendFeedInfoMenu.context.mainActivity?.triggerRootCloseTouchEvent()
|
||||
markAsSeen(conversationId)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user