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
7cf3da1b
Commit
7cf3da1b
authored
Jul 12, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update implementation to use new methods
parent
45fabf8e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
45 deletions
+18
-45
LogRvItem.kt
...a/com/topjohnwu/magisk/model/entity/recycler/LogRvItem.kt
+5
-12
ModuleRvItem.kt
...om/topjohnwu/magisk/model/entity/recycler/ModuleRvItem.kt
+12
-31
ModuleViewModel.kt
...in/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt
+1
-2
No files found.
app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/LogRvItem.kt
View file @
7cf3da1b
...
...
@@ -7,24 +7,17 @@ import com.topjohnwu.magisk.databinding.ObservableItem
import
com.topjohnwu.magisk.ktx.timeDateFormat
import
com.topjohnwu.magisk.ktx.toTime
import
com.topjohnwu.magisk.model.entity.MagiskLog
import
com.topjohnwu.magisk.utils.observable
class
LogItem
(
val
item
:
MagiskLog
)
:
ObservableItem
<
LogItem
>()
{
override
val
layoutRes
=
R
.
layout
.
item_log_access_md2
val
date
=
item
.
time
.
toTime
(
timeDateFormat
)
var
isTop
=
false
@Bindable
get
set
(
value
)
{
field
=
value
notifyPropertyChanged
(
BR
.
top
)
}
var
isBottom
=
false
@Bindable
get
set
(
value
)
{
field
=
value
notifyPropertyChanged
(
BR
.
bottom
)
}
@get
:
Bindable
var
isTop
by
observable
(
false
,
BR
.
top
)
@get
:
Bindable
var
isBottom
by
observable
(
false
,
BR
.
bottom
)
override
fun
itemSameAs
(
other
:
LogItem
)
=
item
.
appName
==
other
.
item
.
appName
...
...
app/src/main/java/com/topjohnwu/magisk/model/entity/recycler/ModuleRvItem.kt
View file @
7cf3da1b
...
...
@@ -2,7 +2,6 @@ package com.topjohnwu.magisk.model.entity.recycler
import
androidx.databinding.Bindable
import
androidx.databinding.Observable
import
androidx.databinding.ObservableField
import
androidx.databinding.ViewDataBinding
import
androidx.recyclerview.widget.StaggeredGridLayoutManager
import
com.topjohnwu.magisk.BR
...
...
@@ -12,6 +11,7 @@ import com.topjohnwu.magisk.core.model.module.Repo
import
com.topjohnwu.magisk.databinding.ComparableRvItem
import
com.topjohnwu.magisk.databinding.ObservableItem
import
com.topjohnwu.magisk.ui.module.ModuleViewModel
import
com.topjohnwu.magisk.utils.observable
object
InstallModule
:
ComparableRvItem
<
InstallModule
>()
{
override
val
layoutRes
=
R
.
layout
.
item_module_download
...
...
@@ -33,24 +33,12 @@ class SectionTitle(
)
:
ObservableItem
<
SectionTitle
>()
{
override
val
layoutRes
=
R
.
layout
.
item_section_md2
var
button
=
_button
@Bindable
get
set
(
value
)
{
field
=
value
notifyPropertyChanged
(
BR
.
button
)
}
var
icon
=
_icon
@Bindable
get
set
(
value
)
{
field
=
value
notifyPropertyChanged
(
BR
.
icon
)
}
var
hasButton
=
button
!=
0
||
icon
!=
0
@Bindable
get
set
(
value
)
{
field
=
value
notifyPropertyChanged
(
BR
.
hasButton
)
}
@get
:
Bindable
var
button
by
observable
(
_button
,
BR
.
button
)
@get
:
Bindable
var
icon
by
observable
(
_icon
,
BR
.
icon
)
@get
:
Bindable
var
hasButton
by
observable
(
_button
!=
0
&&
_icon
!=
0
,
BR
.
hasButton
)
override
fun
onBindingBound
(
binding
:
ViewDataBinding
)
{
super
.
onBindingBound
(
binding
)
...
...
@@ -65,13 +53,10 @@ class SectionTitle(
sealed
class
RepoItem
(
val
item
:
Repo
)
:
ObservableItem
<
RepoItem
>()
{
override
val
layoutRes
:
Int
=
R
.
layout
.
item_repo_md2
val
progress
=
ObservableField
(
0
)
var
isUpdate
=
false
@Bindable
get
protected
set
(
value
)
{
field
=
value
notifyPropertyChanged
(
BR
.
update
)
}
@get
:
Bindable
var
progress
by
observable
(
0
,
BR
.
progress
)
@get
:
Bindable
var
isUpdate
by
observable
(
false
,
BR
.
update
)
override
fun
contentSameAs
(
other
:
RepoItem
):
Boolean
=
item
==
other
.
item
override
fun
itemSameAs
(
other
:
RepoItem
):
Boolean
=
item
.
id
==
other
.
item
.
id
...
...
@@ -90,11 +75,7 @@ class ModuleItem(val item: Module) : ObservableItem<ModuleItem>(), Observable {
override
val
layoutRes
=
R
.
layout
.
item_module_md2
@get
:
Bindable
var
repo
:
Repo
?
=
null
set
(
value
)
{
field
=
value
notifyPropertyChanged
(
BR
.
repo
)
}
var
repo
:
Repo
?
by
observable
(
null
,
BR
.
repo
)
@get
:
Bindable
var
isEnabled
...
...
app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt
View file @
7cf3da1b
...
...
@@ -15,7 +15,6 @@ import com.topjohnwu.magisk.data.database.RepoByUpdatedDao
import
com.topjohnwu.magisk.databinding.ComparableRvItem
import
com.topjohnwu.magisk.ktx.addOnListChangedCallback
import
com.topjohnwu.magisk.ktx.reboot
import
com.topjohnwu.magisk.ktx.value
import
com.topjohnwu.magisk.model.entity.internal.DownloadSubject
import
com.topjohnwu.magisk.model.entity.recycler.*
import
com.topjohnwu.magisk.model.events.InstallExternalModuleEvent
...
...
@@ -276,7 +275,7 @@ class ModuleViewModel(
itemsRemote
.
filter
(
predicate
)
+
itemsSearch
.
filter
(
predicate
)
}
items
.
forEach
{
it
.
progress
.
value
=
progress
}
items
.
forEach
{
it
.
progress
=
progress
}
}
// ---
...
...
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