@@ -37,24 +37,24 @@ class ApkInstallationSessionCallback(
37
37
override fun onCreated (sessionId : Int ) {
38
38
this .sessionId = sessionId
39
39
log.debug(" Created package installation session: {}" , sessionId)
40
- activity?._binding ?.content?.apply {
41
- bottomSheet.setActionText(activity!! .getString(string.msg_installing_apk))
42
- bottomSheet.setActionProgress(0 )
43
- }
44
40
}
45
41
46
42
override fun onProgressChanged (sessionId : Int , progress : Float ) {
47
43
if (activity?.editorViewModel?.isBuildInProgress ? : true ) {
48
44
// Build in progress does not update bottom sheet action.
49
45
return
50
46
}
47
+
51
48
activity?._binding ?.content?.apply {
52
49
// If the visible child is the SymbolInput the keyboard is visible so it
53
50
// is better not to show the action child.
54
51
if (
55
52
bottomSheet.showingChild() != EditorBottomSheet .CHILD_SYMBOL_INPUT &&
56
53
bottomSheet.showingChild() != EditorBottomSheet .CHILD_ACTION
57
54
) {
55
+ bottomSheet.setActionText(
56
+ activity!! .getString(string.msg_installing_apk)
57
+ )
58
58
bottomSheet.showChild(EditorBottomSheet .CHILD_ACTION )
59
59
}
60
60
bottomSheet.setActionProgress((progress * 100f ).toInt())
@@ -68,11 +68,9 @@ class ApkInstallationSessionCallback(
68
68
}
69
69
bottomSheet.setActionProgress(0 )
70
70
71
- if (success) {
72
- activity?.flashSuccess(string.title_installation_success)
73
- } else activity?.flashError(string.title_installation_failed)
74
-
75
71
activity?.let {
72
+ if (! success) flashError(string.title_installation_failed)
73
+
76
74
it.installationCallback?.destroy()
77
75
it.installationCallback = null
78
76
}
0 commit comments