Made the app menu refresh each time that the user goes back to home automatically

This commit is contained in:
ottoptj 2024-06-10 19:38:20 +03:00
commit cb78628941

View file

@ -373,15 +373,18 @@ class MainActivity : AppCompatActivity(), AppMenuAdapter.OnItemClickListener, Ap
fun backToHome() { fun backToHome() {
closeKeyboard() closeKeyboard()
searchView.setText("")
animations.showHome(binding) animations.showHome(binding)
animations.backgroundOut(this@MainActivity) animations.backgroundOut(this@MainActivity)
val handler = Handler(Looper.getMainLooper()) val handler = Handler(Looper.getMainLooper())
handler.postDelayed({ handler.postDelayed({
binding.menutitle.visibility = View.VISIBLE binding.menutitle.visibility = View.VISIBLE
searchView.setText("")
}, 100) }, 100)
handler.postDelayed({ handler.postDelayed({
recyclerView.scrollToPosition(0) recyclerView.scrollToPosition(0)
CoroutineScope(Dispatchers.Default).launch {
refreshAppMenu()
}
}, 150) }, 150)
} }