Skip to content

Instantly share code, notes, and snippets.

@simoales
Created November 25, 2016 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simoales/7f29195c3a1f2826c86ee3a8ec6b6d71 to your computer and use it in GitHub Desktop.
Save simoales/7f29195c3a1f2826c86ee3a8ec6b6d71 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bind="http://schemas.android.com/apk/res-auto">
<data>
<variable name="categories" type="com.example.todos.model.CategoryList"/>
<variable name="category" type="com.example.todos.model.Category"/>
</data>
<LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/insert_new_category"
android:text="@={category.description}"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/btnAdd"
android:layout_width="@dimen/btnSize"
android:layout_height="@dimen/btnSize"
android:text="@string/newCategory"
android:drawableTop="@drawable/tag_text_outline"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
style="@android:style/Widget.Button" />
<Button
android:id="@+id/btnSave"
android:layout_width="@dimen/btnSize"
android:layout_height="@dimen/btnSize"
android:text="@string/save_category"
android:drawableTop="@android:drawable/ic_menu_save"
android:layout_alignParentTop="true"
android:layout_gravity="center_horizontal"
style="@android:style/Widget.Button"
android:layout_centerHorizontal="true" />
<Button
android:id="@+id/btnDelete"
android:layout_width="@dimen/btnSize"
android:layout_height="@dimen/btnSize"
android:layout_gravity="right"
android:text="@string/delete_category"
style="@android:style/Widget.Button"
android:drawableTop="@android:drawable/ic_menu_delete"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true" />
</RelativeLayout>
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/lvCategories"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
bind:items="@{categories.ItemList}"
/>
</LinearLayout>
</layout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment