widget_cell_content.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. <LinearLayout
  17. android:layout_width="match_parent"
  18. android:layout_height="wrap_content"
  19. android:paddingTop="@dimen/widget_preview_label_vertical_padding"
  20. android:paddingBottom="@dimen/widget_preview_label_vertical_padding"
  21. android:paddingLeft="@dimen/widget_preview_label_horizontal_padding"
  22. android:paddingRight="@dimen/widget_preview_label_horizontal_padding"
  23. android:orientation="horizontal">
  24. <!-- The name of the widget. -->
  25. <TextView
  26. android:id="@+id/widget_name"
  27. android:layout_width="0dp"
  28. android:layout_height="wrap_content"
  29. android:layout_weight="1"
  30. android:ellipsize="end"
  31. android:fadingEdge="horizontal"
  32. android:fontFamily="sans-serif-condensed"
  33. android:gravity="center"
  34. android:singleLine="true"
  35. android:maxLines="1"
  36. android:textColor="?android:attr/textColorSecondary"
  37. android:textSize="14sp" />
  38. <!-- The original dimensions of the widget (can't be the same text as above due to different
  39. style. -->
  40. <TextView
  41. android:id="@+id/widget_dims"
  42. android:layout_width="wrap_content"
  43. android:layout_height="wrap_content"
  44. android:layout_marginStart="5dp"
  45. android:layout_marginLeft="5dp"
  46. android:visibility="gone"
  47. android:textColor="?android:attr/textColorSecondary"
  48. android:textSize="14sp"
  49. android:fontFamily="sans-serif-condensed"
  50. android:alpha="0.8" />
  51. </LinearLayout>
  52. <!-- The image of the widget. This view does not support padding. Any placement adjustment
  53. should be done using margins. -->
  54. <com.android.launcher3.widget.WidgetImageView
  55. android:id="@+id/widget_preview"
  56. android:layout_width="match_parent"
  57. android:layout_height="0dp"
  58. android:layout_weight="1" />
  59. </merge>