I have achieved this in past projects by showing/hiding different views. Something like this in your updateView():
if (level > 90) {
thisViews.setViewVisibility(widget_frame01, View.VISIBLE);
thisViews.setViewVisibility(widget_frame02, View.GONE);
thisViews.setViewVisibility(widget_frame03, View.GONE);
} else if (level > 80) {
thisViews.setViewVisibility(widget_frame01, View.GONE);
thisViews.setViewVisibility(widget_frame02, View.VISIBLE);
thisViews.setViewVisibility(widget_frame03, View.GONE);
} else {
thisViews.setViewVisibility(widget_frame01, View.GONE);
thisViews.setViewVisibility(widget_frame02, View.GONE);
thisViews.setViewVisibility(widget_frame03, View.VISIBLE);
}
Then, in your xml, set all of the imageviews to android:visibility="GONE"
so that they are all hidden by default, otherwise you'll see a mess of images piled on top of each other for a second when you first set the widget:
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_frame01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/widget_batt_frame01"
android:visibility="GONE" />
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_frame02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/widget_batt_frame02"
android:visibility="GONE" />
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_frame03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/widget_batt_frame03"
android:visibility="GONE" />
It's not very elegant, but was the only way I could get it to work.