Skip to content

Commit

Permalink
fix: remove Flashbar successful installation
Browse files Browse the repository at this point in the history
  • Loading branch information
teixeira0x committed Dec 12, 2024
1 parent c7b3573 commit 3a33aab
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ class ApkInstallationSessionCallback(
override fun onCreated(sessionId: Int) {
this.sessionId = sessionId
log.debug("Created package installation session: {}", sessionId)
activity?._binding?.content?.apply {
bottomSheet.setActionText(activity!!.getString(string.msg_installing_apk))
bottomSheet.setActionProgress(0)
}
}

override fun onProgressChanged(sessionId: Int, progress: Float) {
if (activity?.editorViewModel?.isBuildInProgress ?: true) {
// Build in progress does not update bottom sheet action.
return
}

activity?._binding?.content?.apply {
// If the visible child is the SymbolInput the keyboard is visible so it
// is better not to show the action child.
if (
bottomSheet.showingChild() != EditorBottomSheet.CHILD_SYMBOL_INPUT &&
bottomSheet.showingChild() != EditorBottomSheet.CHILD_ACTION
) {
bottomSheet.setActionText(
activity!!.getString(string.msg_installing_apk)
)
bottomSheet.showChild(EditorBottomSheet.CHILD_ACTION)
}
bottomSheet.setActionProgress((progress * 100f).toInt())
Expand All @@ -68,11 +68,9 @@ class ApkInstallationSessionCallback(
}
bottomSheet.setActionProgress(0)

if (success) {
activity?.flashSuccess(string.title_installation_success)
} else activity?.flashError(string.title_installation_failed)

activity?.let {
if (!success) flashError(string.title_installation_failed)

it.installationCallback?.destroy()
it.installationCallback = null
}
Expand Down

0 comments on commit 3a33aab

Please sign in to comment.