mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-07-13 17:51:57 +00:00
Fixes #2074
This commit is contained in:
parent
738f6e66f1
commit
13757f5251
1 changed files with 16 additions and 0 deletions
|
|
@ -62,11 +62,23 @@ class ArmoireActivity : BaseActivity() {
|
||||||
|
|
||||||
override fun getLayoutResId(): Int = R.layout.activity_armoire
|
override fun getLayoutResId(): Int = R.layout.activity_armoire
|
||||||
|
|
||||||
|
private var hasUsedExtraArmoire = false
|
||||||
|
|
||||||
override fun getContentView(layoutResId: Int?): View {
|
override fun getContentView(layoutResId: Int?): View {
|
||||||
binding = ActivityArmoireBinding.inflate(layoutInflater)
|
binding = ActivityArmoireBinding.inflate(layoutInflater)
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
|
outState.putBoolean("hasUsedExtraArmoire", hasUsedExtraArmoire)
|
||||||
|
super.onSaveInstanceState(outState)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
|
||||||
|
super.onRestoreInstanceState(savedInstanceState)
|
||||||
|
hasUsedExtraArmoire = savedInstanceState.getBoolean("hasUsedExtraArmoire")
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
|
@ -185,6 +197,10 @@ class ArmoireActivity : BaseActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun giveUserArmoire(): Boolean {
|
private fun giveUserArmoire(): Boolean {
|
||||||
|
if (hasUsedExtraAmoire) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
hasUsedExtraAmoire = true
|
||||||
binding.iconWrapper.post {
|
binding.iconWrapper.post {
|
||||||
binding.iconView.bitmap = null
|
binding.iconView.bitmap = null
|
||||||
Animations.circularHide(binding.iconWrapper)
|
Animations.circularHide(binding.iconWrapper)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue