Newer
Older
DevAndroid / app / src / main / res / layout / fragment_async.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>

        <variable
            name="asyncViewModel"
            type="keijumt.devandroid.viewmodel.AsyncViewModel" />
    </data>

    <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <Button
            android:id="@+id/btn_asyncrask"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="@{() -> asyncViewModel.async()}"
            android:text="asyncTask"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <Button
            android:id="@+id/btn_rx"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="@{() -> asyncViewModel.rx()}"
            android:text="rx"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/btn_asyncrask" />

        <Button
            android:id="@+id/btn_coroutine"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:onClick="@{() -> asyncViewModel.coroutine()}"
            android:text="coroutine"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/btn_rx" />

    </android.support.constraint.ConstraintLayout>
</layout>