Skip to content

Commit

Permalink
Fix #3188 (Calculator shows two times in startup)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Jan 25, 2024
1 parent 907e1c9 commit eaa8ded
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ import net.bible.service.sword.SwordDocumentFacade
import org.apache.commons.lang3.StringUtils
import java.util.*


var comingFromStartupActivity = false

/** Called first to show download screen if no documents exist
*
* @author Martin Denham [mjdenham at gmail dot com]
Expand Down Expand Up @@ -417,6 +420,7 @@ open class StartupActivity : CustomTitlebarActivityBase() {
}
}
CommonUtils.initializeAppCoroutine()
comingFromStartupActivity = true
startActivity(handlerIntent)
finish()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import net.bible.android.view.activity.StartupActivity
import net.bible.android.view.activity.comingFromStartupActivity
import net.bible.android.view.activity.discrete.CalculatorActivity
import net.bible.android.view.util.UiUtils.setActionBarColor
import net.bible.android.view.util.locale.LocaleHelper
Expand Down Expand Up @@ -235,8 +236,11 @@ abstract class ActivityBase : AppCompatActivity(), AndBibleActivity {
CurrentActivityHolder.activate(this)
super.onResume()
Log.i(TAG, "onResume wasPaused:$wasPaused returningFromCalculator:$returningFromCalculator")
val fromStartupActivity = comingFromStartupActivity
comingFromStartupActivity = false
if (
this !is CalculatorActivity
&& !fromStartupActivity
&& this !is StartupActivity
&& CommonUtils.showCalculator
&& wasPaused
Expand Down

0 comments on commit eaa8ded

Please sign in to comment.