Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!-- Copyright (C) 2015 The Android Open Source Project
      3 
      4      Licensed under the Apache License, Version 2.0 (the "License");
      5      you may not use this file except in compliance with the License.
      6      You may obtain a copy of the License at
      7 
      8           http://www.apache.org/licenses/LICENSE-2.0
      9 
     10      Unless required by applicable law or agreed to in writing, software
     11      distributed under the License is distributed on an "AS IS" BASIS,
     12      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13      See the License for the specific language governing permissions and
     14      limitations under the License.
     15 -->
     16 <com.android.launcher3.widget.WidgetCell
     17     xmlns:android="http://schemas.android.com/apk/res/android"
     18     xmlns:launcher="http://schemas.android.com/apk/res-auto"
     19     android:layout_width="wrap_content"
     20     android:layout_height="wrap_content"
     21     android:layout_weight="1"
     22     android:orientation="vertical"
     23     android:focusable="true"
     24     android:background="@color/widgets_cell_color"
     25     android:gravity="center_horizontal">
     26 
     27     <LinearLayout
     28         android:layout_width="wrap_content"
     29         android:layout_height="wrap_content"
     30         android:paddingTop="@dimen/widget_preview_label_vertical_padding"
     31         android:paddingBottom="@dimen/widget_preview_label_vertical_padding"
     32         android:paddingLeft="@dimen/widget_preview_label_horizontal_padding"
     33         android:paddingRight="@dimen/widget_preview_label_horizontal_padding"
     34         android:orientation="horizontal">
     35 
     36         <!-- The name of the widget. -->
     37         <TextView
     38             android:id="@+id/widget_name"
     39             android:layout_width="wrap_content"
     40             android:layout_height="wrap_content"
     41             android:layout_weight="1"
     42             android:ellipsize="end"
     43             android:fadingEdge="horizontal"
     44             android:fontFamily="sans-serif-condensed"
     45             android:gravity="start"
     46             android:shadowColor="#B0000000"
     47             android:shadowRadius="2.0"
     48             android:singleLine="true"
     49             android:textColor="@color/widgets_view_item_text_color"
     50             android:textSize="14sp" />
     51 
     52         <!-- The original dimensions of the widget (can't be the same text as above due to different
     53              style. -->
     54         <TextView
     55             android:id="@+id/widget_dims"
     56             android:layout_width="wrap_content"
     57             android:layout_height="wrap_content"
     58             android:layout_marginStart="5dp"
     59             android:layout_marginLeft="5dp"
     60             android:textColor="@color/widgets_view_item_text_color"
     61             android:textSize="14sp"
     62             android:fontFamily="sans-serif-condensed"
     63             android:shadowRadius="2.0"
     64             android:shadowColor="#B0000000" />
     65     </LinearLayout>
     66 
     67     <!-- The image of the widget. This view does not support padding. Any placement adjustment
     68          should be done using margins. -->
     69     <com.android.launcher3.widget.WidgetImageView
     70         android:id="@+id/widget_preview"
     71         android:layout_width="match_parent"
     72         android:layout_height="0dp"
     73         android:layout_weight="1" />
     74 </com.android.launcher3.widget.WidgetCell>