mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-04-30 06:34:29 +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
|
package me.rhunk.snapenhance.core.ui.menu
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.view.Gravity
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import android.widget.LinearLayout
|
|
||||||
import me.rhunk.snapenhance.core.event.events.impl.AddViewEvent
|
import me.rhunk.snapenhance.core.event.events.impl.AddViewEvent
|
||||||
import me.rhunk.snapenhance.core.features.Feature
|
import me.rhunk.snapenhance.core.features.Feature
|
||||||
import me.rhunk.snapenhance.core.features.impl.COFOverride
|
import me.rhunk.snapenhance.core.features.impl.COFOverride
|
||||||
@ -58,13 +58,17 @@ class MenuViewInjector : Feature("MenuViewInjector") {
|
|||||||
val viewGroup: ViewGroup = event.parent
|
val viewGroup: ViewGroup = event.parent
|
||||||
val childView: View = event.view
|
val childView: View = event.view
|
||||||
|
|
||||||
if (viewGroup !is LinearLayout && childView.id == chatActionMenu && context.isDeveloper) {
|
if (childView.javaClass.name.endsWith("ActionMenuChatItemContainer") && context.isDeveloper) {
|
||||||
event.view = LinearLayout(childView.context).apply {
|
childView.post {
|
||||||
orientation = LinearLayout.VERTICAL
|
(event.parent.parent as ViewGroup).addView(
|
||||||
addView(
|
(menuMap[NewChatActionMenu::class] as NewChatActionMenu).createDebugInfoView(context.mainActivity!!).apply {
|
||||||
(menuMap[NewChatActionMenu::class]!! as NewChatActionMenu).createDebugInfoView(childView.context)
|
layoutParams = FrameLayout.LayoutParams(
|
||||||
)
|
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
addView(event.view)
|
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||||
|
).apply {
|
||||||
|
gravity = Gravity.TOP or Gravity.START
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user