Friday, 23 August 2013

Widget position on Screen

Widget position on Screen

Just made my first android widget but it seems to occupy to much space.
As you can see from the photos, I can't put it more closer to the upper
side of the screen. It seems to be a big widget, but it is not. And so i
can't put app icon upper of it or at its right side.

Here is style:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
...OTHER CODE
<padding android:left="8dip"
android:top="8dip"
android:right="8dip"
android:bottom="8dip" />
</shape>
And here is widget xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:padding="8dp"
android:id="@+id/linearwidget"
android:background="@drawable/widgetstyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/labelmedia"
android:padding="5dp"
android:layout_centerInParent="true"
android:layout_alignParentTop="true"
android:textColor="#ff27b8d1"
android:textSize="12sp"
android:textStyle="bold"
android:text="MEDIA"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:textColor="@android:color/white"
android:textSize="15sp"
android:textStyle="bold"
android:layout_below="@id/labelmedia"
android:id="@+id/media"
android:layout_centerInParent="true"
android:text="12.55"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/labelbase"
android:layout_centerInParent="true"
android:layout_alignParentTop="true"
android:padding="5dp"
android:textColor="#ff27b8d1"
android:textSize="12sp"
android:textStyle="bold"
android:text="BASE LAUREA"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:textColor="@android:color/white"
android:textSize="15sp"
android:textStyle="bold"
android:layout_below="@id/labelbase"
android:id="@+id/base"
android:layout_centerInParent="true"
android:text="12.55"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/labelcrediti"
android:layout_centerInParent="true"
android:layout_alignParentTop="true"
android:padding="5dp"
android:textColor="#ff27b8d1"
android:textSize="12sp"
android:textStyle="bold"
android:text="CREDITI"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:textColor="@android:color/white"
android:textSize="14sp"
android:textStyle="bold"
android:layout_below="@id/labelcrediti"
android:id="@+id/crediti"
android:layout_centerInParent="true"
android:text="120/180"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
Any help on how to let it be smaller as it is?

No comments:

Post a Comment