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()
}
val showTest = false
fun onTestPressed() = object : ViewEvent(), ActivityExecutor {
override fun invoke(activity: BaseActivity) {
/* Entry point to trigger test events within the app */

View File

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