whats new in ics

Resizable widgets in ics

Search for: Resizable widgets in ics

Here is a quick little video on youtube how this feature is used

This video demonstrates that the widgets are

scrollable
resizable

<appwidget-provider 
xmlns:android="http://schemas.android.com/apk/res/android"    
android:minWidth="294dp"    
android:minHeight="72dp"    
android:updatePeriodMillis="86400000"    
android:previewImage="@drawable/preview"    
android:initialLayout="@layout/example_appwidget"    
android:configure="com.example.android.ExampleAppWidgetConfigure"     
android:resizeMode="horizontal|vertical">
</appwidget-provider>

The resizeMode attribute specifies the rules by which a widget can be resized. You use this attribute to make homescreen widgets resizeable?horizontally, vertically, or on both axes. Users touch-hold a widget to show its resize handles, then drag the horizontal and/or vertical handles to change the size on the layout grid. Values for the resizeMode attribute include "horizontal", "vertical", and "none". To declare a widget as resizeable horizontally and vertically, supply the value "horizontal|vertical". Introduced in Android 3.1.

Image preview is new in 3.0 for widgets

Previously you long click on the home page to navigate to your widgets. In ICS the widgets is a tab on the list of applications activity. So click on "apps" on the home page. You will see a tab then called "widgets". Again this is the emulator. On a real device there may be more variations.

what is autoAdvacneViewId?

Search for: what is autoAdvacneViewId?

Yes. you can set the resizing to none, or horizontal, or vertical or a combination there of.

However to take adavantage of this, your widget controls should be laid out such a way that they can expand and contract using their layout parameters.

There is no callback to tell you what size your widget is. The update is not triggered, at leas the documentation doesn't hint of such a fact.

auto advance StackView

Search for: auto advance StackView

The key to understandign auto advance is to understand the adapter view animator

when you set this, this is the icon you see in the widget list for you to pick. If you don't set this you will see your widge applications icon that is set in the manifest file for your application or package.

The emulator seem to cache this preview even if you uninstall and reinstall the package. You may want to restart your emulator to see this effect.

Emulator also provides a way to take a screen shot of your widget look by explicitly invoking the configurator and capture the resulting widget view. You can invoke this application by looking at the app list and locating the widget preview. This app will then allow you to choose the widget that you want to preview at which time you will see the widget configurator to kick in. At the end you will see a sample widget view. the widget preview application then will allow you take a screen shot and send you an email of the file.

Or you can just provide any iconified preview image instead. that is all there is to this preview idea. Just an icon. How you get it is upto you.