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
d462873e
Commit
d462873e
authored
Oct 06, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent UI loop on low memory device
Fix #3215, close #3216
parent
fc19b502
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
InstallFragment.kt
...n/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt
+20
-0
InstallViewModel.kt
.../java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt
+6
-3
No files found.
app/src/main/java/com/topjohnwu/magisk/ui/install/InstallFragment.kt
View file @
d462873e
package
com.topjohnwu.magisk.ui.install
package
com.topjohnwu.magisk.ui.install
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
androidx.lifecycle.viewModelScope
import
androidx.lifecycle.viewModelScope
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.arch.BaseUIFragment
import
com.topjohnwu.magisk.arch.BaseUIFragment
...
@@ -22,4 +26,20 @@ class InstallFragment : BaseUIFragment<InstallViewModel, FragmentInstallMd2Bindi
...
@@ -22,4 +26,20 @@ class InstallFragment : BaseUIFragment<InstallViewModel, FragmentInstallMd2Bindi
BaseDownloader
.
observeProgress
(
this
,
viewModel
::
onProgressUpdate
)
BaseDownloader
.
observeProgress
(
this
,
viewModel
::
onProgressUpdate
)
}
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
?
{
viewModel
.
_method
=
savedInstanceState
?.
getInt
(
KEY_CURRENT_METHOD
,
-
1
)
?:
-
1
return
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
)
}
override
fun
onSaveInstanceState
(
outState
:
Bundle
)
{
outState
.
putInt
(
KEY_CURRENT_METHOD
,
viewModel
.
method
)
}
companion
object
{
private
const
val
KEY_CURRENT_METHOD
=
"current_method"
}
}
}
app/src/main/java/com/topjohnwu/magisk/ui/install/InstallViewModel.kt
View file @
d462873e
...
@@ -31,13 +31,16 @@ class InstallViewModel(
...
@@ -31,13 +31,16 @@ class InstallViewModel(
var
step
=
if
(
skipOptions
)
1
else
0
var
step
=
if
(
skipOptions
)
1
else
0
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
step
)
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
step
)
var
_method
=
-
1
@get
:
Bindable
@get
:
Bindable
var
method
=
-
1
var
method
set
(
value
)
=
set
(
value
,
field
,
{
field
=
it
},
BR
.
method
)
{
get
()
=
_method
set
(
value
)
=
set
(
value
,
_method
,
{
_method
=
it
},
BR
.
method
)
{
when
(
it
)
{
when
(
it
)
{
R
.
id
.
method_patch
->
{
R
.
id
.
method_patch
->
{
MagiskInstallFileEvent
{
code
,
intent
->
MagiskInstallFileEvent
{
code
,
intent
->
if
(
code
==
Activity
.
RESULT_OK
)
if
(
code
==
Activity
.
RESULT_OK
)
data
=
intent
?.
data
data
=
intent
?.
data
}.
publish
()
}.
publish
()
}
}
...
...
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