feat(AlignThreads): also patch channels list actions
This commit is contained in:
parent
455621c25c
commit
0d85c985fb
1 changed files with 14 additions and 3 deletions
|
|
@ -7,10 +7,10 @@ import androidx.core.content.ContextCompat
|
|||
import com.aliucord.Utils
|
||||
import com.aliucord.annotations.AliucordPlugin
|
||||
import com.aliucord.entities.Plugin
|
||||
import com.aliucord.patcher.after
|
||||
import com.aliucord.patcher.component1
|
||||
import com.aliucord.patcher.component2
|
||||
import com.aliucord.patcher.*
|
||||
import com.aliucord.utils.DimenUtils
|
||||
import com.discord.utilities.drawable.DrawableCompat
|
||||
import com.discord.widgets.channels.list.`WidgetChannelsListItemChannelActions$binding$2`
|
||||
import com.discord.widgets.chat.list.actions.`WidgetChatListActions$binding$2`
|
||||
import com.lytefast.flexinput.R
|
||||
|
||||
|
|
@ -27,6 +27,17 @@ class AlignThreads : Plugin() {
|
|||
icon.setBounds(0, 0, size, size)
|
||||
threadTextView.setCompoundDrawables(icon, null, null, null)
|
||||
}
|
||||
|
||||
patcher.after<`WidgetChannelsListItemChannelActions$binding$2`>("invoke", View::class.java)
|
||||
{ (_, view: View) ->
|
||||
val id = Utils.getResId("text_action_thread_browser", "id")
|
||||
val threadTextView = view.findViewById<TextView>(id)
|
||||
val size = DimenUtils.dpToPx(24)
|
||||
val res = DrawableCompat.getThemedDrawableRes(threadTextView.context, R.b.ic_thread)
|
||||
val icon = ContextCompat.getDrawable(threadTextView.context, res)!!
|
||||
icon.setBounds(0, 0, size, size)
|
||||
threadTextView.setCompoundDrawables(icon, null, null, null)
|
||||
}
|
||||
}
|
||||
|
||||
override fun stop(ctx: Context) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue