search_container_all_apps.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Copyright (C) 2017 The Android Open Source Project
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. -->
  13. <com.android.launcher3.allapps.search.AppsSearchContainerLayout
  14. xmlns:android="http://schemas.android.com/apk/res/android"
  15. android:id="@id/search_container_all_apps"
  16. android:layout_width="match_parent"
  17. android:layout_height="@dimen/all_apps_search_bar_height"
  18. android:layout_gravity="center|top"
  19. android:layout_marginBottom="-8dp"
  20. android:gravity="center|bottom"
  21. android:paddingLeft="@dimen/dynamic_grid_edge_margin"
  22. android:paddingRight="@dimen/dynamic_grid_edge_margin"
  23. android:saveEnabled="false" >
  24. <!--
  25. Note: The following relation should always be true so that the shadows are aligned properly
  26. search_box_input.layout_marginBottom
  27. == search_divider.layout_marginBottom
  28. == - (search_container.layout_marginBottom)
  29. >= 5dp
  30. -->
  31. <com.android.launcher3.ExtendedEditText
  32. android:id="@+id/search_box_input"
  33. android:layout_width="match_parent"
  34. android:layout_height="@dimen/all_apps_search_bar_field_height"
  35. android:layout_gravity="bottom"
  36. android:layout_marginBottom="8dp"
  37. android:background="@android:color/transparent"
  38. android:focusableInTouchMode="true"
  39. android:gravity="center"
  40. android:hint="@string/all_apps_search_bar_hint"
  41. android:imeOptions="actionSearch|flagNoExtractUi"
  42. android:inputType="text|textNoSuggestions|textCapWords"
  43. android:maxLines="1"
  44. android:saveEnabled="false"
  45. android:scrollHorizontally="true"
  46. android:singleLine="true"
  47. android:textColor="?android:attr/textColorSecondary"
  48. android:textColorHint="@drawable/all_apps_search_hint"
  49. android:textSize="16sp" />
  50. <!-- This needs to be a container with a view, to simulate a scrolling effect for the header.
  51. We translate the header down, and its content up by the same amount, so that it gets
  52. clipped by the parent, making it look like the divider was scrolled out of the view. -->
  53. <FrameLayout
  54. android:id="@+id/search_divider"
  55. android:layout_width="match_parent"
  56. android:layout_height="1dp"
  57. android:layout_gravity="bottom"
  58. android:layout_marginBottom="8dp" >
  59. <View
  60. android:layout_width="match_parent"
  61. android:layout_height="1dp"
  62. android:background="@drawable/all_apps_search_divider"/>
  63. </FrameLayout>
  64. </com.android.launcher3.allapps.search.AppsSearchContainerLayout>