fix(core): settings gear

This commit is contained in:
rhunk 2024-03-15 19:43:34 +01:00
parent 90faaecd83
commit b06c87c464

View File

@ -8,6 +8,7 @@ import android.widget.ImageView
import me.rhunk.snapenhance.core.ui.menu.AbstractMenu import me.rhunk.snapenhance.core.ui.menu.AbstractMenu
import me.rhunk.snapenhance.core.util.ktx.getDimens import me.rhunk.snapenhance.core.util.ktx.getDimens
import me.rhunk.snapenhance.core.util.ktx.getDrawable import me.rhunk.snapenhance.core.util.ktx.getDrawable
import me.rhunk.snapenhance.core.util.ktx.getId
import me.rhunk.snapenhance.core.util.ktx.getStyledAttributes import me.rhunk.snapenhance.core.util.ktx.getStyledAttributes
@ -21,19 +22,22 @@ class SettingsGearInjector : AbstractMenu() {
view.clipChildren = false view.clipChildren = false
view.addView(FrameLayout(parent.context).apply { view.addView(FrameLayout(parent.context).apply {
layoutParams = FrameLayout.LayoutParams(firstView.layoutParams.width, firstView.layoutParams.height).apply { visibility = View.GONE
y = 0f post {
x = -(ngsHovaHeaderSearchIconBackgroundMarginLeft + firstView.layoutParams.width).toFloat() layoutParams = FrameLayout.LayoutParams(firstView.layoutParams.width, firstView.layoutParams.height).apply {
y = 0f
x = if (parent.findViewById<View>(context.resources.getId("hova_nav_map_icon")) != null) {
parent.resources.displayMetrics.widthPixels - firstView.layoutParams.width - ngsHovaHeaderSearchIconBackgroundMarginLeft * 2 - (firstView.layoutParams.width).toFloat() * 2f
} else {
-(ngsHovaHeaderSearchIconBackgroundMarginLeft + firstView.layoutParams.width).toFloat()
}
}
visibility = View.VISIBLE
} }
isClickable = true isClickable = true
setOnClickListener { setOnClickListener {
/* val intent = Intent().apply {
setClassName(BuildConfig.APPLICATION_ID, "me.rhunk.snapenhance.ui.manager.MainActivity")
putExtra("route", "features")
}
context.startActivity(intent)*/
this@SettingsGearInjector.context.bridgeClient.openSettingsOverlay() this@SettingsGearInjector.context.bridgeClient.openSettingsOverlay()
} }