Commit 40f971d1 authored by topjohnwu's avatar topjohnwu

Add entrypoint for testing

Should do it with proper unit test, but duh
parent ce7cb1ee
...@@ -6,6 +6,7 @@ import com.topjohnwu.magisk.BuildConfig ...@@ -6,6 +6,7 @@ import com.topjohnwu.magisk.BuildConfig
import com.topjohnwu.magisk.R import com.topjohnwu.magisk.R
import com.topjohnwu.magisk.core.Config import com.topjohnwu.magisk.core.Config
import com.topjohnwu.magisk.core.Info 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.download.RemoteFileService
import com.topjohnwu.magisk.core.model.MagiskJson import com.topjohnwu.magisk.core.model.MagiskJson
import com.topjohnwu.magisk.core.model.ManagerJson import com.topjohnwu.magisk.core.model.ManagerJson
...@@ -16,7 +17,9 @@ import com.topjohnwu.magisk.model.entity.internal.DownloadSubject.Magisk ...@@ -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.internal.DownloadSubject.Manager
import com.topjohnwu.magisk.model.entity.recycler.DeveloperItem import com.topjohnwu.magisk.model.entity.recycler.DeveloperItem
import com.topjohnwu.magisk.model.entity.recycler.HomeItem 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.OpenInappLinkEvent
import com.topjohnwu.magisk.model.events.ViewEvent
import com.topjohnwu.magisk.model.events.dialog.EnvFixDialog import com.topjohnwu.magisk.model.events.dialog.EnvFixDialog
import com.topjohnwu.magisk.model.events.dialog.ManagerInstallDialog import com.topjohnwu.magisk.model.events.dialog.ManagerInstallDialog
import com.topjohnwu.magisk.model.events.dialog.UninstallDialog import com.topjohnwu.magisk.model.events.dialog.UninstallDialog
...@@ -97,6 +100,12 @@ class HomeViewModel( ...@@ -97,6 +100,12 @@ class HomeViewModel(
ensureEnv() 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 onLinkPressed(link: String) = OpenInappLinkEvent(link).publish()
fun onDeletePressed() = UninstallDialog().publish() fun onDeletePressed() = UninstallDialog().publish()
......
...@@ -27,6 +27,17 @@ ...@@ -27,6 +27,17 @@
android:orientation="vertical" android:orientation="vertical"
android:paddingTop="@dimen/l1"> 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 <com.google.android.material.card.MaterialCardView
style="@style/WidgetFoundation.Card.Primary" style="@style/WidgetFoundation.Card.Primary"
goneUnless="@{viewModel.noticeVisible}" goneUnless="@{viewModel.noticeVisible}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment