forked from yahoo/YHSShowcaseApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
custom_search_assist_item.xml
65 lines (63 loc) · 2.91 KB
/
custom_search_assist_item.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?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">
<data>
<import type="android.view.View"/>
<import type="android.view.Gravity"/>
<import type="android.view.ViewGroup"/>
<variable
name="assist"
type="com.yahoo.search.yhssdk.data.SearchAssistData"/>
<variable
name="handler"
type="com.yahoo.search.yhssdk.ui.view.SearchActivity"/>
<variable
name="customSearchAssist"
type="com.yahoo.search.yhssdk.showcase.custom.CustomSearchAssist"/>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:layout_width="0dp"
android:layout_weight="1.0"
android:layout_height="19dp"
android:background="#FFEDEDF3"
android:visibility="@{assist.type == assist.SECTION_DIVIDER ? View.VISIBLE : View.GONE}"/>
<LinearLayout
android:id="@+id/yssdk_contact_item"
android:layout_width="match_parent"
android:layout_height="49dp"
android:visibility="@{assist.type == assist.SECTION_DIVIDER ? View.GONE : View.VISIBLE}">
<ImageView
android:id="@+id/yssdk_contact_icon"
android:layout_width="0dp"
android:layout_weight="0.1"
android:layout_height="match_parent"
android:layout_gravity="left"
android:padding="4dp"
app:imageDrawable="@{assist}"/>
<TextView
android:text="@{assist.label}"
android:layout_width="0dp"
android:paddingLeft="14dp"
android:layout_weight="0.8"
android:layout_height="match_parent"
android:ellipsize="end"
android:visibility="@{assist.type == assist.SECTION_DIVIDER ? View.GONE : View.VISIBLE}"
android:onClick="@{() -> handler.onClickAssistItem(assist)}"
android:gravity="@{assist.type == assist.SHOW_ALL_HISTORY || assist.type == assist.CLEAR_HISTORY ? Gravity.CENTER : Gravity.LEFT | Gravity.CENTER_VERTICAL}"/>
<ImageView
android:enabled="true"
android:visibility="@{assist.type == assist.SEARCH_SUGGEST ? View.VISIBLE : View.GONE}"
android:clickable="true"
android:layout_width="0dp"
android:layout_weight="0.1"
android:layout_height="match_parent"
android:layout_gravity="right"
android:gravity="center"
android:src="@drawable/ic_query_builder_black_24px"
android:onClick="@{() -> handler.onAppendSuggestionItem(assist.label)}"/>
</LinearLayout>
</LinearLayout>
</layout>