widget_cell_content.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. <merge xmlns:android="http://schemas.android.com/apk/res/android"
  14. android:layout_width="wrap_content"
  15. android:layout_height="wrap_content">
  16. <com.android.launcher3.widget.WidgetCellPreview
  17. android:id="@+id/widget_preview_container"
  18. android:layout_width="0dp"
  19. android:layout_height="0dp"
  20. android:layout_weight="1"
  21. android:importantForAccessibility="no"
  22. android:layout_marginVertical="8dp">
  23. <!-- The image of the widget. This view does not support padding. Any placement adjustment
  24. should be done using margins. Width & height are set at runtime after scaling the
  25. preview image. -->
  26. <com.android.launcher3.widget.WidgetImageView
  27. android:id="@+id/widget_preview"
  28. android:layout_width="match_parent"
  29. android:layout_height="match_parent"
  30. android:importantForAccessibility="no"
  31. android:layout_gravity="fill"/>
  32. </com.android.launcher3.widget.WidgetCellPreview>
  33. <!-- The name of the widget. -->
  34. <TextView
  35. android:id="@+id/widget_name"
  36. android:layout_width="match_parent"
  37. android:layout_height="wrap_content"
  38. android:ellipsize="end"
  39. android:fadingEdge="horizontal"
  40. android:gravity="center_horizontal"
  41. android:singleLine="true"
  42. android:maxLines="1"
  43. android:textColor="?android:attr/textColorPrimary"
  44. android:textSize="@dimen/widget_cell_font_size" />
  45. <!-- The original dimensions of the widget -->
  46. <TextView
  47. android:id="@+id/widget_dims"
  48. android:layout_width="match_parent"
  49. android:layout_height="wrap_content"
  50. android:gravity="center_horizontal"
  51. android:textColor="?android:attr/textColorSecondary"
  52. android:textSize="@dimen/widget_cell_font_size"
  53. android:alpha="0.7" />
  54. <TextView
  55. android:id="@+id/widget_description"
  56. android:layout_width="match_parent"
  57. android:layout_height="wrap_content"
  58. android:gravity="center_horizontal"
  59. android:textSize="@dimen/widget_cell_font_size"
  60. android:textColor="?android:attr/textColorSecondary"
  61. android:maxLines="2"
  62. android:ellipsize="end"
  63. android:fadingEdge="horizontal"
  64. android:alpha="0.7" />
  65. </merge>