Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
1ad7a6fe
Commit
1ad7a6fe
authored
Oct 14, 2020
by
vvb2060
Committed by
topjohnwu
Oct 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update activity display when download fails
parent
4e0a3f5e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
BaseDownloader.kt
...java/com/topjohnwu/magisk/core/download/BaseDownloader.kt
+1
-1
InstallViewModel.kt
.../java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt
+2
-0
fragment_install_md2.xml
app/src/main/res/layout/fragment_install_md2.xml
+17
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/core/download/BaseDownloader.kt
View file @
1ad7a6fe
...
@@ -117,7 +117,7 @@ abstract class BaseDownloader : BaseService(), KoinComponent {
...
@@ -117,7 +117,7 @@ abstract class BaseDownloader : BaseService(), KoinComponent {
fun
Subject
.
notifyID
()
=
hashCode
()
fun
Subject
.
notifyID
()
=
hashCode
()
private
fun
notifyFail
(
subject
:
Subject
)
=
lastNotify
(
subject
.
notifyID
())
{
private
fun
notifyFail
(
subject
:
Subject
)
=
lastNotify
(
subject
.
notifyID
())
{
broadcast
(-
1
f
,
subject
)
broadcast
(-
2
f
,
subject
)
it
.
setContentText
(
getString
(
R
.
string
.
download_file_error
))
it
.
setContentText
(
getString
(
R
.
string
.
download_file_error
))
.
setSmallIcon
(
android
.
R
.
drawable
.
stat_notify_error
)
.
setSmallIcon
(
android
.
R
.
drawable
.
stat_notify_error
)
.
setOngoing
(
false
)
.
setOngoing
(
false
)
...
...
app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt
View file @
1ad7a6fe
...
@@ -75,6 +75,8 @@ class InstallViewModel(
...
@@ -75,6 +75,8 @@ class InstallViewModel(
this
.
progress
=
progress
.
times
(
100
).
roundToInt
()
this
.
progress
=
progress
.
times
(
100
).
roundToInt
()
if
(
this
.
progress
>=
100
)
{
if
(
this
.
progress
>=
100
)
{
state
=
State
.
LOADED
state
=
State
.
LOADED
}
else
if
(
this
.
progress
<
-
150
)
{
state
=
State
.
LOADING_FAILED
}
}
}
}
...
...
app/src/main/res/layout/fragment_install_md2.xml
View file @
1ad7a6fe
...
@@ -306,6 +306,23 @@
...
@@ -306,6 +306,23 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
goneUnless=
"@{viewModel.loadFailed}"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:text=
"@string/download_file_error"
android:textAppearance=
"@style/AppearanceFoundation.Title"
/>
</LinearLayout>
</FrameLayout>
</FrameLayout>
</androidx.core.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment