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
40f971d1
Commit
40f971d1
authored
Feb 16, 2020
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add entrypoint for testing
Should do it with proper unit test, but duh
parent
ce7cb1ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
HomeViewModel.kt
...c/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
+9
-0
fragment_home_md2.xml
app/src/main/res/layout/fragment_home_md2.xml
+11
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/ui/home/HomeViewModel.kt
View file @
40f971d1
...
...
@@ -6,6 +6,7 @@ import com.topjohnwu.magisk.BuildConfig
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.core.Config
import
com.topjohnwu.magisk.core.Info
import
com.topjohnwu.magisk.core.base.BaseActivity
import
com.topjohnwu.magisk.core.download.RemoteFileService
import
com.topjohnwu.magisk.core.model.MagiskJson
import
com.topjohnwu.magisk.core.model.ManagerJson
...
...
@@ -16,7 +17,9 @@ import com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Magisk
import
com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Manager
import
com.topjohnwu.magisk.model.entity.recycler.DeveloperItem
import
com.topjohnwu.magisk.model.entity.recycler.HomeItem
import
com.topjohnwu.magisk.model.events.ActivityExecutor
import
com.topjohnwu.magisk.model.events.OpenInappLinkEvent
import
com.topjohnwu.magisk.model.events.ViewEvent
import
com.topjohnwu.magisk.model.events.dialog.EnvFixDialog
import
com.topjohnwu.magisk.model.events.dialog.ManagerInstallDialog
import
com.topjohnwu.magisk.model.events.dialog.UninstallDialog
...
...
@@ -97,6 +100,12 @@ class HomeViewModel(
ensureEnv
()
}
fun
onTestPressed
()
=
object
:
ViewEvent
(),
ActivityExecutor
{
override
fun
invoke
(
activity
:
BaseActivity
)
{
/* Entry point to trigger test events within the app */
}
}.
publish
()
fun
onLinkPressed
(
link
:
String
)
=
OpenInappLinkEvent
(
link
).
publish
()
fun
onDeletePressed
()
=
UninstallDialog
().
publish
()
...
...
app/src/main/res/layout/fragment_home_md2.xml
View file @
40f971d1
...
...
@@ -27,6 +27,17 @@
android:orientation=
"vertical"
android:paddingTop=
"@dimen/l1"
>
<com.google.android.material.button.MaterialButton
android:layout_gravity=
"center"
style=
"@style/WidgetFoundation.Button"
gone=
"@{true}"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:onClick=
"@{() -> viewModel.onTestPressed()}"
android:text=
"TEST"
android:textAllCaps=
"false"
tools:visibility=
"gone"
/>
<com.google.android.material.card.MaterialCardView
style=
"@style/WidgetFoundation.Card.Primary"
goneUnless=
"@{viewModel.noticeVisible}"
...
...
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