Fixed uninstall popup causing a return to home

This commit is contained in:
ottoptj 2024-08-31 00:40:13 +03:00
commit 478524c49d
2 changed files with 7 additions and 2 deletions

View file

@ -105,6 +105,7 @@ class AppActionMenu(private val activity: MainActivity, private val binding: Act
intent.data = Uri.parse("package:${appInfo.packageName}")
intent.putExtra(Intent.EXTRA_USER, userHandle)
activity.startActivity(intent)
activity.returnAllowed = false
}
private fun renameApp(textView: TextView, editLayout: LinearLayout, actionMenu: View, appActivity: LauncherActivityInfo?, appInfo: ApplicationInfo, userHandle: UserHandle, workProfile: Int) {

View file

@ -100,6 +100,8 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
private lateinit var gestureDetector: GestureDetector
private lateinit var shortcutGestureDetector: GestureDetector
var returnAllowed = true
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
@ -721,13 +723,15 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh
super.onStart()
// Keyboard is sometimes open when going back to the app, so close it.
closeKeyboard()
}
@SuppressLint("NotifyDataSetChanged")
override fun onResume() {
super.onResume()
backToHome(0)
if (returnAllowed) {
backToHome(0)
}
returnAllowed = true
adapter?.notifyDataSetChanged()
}