Add test button toggle in code

This commit is contained in:
topjohnwu 2020-02-28 11:53:25 -08:00
parent 64f5ff5475
commit 5c0e86383c
2 changed files with 3 additions and 1 deletions

View File

@ -96,6 +96,8 @@ class HomeViewModel(
ensureEnv() ensureEnv()
} }
val showTest = false
fun onTestPressed() = object : ViewEvent(), ActivityExecutor { fun onTestPressed() = object : ViewEvent(), ActivityExecutor {
override fun invoke(activity: BaseActivity) { override fun invoke(activity: BaseActivity) {
/* Entry point to trigger test events within the app */ /* Entry point to trigger test events within the app */

View File

@ -30,7 +30,7 @@
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
android:layout_gravity="center" android:layout_gravity="center"
style="@style/WidgetFoundation.Button" style="@style/WidgetFoundation.Button"
gone="@{true}" gone="@{!viewModel.showTest}"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:onClick="@{() -> viewModel.onTestPressed()}" android:onClick="@{() -> viewModel.onTestPressed()}"