mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-04-29 22:24:35 +02:00
fix(ui): debug chat context menu
Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
parent
f9d1c9ea33
commit
d217e2e86d
@ -1,10 +1,10 @@
|
||||
package me.rhunk.snapenhance.core.ui.menu
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.LinearLayout
|
||||
import me.rhunk.snapenhance.core.event.events.impl.AddViewEvent
|
||||
import me.rhunk.snapenhance.core.features.Feature
|
||||
import me.rhunk.snapenhance.core.features.impl.COFOverride
|
||||
@ -58,13 +58,17 @@ class MenuViewInjector : Feature("MenuViewInjector") {
|
||||
val viewGroup: ViewGroup = event.parent
|
||||
val childView: View = event.view
|
||||
|
||||
if (viewGroup !is LinearLayout && childView.id == chatActionMenu && context.isDeveloper) {
|
||||
event.view = LinearLayout(childView.context).apply {
|
||||
orientation = LinearLayout.VERTICAL
|
||||
addView(
|
||||
(menuMap[NewChatActionMenu::class]!! as NewChatActionMenu).createDebugInfoView(childView.context)
|
||||
)
|
||||
addView(event.view)
|
||||
if (childView.javaClass.name.endsWith("ActionMenuChatItemContainer") && context.isDeveloper) {
|
||||
childView.post {
|
||||
(event.parent.parent as ViewGroup).addView(
|
||||
(menuMap[NewChatActionMenu::class] as NewChatActionMenu).createDebugInfoView(context.mainActivity!!).apply {
|
||||
layoutParams = FrameLayout.LayoutParams(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
).apply {
|
||||
gravity = Gravity.TOP or Gravity.START
|
||||
}
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user