widget_cell.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!-- Copyright (C) 2015 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.widget.WidgetCell
  14. xmlns:android="http://schemas.android.com/apk/res/android"
  15. xmlns:launcher="http://schemas.android.com/apk/res-auto"
  16. android:layout_width="wrap_content"
  17. android:layout_height="wrap_content"
  18. android:layout_weight="1"
  19. android:orientation="vertical"
  20. android:focusable="true"
  21. android:background="@color/widgets_cell_color"
  22. android:gravity="center_horizontal">
  23. <LinearLayout
  24. android:layout_width="wrap_content"
  25. android:layout_height="wrap_content"
  26. android:paddingTop="@dimen/widget_preview_label_vertical_padding"
  27. android:paddingBottom="@dimen/widget_preview_label_vertical_padding"
  28. android:paddingLeft="@dimen/widget_preview_label_horizontal_padding"
  29. android:paddingRight="@dimen/widget_preview_label_horizontal_padding"
  30. android:orientation="horizontal">
  31. <!-- The name of the widget. -->
  32. <TextView
  33. android:id="@+id/widget_name"
  34. android:layout_width="wrap_content"
  35. android:layout_height="wrap_content"
  36. android:layout_weight="1"
  37. android:ellipsize="end"
  38. android:fadingEdge="horizontal"
  39. android:fontFamily="sans-serif-condensed"
  40. android:gravity="start"
  41. android:shadowColor="#B0000000"
  42. android:shadowRadius="2.0"
  43. android:singleLine="true"
  44. android:textColor="@color/widgets_view_item_text_color"
  45. android:textSize="14sp" />
  46. <!-- The original dimensions of the widget (can't be the same text as above due to different
  47. style. -->
  48. <TextView
  49. android:id="@+id/widget_dims"
  50. android:layout_width="wrap_content"
  51. android:layout_height="wrap_content"
  52. android:layout_marginStart="5dp"
  53. android:layout_marginLeft="5dp"
  54. android:textColor="@color/widgets_view_item_text_color"
  55. android:textSize="14sp"
  56. android:fontFamily="sans-serif-condensed"
  57. android:shadowRadius="2.0"
  58. android:shadowColor="#B0000000" />
  59. </LinearLayout>
  60. <!-- The image of the widget. This view does not support padding. Any placement adjustment
  61. should be done using margins. -->
  62. <com.android.launcher3.widget.WidgetImageView
  63. android:id="@+id/widget_preview"
  64. android:layout_width="match_parent"
  65. android:layout_height="0dp"
  66. android:layout_weight="1" />
  67. </com.android.launcher3.widget.WidgetCell>