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
a7f4496d
Commit
a7f4496d
authored
Nov 16, 2019
by
Viktor De Pasquale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added info dialog for repos
parent
f972f02f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
9 deletions
+38
-9
ViewEvents.kt
...main/java/com/topjohnwu/magisk/model/events/ViewEvents.kt
+7
-1
ModuleViewModel.kt
...a/com/topjohnwu/magisk/redesign/module/ModuleViewModel.kt
+2
-0
ic_info.xml
app/src/main/res/drawable/ic_info.xml
+10
-0
item_repo_md2.xml
app/src/main/res/layout/item_repo_md2.xml
+19
-8
No files found.
app/src/main/java/com/topjohnwu/magisk/model/events/ViewEvents.kt
View file @
a7f4496d
...
@@ -20,6 +20,7 @@ import com.topjohnwu.magisk.model.permissions.PermissionRequestBuilder
...
@@ -20,6 +20,7 @@ import com.topjohnwu.magisk.model.permissions.PermissionRequestBuilder
import
com.topjohnwu.magisk.utils.RxBus
import
com.topjohnwu.magisk.utils.RxBus
import
com.topjohnwu.magisk.utils.SafetyNetHelper
import
com.topjohnwu.magisk.utils.SafetyNetHelper
import
com.topjohnwu.magisk.view.MagiskDialog
import
com.topjohnwu.magisk.view.MagiskDialog
import
com.topjohnwu.magisk.view.MarkDownWindow
import
com.topjohnwu.superuser.Shell
import
com.topjohnwu.superuser.Shell
import
dalvik.system.DexFile
import
dalvik.system.DexFile
import
io.reactivex.Completable
import
io.reactivex.Completable
...
@@ -140,7 +141,12 @@ class ViewActionEvent(val action: Activity.() -> Unit) : ViewEvent(), ActivityEx
...
@@ -140,7 +141,12 @@ class ViewActionEvent(val action: Activity.() -> Unit) : ViewEvent(), ActivityEx
class
OpenFilePickerEvent
:
ViewEvent
()
class
OpenFilePickerEvent
:
ViewEvent
()
class
OpenChangelogEvent
(
val
item
:
Repo
)
:
ViewEvent
()
class
OpenChangelogEvent
(
val
item
:
Repo
)
:
ViewEvent
(),
ContextExecutor
{
override
fun
invoke
(
context
:
Context
)
{
MarkDownWindow
.
show
(
context
,
null
,
item
.
readme
)
}
}
class
InstallModuleEvent
(
val
item
:
Repo
)
:
ViewEvent
()
class
InstallModuleEvent
(
val
item
:
Repo
)
:
ViewEvent
()
class
PageChangedEvent
:
ViewEvent
()
class
PageChangedEvent
:
ViewEvent
()
...
...
app/src/main/java/com/topjohnwu/magisk/redesign/module/ModuleViewModel.kt
View file @
a7f4496d
...
@@ -20,6 +20,7 @@ import com.topjohnwu.magisk.model.entity.recycler.ModuleItem
...
@@ -20,6 +20,7 @@ import com.topjohnwu.magisk.model.entity.recycler.ModuleItem
import
com.topjohnwu.magisk.model.entity.recycler.RepoItem
import
com.topjohnwu.magisk.model.entity.recycler.RepoItem
import
com.topjohnwu.magisk.model.entity.recycler.SectionTitle
import
com.topjohnwu.magisk.model.entity.recycler.SectionTitle
import
com.topjohnwu.magisk.model.events.InstallExternalModuleEvent
import
com.topjohnwu.magisk.model.events.InstallExternalModuleEvent
import
com.topjohnwu.magisk.model.events.OpenChangelogEvent
import
com.topjohnwu.magisk.model.events.dialog.ModuleInstallDialog
import
com.topjohnwu.magisk.model.events.dialog.ModuleInstallDialog
import
com.topjohnwu.magisk.redesign.compat.CompatViewModel
import
com.topjohnwu.magisk.redesign.compat.CompatViewModel
import
com.topjohnwu.magisk.redesign.compat.Queryable
import
com.topjohnwu.magisk.redesign.compat.Queryable
...
@@ -252,6 +253,7 @@ class ModuleViewModel(
...
@@ -252,6 +253,7 @@ class ModuleViewModel(
}
}
fun
installPressed
()
=
InstallExternalModuleEvent
().
publish
()
fun
installPressed
()
=
InstallExternalModuleEvent
().
publish
()
fun
infoPressed
(
item
:
RepoItem
)
=
OpenChangelogEvent
(
item
.
item
).
publish
()
// ---
// ---
...
...
app/src/main/res/drawable/ic_info.xml
0 → 100644
View file @
a7f4496d
<?xml version="1.0" encoding="utf-8"?>
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24"
android:viewportHeight=
"24"
>
<path
android:fillColor=
"?colorOnSurface"
android:pathData=
"M21 11.1V8C21 6.9 20.1 6 19 6H11L9 4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H10.2C11.4 21.8 13.6 23 16 23C19.9 23 23 19.9 23 16C23 14.1 22.2 12.4 21 11.1M9.3 18H3V8H19V9.7C18.1 9.2 17.1 9 16 9C12.1 9 9 12.1 9 16C9 16.7 9.1 17.4 9.3 18M16 21C13.2 21 11 18.8 11 16S13.2 11 16 11 21 13.2 21 16 18.8 21 16 21M17 14H15V12H17V14M17 20H15V15H17V20Z"
/>
</vector>
\ No newline at end of file
app/src/main/res/layout/item_repo_md2.xml
View file @
a7f4496d
...
@@ -46,12 +46,10 @@
...
@@ -46,12 +46,10 @@
android:id=
"@+id/module_version_author"
android:id=
"@+id/module_version_author"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginEnd=
"@dimen/l1"
android:text=
"@{@string/module_version_author(item.item.version ?? `?`, item.item.author ?? `?`)}"
android:text=
"@{@string/module_version_author(item.item.version ?? `?`, item.item.author ?? `?`)}"
android:textAppearance=
"?appearanceTextCaptionVariant"
android:textAppearance=
"?appearanceTextCaptionVariant"
app:layout_constraintEnd_toEndOf=
"
parent
"
app:layout_constraintEnd_toEndOf=
"
@+id/module_title
"
app:layout_constraintStart_toStartOf=
"
parent
"
app:layout_constraintStart_toStartOf=
"
@+id/module_title
"
app:layout_constraintTop_toBottomOf=
"@+id/module_title"
app:layout_constraintTop_toBottomOf=
"@+id/module_title"
tools:text=
"v1 by topjohnwu"
/>
tools:text=
"v1 by topjohnwu"
/>
...
@@ -81,20 +79,33 @@
...
@@ -81,20 +79,33 @@
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginStart=
"@dimen/l1"
android:layout_marginEnd=
"@dimen/l1"
android:text=
"@{item.item.lastUpdateString}"
android:text=
"@{@string/updated_on(item.item.lastUpdateString)}"
android:textAppearance=
"?appearanceTextCaptionVariant"
android:textAppearance=
"?appearanceTextCaptionVariant"
android:textSize=
"11sp"
android:textSize=
"11sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/module_
download
"
app:layout_constraintEnd_toStartOf=
"@+id/module_
info
"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/module_divider"
app:layout_constraintTop_toBottomOf=
"@+id/module_divider"
tools:ignore=
"SmallSp"
tools:ignore=
"SmallSp"
tools:text=
"@string/updated_on"
/>
tools:text=
"@tools:sample/date/ddmmyy"
/>
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/module_info"
style=
"?styleIconNormal"
android:layout_width=
"wrap_content"
android:alpha=
".5"
android:onClick=
"@{() -> viewModel.infoPressed(item)}"
android:paddingEnd=
"@dimen/l_50"
app:layout_constraintBottom_toBottomOf=
"@+id/module_download"
app:layout_constraintEnd_toStartOf=
"@+id/module_download"
app:layout_constraintTop_toTopOf=
"@+id/module_download"
app:srcCompat=
"@drawable/ic_info"
/>
<androidx.appcompat.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:id=
"@+id/module_download"
android:id=
"@+id/module_download"
android:layout_width=
"wrap_content"
style=
"?styleIconPrimary"
style=
"?styleIconPrimary"
android:paddingStart=
"@dimen/l_50"
isEnabled=
"@{!(item.progress == -100 || (item.progress > 0 && item.progress < 100))}"
isEnabled=
"@{!(item.progress == -100 || (item.progress > 0 && item.progress < 100))}"
android:contentDescription=
"@string/download"
android:contentDescription=
"@string/download"
android:onClick=
"@{() -> viewModel.download(item)}"
android:onClick=
"@{() -> viewModel.download(item)}"
...
...
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