Advertisement
chayanforyou

Android Home Screen Widget (icon, label - style)

Mar 7th, 2019
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.45 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     android:id="@+id/Widget"
  4.     style="@android:style/Widget"
  5.     android:layout_width="72dip"
  6.     android:layout_height="72dip"
  7.     android:focusable="true"
  8.     android:gravity="center_horizontal"
  9.     android:orientation="vertical">
  10.  
  11.     <ImageView
  12.         android:id="@+id/WidgetIcon"
  13.         android:layout_width="match_parent"
  14.         android:layout_height="50dip"
  15.         android:gravity="center"
  16.         android:paddingBottom="3dip"
  17.         android:src="@mipmap/ic_launcher_round" />
  18.  
  19.     <TextView
  20.         android:id="@+id/WidgetLabel"
  21.         android:layout_width="wrap_content"
  22.         android:layout_height="match_parent"
  23.         android:background="@drawable/corners"
  24.         android:gravity="center"
  25.         android:text="@string/appwidget_text"
  26.         android:textColor="@android:color/white"
  27.         android:textSize="12sp" />
  28.  
  29. </LinearLayout>
  30.  
  31.  
  32. ................................................................
  33.  
  34. <?xml version="1.0" encoding="utf-8"?>
  35. <shape xmlns:android="http://schemas.android.com/apk/res/android"
  36.     android:id="@+id/Corners">
  37.     <stroke
  38.         android:width="1dp"
  39.         android:color="@android:color/transparent" />
  40.     <padding
  41.         android:bottom="1dp"
  42.         android:left="1dp"
  43.         android:right="1dp"
  44.         android:top="1dp" />
  45.     <corners android:radius="1dp" />
  46. </shape>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement