Newer
Older
DevRealm / app / src / main / res / layout / activity_main.xml
MatsumotoKeiju on 8 Nov 2017 1 KB [add] Insert button, Remove Button
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="jackall.devrealm.activity.MainActivity">

    <data>

        <variable
            name="mainViewModel"
            type="jackall.devrealm.viewmodel.MainViewModel" />
    </data>

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <Button
            android:id="@+id/db_add_button"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:onClick="@{mainViewModel.onClickAdd}"
            android:text="@string/add"
            app:layout_constraintEnd_toStartOf="@id/db_remove_button"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <Button
            android:id="@+id/db_remove_button"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:onClick="@{mainViewModel.onClickRemove}"
            android:text="@string/remove"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/db_add_button"
            app:layout_constraintTop_toTopOf="parent" />

        <android.support.v7.widget.RecyclerView
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:setMainAdapter="@{mainViewModel.adapter}"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/db_add_button" />

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