forked from manas-chaudhari/android-mvvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathactivity_search.xml
44 lines (38 loc) · 1.64 KB
/
activity_search.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?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"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="vm"
type="com.manaschaudhari.android_mvvm.sample.two_way_binding.SearchViewModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.manaschaudhari.android_mvvm.sample.two_way_binding.SearchActivity">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="@{vm.onRandomSearch}"
android:text="RANDOM" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_search"
android:text="@={vm.searchQuery}" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_search"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
bind:items="@{vm.results}"
bind:layout_vertical="@{true}"
bind:view_provider="@{@layout/row_item_with_image}" />
</LinearLayout>
</layout>