Commit c9bfcc16 authored by Niklas Fix's avatar Niklas Fix 🎓

fix bug when change ui mode in challenge fragment

parent 36e385c5
......@@ -68,7 +68,11 @@ class MainActivity : BaseActivity(), DashboardContract.View, NextLevelEventHandl
}
}
window.setWindowAnimations(R.style.WindowAnimationFadeInOut)
recreate()
//recreate()
val refresh = Intent(this, MainActivity::class.java)
refresh.putExtra(Constants.KEY_MAINACTIVITY_PAGE, activeFragment)
finish()
startActivity(refresh)
}
constraintlayout_main_header.setOnClickListener {
......@@ -80,11 +84,16 @@ class MainActivity : BaseActivity(), DashboardContract.View, NextLevelEventHandl
}
mNextLevelExploder = ExplosionField.attach2Window(this)
progressbar_mainactivity_lvl.progress = AppUserUtil.getUserProgress(user!!).toInt()
progressbar_mainactivity_lvl.progress = AppUserUtil.getUserProgress(user!!)
fillProfile()
setupBottomNavigation()
navigateToDuelList()
val pageQuantifier = intent.getIntExtra(Constants.KEY_MAINACTIVITY_PAGE, 0)
when(pageQuantifier) {
Constants.DUEL_LIST_FRAGMENT -> navigateToDuelList()
Constants.CHALLENGE_FRAGMENT -> navigateToChallenge()
else -> navigateToDuelList()
}
}
override fun navigateToProfile() {
......
......@@ -34,6 +34,7 @@ class Constants {
const val KEY_POOL = "KEY_POOL"
const val KEY_UNAUTHORIZED = "KEY_UNAUTHORIZED"
const val KEY_DSE_INFO = "DSE_INFO"
const val KEY_MAINACTIVITY_PAGE = "KEY_MAINACTIVITY_PAGE"
// ARG KEYS
const val KEY_OPTION_ANSWER = "OPTION_ANSWER"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment