abc_search_view.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. <android.support.v7.internal.widget.TintImageView
  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="wrap_content"
  47. android:layout_weight="1"
  48. android:layout_gravity="center_vertical"
  49. android:layout_marginTop="4dip"
  50. android:layout_marginBottom="4dip"
  51. android:layout_marginLeft="8dip"
  52. android:layout_marginRight="8dip"
  53. android:orientation="horizontal"
  54. android:layoutDirection="locale">
  55. <android.support.v7.internal.widget.TintImageView
  56. android:id="@+id/search_mag_icon"
  57. android:layout_width="@dimen/abc_dropdownitem_icon_width"
  58. android:layout_height="wrap_content"
  59. android:scaleType="centerInside"
  60. android:layout_gravity="center_vertical"
  61. android:visibility="gone"
  62. style="@style/RtlOverlay.Widget.AppCompat.SearchView.MagIcon" />
  63. <!-- Inner layout contains the app icon, button(s) and EditText -->
  64. <LinearLayout
  65. android:id="@+id/search_plate"
  66. android:layout_width="wrap_content"
  67. android:layout_height="wrap_content"
  68. android:layout_weight="1"
  69. android:layout_gravity="center_vertical"
  70. android:orientation="horizontal">
  71. <view class="android.support.v7.widget.SearchView$SearchAutoComplete"
  72. android:id="@+id/search_src_text"
  73. android:layout_height="36dip"
  74. android:layout_width="0dp"
  75. android:layout_weight="1"
  76. android:minWidth="@dimen/abc_search_view_text_min_width"
  77. android:layout_gravity="bottom"
  78. android:paddingLeft="@dimen/abc_dropdownitem_text_padding_left"
  79. android:paddingRight="@dimen/abc_dropdownitem_text_padding_right"
  80. android:singleLine="true"
  81. android:ellipsize="end"
  82. android:background="@null"
  83. android:inputType="text|textAutoComplete|textNoSuggestions"
  84. android:imeOptions="actionSearch"
  85. android:dropDownHeight="wrap_content"
  86. android:dropDownAnchor="@id/search_edit_frame"
  87. android:dropDownVerticalOffset="0dip"
  88. android:dropDownHorizontalOffset="0dip" />
  89. <android.support.v7.internal.widget.TintImageView
  90. android:id="@+id/search_close_btn"
  91. android:layout_width="wrap_content"
  92. android:layout_height="match_parent"
  93. android:paddingLeft="8dip"
  94. android:paddingRight="8dip"
  95. android:layout_gravity="center_vertical"
  96. android:background="?attr/selectableItemBackgroundBorderless"
  97. android:focusable="true"
  98. android:contentDescription="@string/abc_searchview_description_clear" />
  99. </LinearLayout>
  100. <LinearLayout
  101. android:id="@+id/submit_area"
  102. android:orientation="horizontal"
  103. android:layout_width="wrap_content"
  104. android:layout_height="match_parent">
  105. <android.support.v7.internal.widget.TintImageView
  106. android:id="@+id/search_go_btn"
  107. android:layout_width="wrap_content"
  108. android:layout_height="match_parent"
  109. android:layout_gravity="center_vertical"
  110. android:paddingLeft="16dip"
  111. android:paddingRight="16dip"
  112. android:background="?attr/selectableItemBackgroundBorderless"
  113. android:visibility="gone"
  114. android:focusable="true"
  115. android:contentDescription="@string/abc_searchview_description_submit" />
  116. <android.support.v7.internal.widget.TintImageView
  117. android:id="@+id/search_voice_btn"
  118. android:layout_width="wrap_content"
  119. android:layout_height="match_parent"
  120. android:layout_gravity="center_vertical"
  121. android:paddingLeft="16dip"
  122. android:paddingRight="16dip"
  123. android:background="?attr/selectableItemBackgroundBorderless"
  124. android:visibility="gone"
  125. android:focusable="true"
  126. android:contentDescription="@string/abc_searchview_description_voice" />
  127. </LinearLayout>
  128. </LinearLayout>
  129. </LinearLayout>