Skip to content

Instantly share code, notes, and snippets.

@shaobin0604
Last active March 15, 2016 03:04
Show Gist options
  • Save shaobin0604/d946cd60256f5aba336c to your computer and use it in GitHub Desktop.
Save shaobin0604/d946cd60256f5aba336c to your computer and use it in GitHub Desktop.
Google Play Service Place Search UI
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="@dimen/place_autocomplete_prediction_height"
xmlns:android="http://schemas.android.com/apk/res/android">
<include android:layout_gravity="center" android:visibility="invisible" android:layout_width="@dimen/place_autocomplete_progress_size" android:layout_height="@dimen/place_autocomplete_progress_size" android:layout_marginLeft="@dimen/place_autocomplete_progress_horizontal_margin" android:layout_marginRight="@dimen/place_autocomplete_progress_horizontal_margin" android:layout_alignParentLeft="true" android:layout_centerVertical="true" layout="@layout/place_autocomplete_progress" />
<View android:id="@id/place_autocomplete_separator" android:layout_width="0.0dip" android:layout_height="0.0dip" android:layout_centerVertical="true" />
<TextView android:textSize="@dimen/place_autocomplete_prediction_primary_text" android:textColor="@color/place_autocomplete_prediction_primary_text" android:ellipsize="end" android:id="@id/place_autocomplete_prediction_primary_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/place_autocomplete_prediction_horizontal_margin" android:layout_marginRight="@dimen/place_autocomplete_prediction_horizontal_margin" android:lines="1" android:singleLine="true" android:layout_toRightOf="@id/place_autocomplete_progress" android:layout_above="@id/place_autocomplete_separator" android:layout_centerVertical="true" />
<TextView android:textSize="@dimen/place_autocomplete_prediction_secondary_text" android:textColor="@color/place_autocomplete_prediction_secondary_text" android:ellipsize="end" android:id="@id/place_autocomplete_prediction_secondary_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/place_autocomplete_prediction_horizontal_margin" android:layout_marginRight="@dimen/place_autocomplete_prediction_horizontal_margin" android:lines="1" android:singleLine="true" android:layout_toRightOf="@id/place_autocomplete_progress" android:layout_below="@id/place_autocomplete_separator" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.v7.widget.Toolbar android:id="@id/action_bar" android:background="?colorPrimary" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minHeight="?actionBarSize" app:contentInsetStart="@dimen/place_autocomplete_toolbar_inset_start" app:contentInsetEnd="@dimen/place_autocomplete_toolbar_inset_end" app:contentInsetLeft="@dimen/place_autocomplete_toolbar_inset_start" app:contentInsetRight="@dimen/place_autocomplete_toolbar_inset_end">
<include layout="@layout/place_autocomplete_search_bar" />
</android.support.v7.widget.Toolbar>
<View android:background="@drawable/place_autocomplete_toolbar_shadow" android:layout_width="fill_parent" android:layout_height="4.0dip" android:layout_below="@id/action_bar" />
<android.support.v7.widget.RecyclerView android:id="@id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@id/action_bar" />
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/error" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@id/action_bar">
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="160.0dip" android:src="@drawable/sad_cloud_white" />
<include layout="@layout/place_autocomplete_error_text" />
</LinearLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/root" android:padding="@dimen/place_autocomplete_overlay_padding" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<android.support.v7.widget.CardView android:id="@id/content" android:layout_width="fill_parent" android:layout_height="wrap_content">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<include layout="@layout/place_autocomplete_search_bar" />
<View android:background="@color/place_autocomplete_separator" android:layout_width="fill_parent" android:layout_height="1.0dip" />
<android.support.v7.widget.RecyclerView android:id="@id/list" android:background="@android:color/white" android:layout_width="fill_parent" android:layout_height="wrap_content" android:cacheColorHint="@android:color/white" />
<LinearLayout android:gravity="center_horizontal" android:orientation="vertical" android:id="@id/error" android:layout_width="fill_parent" android:layout_height="wrap_content">
<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="48.0dip" android:src="@drawable/sad_cloud_grey" />
<include layout="@layout/place_autocomplete_error_text" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageButton android:id="@id/back_button" android:background="?selectableItemBackgroundBorderless" android:padding="12.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="4.0dip" android:layout_marginRight="20.0dip" android:src="@drawable/ic_arrow_back_grey600_24dp" android:layout_weight="0.0" android:contentDescription="@string/place_autocomplete_back_button" />
<TextView android:id="@id/search_accessibility_label" android:layout_width="0.0dip" android:layout_height="0.0dip" android:text="@string/place_autocomplete_search_description" android:layout_weight="0.0" />
<EditText android:textSize="20.0sp" android:textColor="@color/place_autocomplete_search_text" android:textColorHint="@color/place_autocomplete_search_hint" android:layout_gravity="center_vertical" android:id="@id/edit_text" android:background="@android:color/transparent" android:layout_width="0.0dip" android:layout_height="fill_parent" android:hint="@string/place_autocomplete_search_hint" android:maxLines="1" android:lines="1" android:singleLine="true" android:layout_weight="1.0" android:inputType="textNoSuggestions" android:imeOptions="actionSearch|flagNoExtractUi" />
<ImageButton android:id="@id/clear_button" android:background="?selectableItemBackgroundBorderless" android:padding="12.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="4.0dip" android:src="@drawable/ic_close_grey600_24dp" android:layout_weight="0.0" android:contentDescription="@string/place_autocomplete_clear_button" />
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment