abc_search_view.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. /*
  4. * Copyright (C) 2014 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. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  20. android:id="@+id/search_bar"
  21. android:layout_width="match_parent"
  22. android:layout_height="match_parent"
  23. android:orientation="horizontal">
  24. <!-- This is actually used for the badge icon *or* the badge label (or neither) -->
  25. <TextView
  26. android:id="@+id/search_badge"
  27. android:layout_width="wrap_content"
  28. android:layout_height="match_parent"
  29. android:gravity="center_vertical"
  30. android:layout_marginBottom="2dip"
  31. android:drawablePadding="0dip"
  32. android:textAppearance="?android:attr/textAppearanceMedium"
  33. android:textColor="?android:attr/textColorPrimary"
  34. android:visibility="gone" />
  35. <ImageView
  36. android:id="@+id/search_button"
  37. style="?attr/actionButtonStyle"
  38. android:layout_width="wrap_content"
  39. android:layout_height="match_parent"
  40. android:layout_gravity="center_vertical"
  41. android:focusable="true"
  42. android:contentDescription="@string/abc_searchview_description_search" />
  43. <LinearLayout
  44. android:id="@+id/search_edit_frame"
  45. android:layout_width="wrap_content"
  46. android:layout_height="match_parent"
  47. android:layout_weight="1"
  48. android:layout_marginLeft="8dip"
  49. android:layout_marginRight="8dip"
  50. android:orientation="horizontal"
  51. android:layoutDirection="locale">
  52. <ImageView
  53. android:id="@+id/search_mag_icon"
  54. android:layout_width="@dimen/abc_dropdownitem_icon_width"
  55. android:layout_height="wrap_content"
  56. android:scaleType="centerInside"
  57. android:layout_gravity="center_vertical"
  58. android:visibility="gone"
  59. style="@style/RtlOverlay.Widget.AppCompat.SearchView.MagIcon" />
  60. <!-- Inner layout contains the app icon, button(s) and EditText -->
  61. <LinearLayout
  62. android:id="@+id/search_plate"
  63. android:layout_width="wrap_content"
  64. android:layout_height="match_parent"
  65. android:layout_weight="1"
  66. android:layout_gravity="center_vertical"
  67. android:orientation="horizontal">
  68. <view class="android.support.v7.widget.SearchView$SearchAutoComplete"
  69. android:id="@+id/search_src_text"
  70. android:layout_height="36dip"
  71. android:layout_width="0dp"
  72. android:layout_weight="1"
  73. android:layout_gravity="center_vertical"
  74. android:paddingLeft="@dimen/abc_dropdownitem_text_padding_left"
  75. android:paddingRight="@dimen/abc_dropdownitem_text_padding_right"
  76. android:singleLine="true"
  77. android:ellipsize="end"
  78. android:background="@null"
  79. android:inputType="text|textAutoComplete|textNoSuggestions"
  80. android:imeOptions="actionSearch"
  81. android:dropDownHeight="wrap_content"
  82. android:dropDownAnchor="@id/search_edit_frame"
  83. android:dropDownVerticalOffset="0dip"
  84. android:dropDownHorizontalOffset="0dip" />
  85. <ImageView
  86. android:id="@+id/search_close_btn"
  87. android:layout_width="wrap_content"
  88. android:layout_height="match_parent"
  89. android:paddingLeft="8dip"
  90. android:paddingRight="8dip"
  91. android:layout_gravity="center_vertical"
  92. android:background="?attr/selectableItemBackgroundBorderless"
  93. android:focusable="true"
  94. android:contentDescription="@string/abc_searchview_description_clear" />
  95. </LinearLayout>
  96. <LinearLayout
  97. android:id="@+id/submit_area"
  98. android:orientation="horizontal"
  99. android:layout_width="wrap_content"
  100. android:layout_height="match_parent">
  101. <ImageView
  102. android:id="@+id/search_go_btn"
  103. android:layout_width="wrap_content"
  104. android:layout_height="match_parent"
  105. android:layout_gravity="center_vertical"
  106. android:paddingLeft="16dip"
  107. android:paddingRight="16dip"
  108. android:background="?attr/selectableItemBackgroundBorderless"
  109. android:visibility="gone"
  110. android:focusable="true"
  111. android:contentDescription="@string/abc_searchview_description_submit" />
  112. <ImageView
  113. android:id="@+id/search_voice_btn"
  114. android:layout_width="wrap_content"
  115. android:layout_height="match_parent"
  116. android:layout_gravity="center_vertical"
  117. android:paddingLeft="16dip"
  118. android:paddingRight="16dip"
  119. android:background="?attr/selectableItemBackgroundBorderless"
  120. android:visibility="gone"
  121. android:focusable="true"
  122. android:contentDescription="@string/abc_searchview_description_voice" />
  123. </LinearLayout>
  124. </LinearLayout>
  125. </LinearLayout>