mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-13 05:37:48 +02:00
fix(startup_page_override): camera in background
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
package me.rhunk.snapenhance.features.impl.ui
|
package me.rhunk.snapenhance.features.impl.ui
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.os.Handler
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
@ -23,17 +24,17 @@ class StartupPageOverride : Feature("StartupPageOverride", loadParams = FeatureL
|
|||||||
ngs_search_icon_container
|
ngs_search_icon_container
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
private fun clickNgsIcon() {
|
||||||
|
Handler(context.androidContext.mainLooper).postDelayed({
|
||||||
|
ngsIcon?.callOnClick()
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onActivityCreate() {
|
override fun onActivityCreate() {
|
||||||
val ngsIconName = context.config.userInterface.startupTab.getNullable() ?: return
|
val ngsIconName = context.config.userInterface.startupTab.getNullable() ?: return
|
||||||
|
|
||||||
context.androidContext.classLoader.loadClass("com.snap.mushroom.MainActivity").apply {
|
context.androidContext.classLoader.loadClass("com.snap.mushroom.MainActivity").apply {
|
||||||
hook("onPostCreate", HookStage.AFTER) {
|
hook("onResume", HookStage.AFTER) { clickNgsIcon() }
|
||||||
ngsIcon?.callOnClick()
|
|
||||||
}
|
|
||||||
|
|
||||||
hook("onResume", HookStage.AFTER) {
|
|
||||||
ngsIcon?.callOnClick()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val ngsIconId = context.androidContext.resources.getIdentifier(ngsIconName, "id", Constants.SNAPCHAT_PACKAGE_NAME)
|
val ngsIconId = context.androidContext.resources.getIdentifier(ngsIconName, "id", Constants.SNAPCHAT_PACKAGE_NAME)
|
||||||
|
Reference in New Issue
Block a user