Reputation: 394
im trying to add lockscreen widget on 4.2 android emulator and each time i try to add it gets cut off like on this picture :
Layout of widget :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainWidgetLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000" />
Provider :
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:initialKeyguardLayout="@layout/fragment_widget_lock"
android:label="BatteryWidgetLockScrProvider"
android:updatePeriodMillis="1800000"
android:minWidth="300dp"
android:minHeight="300dp"
android:widgetCategory="keyguard"
/>
I tried using various values for minHeight , minWidth even ommiting them as it says in documentation. And nothing seems to stretch it until bottom. I also tried using relative layout for widget. You can see that widget holder next to it on the right in the picture is displaying system widget properly till the bottom of holder. I've also set up several emulators thinking maybe this is bugged.
Manifest is ok and receiver set up correctly.
I'm out of ideas. Any help welcome.
Upvotes: 1
Views: 1647
Reputation: 1006869
Add android:resizeMode="vertical"
to your <appwidget-provider>
element. The app widget docs suggest that this will make it fill the available vertical space.
Upvotes: 4