Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!--
      3 
      4  Copyright (C) 2017 The Android Open Source Project
      5 
      6  Licensed under the Apache License, Version 2.0 (the "License");
      7  you may not use this file except in compliance with the License.
      8  You may obtain a copy of the License at
      9 
     10       http://www.apache.org/licenses/LICENSE-2.0
     11 
     12  Unless required by applicable law or agreed to in writing, software
     13  distributed under the License is distributed on an "AS IS" BASIS,
     14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     15  See the License for the specific language governing permissions and
     16  limitations under the License.
     17 
     18 
     19  Note: This is derived from abc_search_view.xml in the v7 support library.
     20  We can't really flatten out the layout since the code expects it to be a
     21  certain way.
     22 
     23  TODO: Clean up this file once we have visual design.
     24 -->
     25 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     26         android:id="@+id/search_bar"
     27         android:layout_width="match_parent"
     28         android:layout_height="wrap_content"
     29         android:layout_marginLeft="@dimen/searchview_margin_left"
     30         android:layout_marginRight="@dimen/searchview_margin_right"
     31         android:orientation="horizontal"
     32         >
     33 
     34     <!-- This is actually used for the badge icon *or* the badge label (or neither) -->
     35     <TextView
     36             android:id="@+id/search_badge"
     37             android:layout_width="wrap_content"
     38             android:layout_height="match_parent"
     39             android:gravity="center_vertical"
     40             android:layout_marginBottom="2dip"
     41             android:drawablePadding="0dip"
     42             android:textAppearance="?android:attr/textAppearanceMedium"
     43             android:textColor="?android:attr/textColorPrimary"
     44             android:visibility="gone" />
     45 
     46     <ImageView
     47             android:id="@+id/search_button"
     48             style="?attr/actionButtonStyle"
     49             android:layout_width="wrap_content"
     50             android:layout_height="match_parent"
     51             android:layout_gravity="center_vertical"
     52             android:focusable="true"
     53             android:contentDescription="@string/abc_searchview_description_search" />
     54 
     55     <LinearLayout
     56             android:id="@+id/search_edit_frame"
     57             android:layout_width="wrap_content"
     58             android:layout_height="wrap_content"
     59             android:layout_weight="1"
     60             android:layout_marginLeft="8dip"
     61             android:layout_marginRight="8dip"
     62             android:orientation="horizontal"
     63             android:layoutDirection="locale">
     64 
     65         <ImageView
     66                 android:id="@+id/search_mag_icon"
     67                 android:layout_width="@dimen/abc_dropdownitem_icon_width"
     68                 android:layout_height="wrap_content"
     69                 android:scaleType="centerInside"
     70                 android:layout_gravity="center_vertical"
     71                 android:visibility="gone"
     72                 style="@style/RtlOverlay.Widget.AppCompat.SearchView.MagIcon" />
     73 
     74         <!-- Inner layout contains the app icon, button(s) and EditText -->
     75         <LinearLayout
     76                 android:id="@+id/search_plate"
     77                 android:layout_width="wrap_content"
     78                 android:layout_height="wrap_content"
     79                 android:layout_weight="1"
     80                 android:layout_gravity="center_vertical"
     81                 android:orientation="horizontal">
     82 
     83             <view class="android.support.v7.widget.SearchView$SearchAutoComplete"
     84                   android:id="@+id/search_src_text"
     85                   android:layout_height="wrap_content"
     86                   android:layout_width="0dp"
     87                   android:layout_weight="1"
     88                   android:layout_gravity="center_vertical"
     89                   android:paddingLeft="@dimen/abc_dropdownitem_text_padding_left"
     90                   android:paddingRight="@dimen/abc_dropdownitem_text_padding_right"
     91                   android:singleLine="true"
     92                   android:ellipsize="end"
     93                   android:background="@null"
     94                   android:inputType="text|textAutoComplete|textNoSuggestions"
     95                   android:imeOptions="actionSearch"
     96                   android:dropDownHeight="wrap_content"
     97                   android:dropDownAnchor="@id/search_edit_frame"
     98                   android:dropDownVerticalOffset="0dip"
     99                   android:dropDownHorizontalOffset="0dip"
    100                   android:theme="@style/CarTitle" />
    101 
    102             <ImageView
    103                     android:id="@+id/search_close_btn"
    104                     android:layout_width="wrap_content"
    105                     android:layout_height="match_parent"
    106                     android:paddingLeft="8dip"
    107                     android:paddingRight="8dip"
    108                     android:layout_gravity="center_vertical"
    109                     android:background="?attr/selectableItemBackgroundBorderless"
    110                     android:focusable="true"
    111                     android:contentDescription="@string/abc_searchview_description_clear" />
    112 
    113         </LinearLayout>
    114 
    115         <LinearLayout
    116                 android:id="@+id/submit_area"
    117                 android:orientation="horizontal"
    118                 android:layout_width="wrap_content"
    119                 android:layout_height="match_parent">
    120 
    121             <ImageView
    122                     android:id="@+id/search_go_btn"
    123                     android:layout_width="wrap_content"
    124                     android:layout_height="match_parent"
    125                     android:layout_gravity="center_vertical"
    126                     android:paddingLeft="16dip"
    127                     android:paddingRight="16dip"
    128                     android:background="?attr/selectableItemBackgroundBorderless"
    129                     android:visibility="gone"
    130                     android:focusable="true"
    131                     android:contentDescription="@string/abc_searchview_description_submit" />
    132 
    133             <ImageView
    134                     android:id="@+id/search_voice_btn"
    135                     android:layout_width="wrap_content"
    136                     android:layout_height="match_parent"
    137                     android:layout_gravity="center_vertical"
    138                     android:paddingLeft="16dip"
    139                     android:paddingRight="16dip"
    140                     android:background="?attr/selectableItemBackgroundBorderless"
    141                     android:visibility="gone"
    142                     android:focusable="true"
    143                     android:contentDescription="@string/abc_searchview_description_voice" />
    144         </LinearLayout>
    145     </LinearLayout>
    146 </LinearLayout>
    147