<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/appwidget_bg"
    android:orientation="horizontal">
    <LinearLayout
        android:id="@+id/LinearLayoutWidget"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@drawable/appwidget_button_center"
        android:orientation="vertical"
        android:focusable="true"
        android:paddingLeft="@dimen/widget_paddingLeft"
        android:paddingTop="@dimen/widget_paddingTop"
        android:paddingRight="@dimen/widget_paddingRight"
        android:paddingBottom="@dimen/widget_paddingBottom">
    </LinearLayout>
    <include
        layout="@layout/appwidget_buttonbar"
        android:id="@+id/layout_buttons_ref"
        android:layout_width="wrap_content"
        android:layout_height="match_parent" />
</LinearLayout>

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/appwidget_bg"
    android:orientation="horizontal">
    <LinearLayout
        android:id="@+id/LinearLayoutWidget"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:background="@drawable/appwidget_button_center"
        android:orientation="vertical"
        android:focusable="true"
        android:paddingLeft="@dimen/widget_paddingLeft"
        android:paddingTop="@dimen/widget_paddingTop"
        android:paddingRight="@dimen/widget_paddingRight"
        android:paddingBottom="@dimen/widget_paddingBottom">
    </LinearLayout>
    <include
        layout="@layout/appwidget_buttonbar"
        android:id="@+id/layout_buttons_ref"
        android:layout_width="wrap_content"
        android:layout_height="match_parent" />
</LinearLayout>

Adjust height of middle and large widget dynamically.
Adjust height of middle and large widget dynamically.