Skip to content

Commit

Permalink
Fix crash caused by clicking menu when loading
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Apr 11, 2020
1 parent d97ad75 commit 67c2b44
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class MainActivity : AppCompatActivity(),
private val core by lazy { CelestiaAppCore.shared() }
private var currentSelection: CelestiaSelection? = null

private var readyForUriInput = false
private var readyForInteraction = false
private var scriptOrURLPath: String? = null

@SuppressLint("CheckResult")
Expand Down Expand Up @@ -164,7 +164,7 @@ class MainActivity : AppCompatActivity(),
showWelcomeIfNeeded()

// open url/script if present
readyForUriInput = true
readyForInteraction = true
runScriptOrOpenURLIfNeeded()
}
}
Expand Down Expand Up @@ -269,13 +269,13 @@ class MainActivity : AppCompatActivity(),

private fun requestRunScript(path: String) {
scriptOrURLPath = path
if (readyForUriInput)
if (readyForInteraction)
runScriptOrOpenURLIfNeeded()
}

private fun requestOpenURL(url: String) {
scriptOrURLPath = url
if (readyForUriInput)
if (readyForInteraction)
runScriptOrOpenURLIfNeeded()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class LoadingFragment : Fragment(), AppStatusReporter.Listener {
companion object {
private const val TAG = "LoadingFragment"

public fun newInstance() = LoadingFragment()
fun newInstance() = LoadingFragment()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package space.celestia.mobilecelestia.utils

import space.celestia.mobilecelestia.core.CelestiaAppCore

fun CelestiaString(key: String, comment: String): String {
@Suppress("FunctionName")
fun CelestiaString(key: String, @Suppress("UNUSED_PARAMETER") comment: String): String {
return CelestiaAppCore.getLocalizedString(key)
}
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
android:id="@+id/loading_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
style="@style/Container"/>

</androidx.constraintlayout.widget.ConstraintLayout>

0 comments on commit 67c2b44

Please sign in to comment.