Loading api/current.xml +65 −0 Original line number Diff line number Diff line Loading @@ -7924,6 +7924,17 @@ visibility="public" > </field> <field name="resizeMode" type="int" transient="false" volatile="false" value="16843619" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="resizeable" type="int" transient="false" Loading Loading @@ -39802,6 +39813,50 @@ visibility="public" > </field> <field name="RESIZE_BOTH" type="int" transient="false" volatile="false" value="3" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="RESIZE_HORIZONTAL" type="int" transient="false" volatile="false" value="1" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="RESIZE_NONE" type="int" transient="false" volatile="false" value="0" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="RESIZE_VERTICAL" type="int" transient="false" volatile="false" value="2" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="autoAdvanceViewId" type="int" transient="false" Loading Loading @@ -39892,6 +39947,16 @@ visibility="public" > </field> <field name="resizableMode" type="int" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="updatePeriodMillis" type="int" transient="false" core/java/android/appwidget/AppWidgetHost.java +17 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.appwidget; import java.util.ArrayList; import java.util.HashMap; import android.content.Context; import android.os.Handler; import android.os.IBinder; Loading @@ -23,11 +26,10 @@ import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.os.ServiceManager; import android.util.DisplayMetrics; import android.util.TypedValue; import android.widget.RemoteViews; import java.util.ArrayList; import java.util.HashMap; import com.android.internal.appwidget.IAppWidgetHost; import com.android.internal.appwidget.IAppWidgetService; Loading @@ -43,6 +45,7 @@ public class AppWidgetHost { final static Object sServiceLock = new Object(); static IAppWidgetService sService; private DisplayMetrics mDisplayMetrics; Context mContext; String mPackageName; Loading Loading @@ -103,6 +106,7 @@ public class AppWidgetHost { mContext = context; mHostId = hostId; mHandler = new UpdateHandler(context.getMainLooper()); mDisplayMetrics = context.getResources().getDisplayMetrics(); synchronized (sServiceLock) { if (sService == null) { IBinder b = ServiceManager.getService(Context.APPWIDGET_SERVICE); Loading Loading @@ -249,6 +253,15 @@ public class AppWidgetHost { */ protected void onProviderChanged(int appWidgetId, AppWidgetProviderInfo appWidget) { AppWidgetHostView v; // Convert complex to dp -- we are getting the AppWidgetProviderInfo from the // AppWidgetService, which doesn't have our context, hence we need to do the // conversion here. appWidget.minWidth = TypedValue.complexToDimensionPixelSize(appWidget.minWidth, mDisplayMetrics); appWidget.minHeight = TypedValue.complexToDimensionPixelSize(appWidget.minHeight, mDisplayMetrics); synchronized (mViews) { v = mViews.get(appWidgetId); } Loading core/java/android/appwidget/AppWidgetProviderInfo.java +27 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,24 @@ import android.content.ComponentName; * correspond to the fields in the <code><appwidget-provider></code> xml tag. */ public class AppWidgetProviderInfo implements Parcelable { /** * Widget is not resizable. */ public static final int RESIZE_NONE = 0; /** * Widget is resizable in the horizontal axis only. */ public static final int RESIZE_HORIZONTAL = 1; /** * Widget is resizable in the vertical axis only. */ public static final int RESIZE_VERTICAL = 2; /** * Widget is resizable in both the horizontal and vertical axes. */ public static final int RESIZE_BOTH = RESIZE_HORIZONTAL | RESIZE_VERTICAL; /** * Identity of this AppWidget component. This component should be a {@link * android.content.BroadcastReceiver}, and it will be sent the AppWidget intents Loading Loading @@ -124,6 +142,13 @@ public class AppWidgetProviderInfo implements Parcelable { */ public int previewImage; /** * The rules by which a widget can be resized. See {@link #RESIZE_NONE}, * {@link #RESIZE_NONE}, {@link #RESIZE_HORIZONTAL}, * {@link #RESIZE_VERTICAL}, {@link #RESIZE_BOTH}. */ public int resizableMode; public AppWidgetProviderInfo() { } Loading @@ -145,6 +170,7 @@ public class AppWidgetProviderInfo implements Parcelable { this.icon = in.readInt(); this.previewImage = in.readInt(); this.autoAdvanceViewId = in.readInt(); this.resizableMode = in.readInt(); } public void writeToParcel(android.os.Parcel out, int flags) { Loading @@ -168,6 +194,7 @@ public class AppWidgetProviderInfo implements Parcelable { out.writeInt(this.icon); out.writeInt(this.previewImage); out.writeInt(this.autoAdvanceViewId); out.writeInt(this.resizableMode); } public int describeContents() { Loading core/res/res/values/attrs.xml +7 −0 Original line number Diff line number Diff line Loading @@ -4549,6 +4549,13 @@ <!-- The view id of the AppWidget subview which should be auto-advanced. by the widget's host. --> <attr name="autoAdvanceViewId" format="reference" /> <!-- Optional parameter which indicates if and how this widget can be resized. --> <attr name="resizeMode" format="integer"> <flag name="none" value="0x0" /> <flag name="horizontal" value="0x1" /> <flag name="vertical" value="0x2" /> </attr> </declare-styleable> <!-- =============================== --> Loading core/res/res/values/public.xml +2 −1 Original line number Diff line number Diff line Loading @@ -1647,4 +1647,5 @@ =============================================================== --> <eat-comment /> <public type="attr" name="textCursorDrawable" id="0x01010362" /> <public type="attr" name="resizeMode" /> </resources> Loading
api/current.xml +65 −0 Original line number Diff line number Diff line Loading @@ -7924,6 +7924,17 @@ visibility="public" > </field> <field name="resizeMode" type="int" transient="false" volatile="false" value="16843619" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="resizeable" type="int" transient="false" Loading Loading @@ -39802,6 +39813,50 @@ visibility="public" > </field> <field name="RESIZE_BOTH" type="int" transient="false" volatile="false" value="3" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="RESIZE_HORIZONTAL" type="int" transient="false" volatile="false" value="1" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="RESIZE_NONE" type="int" transient="false" volatile="false" value="0" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="RESIZE_VERTICAL" type="int" transient="false" volatile="false" value="2" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> <field name="autoAdvanceViewId" type="int" transient="false" Loading Loading @@ -39892,6 +39947,16 @@ visibility="public" > </field> <field name="resizableMode" type="int" transient="false" volatile="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </field> <field name="updatePeriodMillis" type="int" transient="false"
core/java/android/appwidget/AppWidgetHost.java +17 −4 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.appwidget; import java.util.ArrayList; import java.util.HashMap; import android.content.Context; import android.os.Handler; import android.os.IBinder; Loading @@ -23,11 +26,10 @@ import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.os.ServiceManager; import android.util.DisplayMetrics; import android.util.TypedValue; import android.widget.RemoteViews; import java.util.ArrayList; import java.util.HashMap; import com.android.internal.appwidget.IAppWidgetHost; import com.android.internal.appwidget.IAppWidgetService; Loading @@ -43,6 +45,7 @@ public class AppWidgetHost { final static Object sServiceLock = new Object(); static IAppWidgetService sService; private DisplayMetrics mDisplayMetrics; Context mContext; String mPackageName; Loading Loading @@ -103,6 +106,7 @@ public class AppWidgetHost { mContext = context; mHostId = hostId; mHandler = new UpdateHandler(context.getMainLooper()); mDisplayMetrics = context.getResources().getDisplayMetrics(); synchronized (sServiceLock) { if (sService == null) { IBinder b = ServiceManager.getService(Context.APPWIDGET_SERVICE); Loading Loading @@ -249,6 +253,15 @@ public class AppWidgetHost { */ protected void onProviderChanged(int appWidgetId, AppWidgetProviderInfo appWidget) { AppWidgetHostView v; // Convert complex to dp -- we are getting the AppWidgetProviderInfo from the // AppWidgetService, which doesn't have our context, hence we need to do the // conversion here. appWidget.minWidth = TypedValue.complexToDimensionPixelSize(appWidget.minWidth, mDisplayMetrics); appWidget.minHeight = TypedValue.complexToDimensionPixelSize(appWidget.minHeight, mDisplayMetrics); synchronized (mViews) { v = mViews.get(appWidgetId); } Loading
core/java/android/appwidget/AppWidgetProviderInfo.java +27 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,24 @@ import android.content.ComponentName; * correspond to the fields in the <code><appwidget-provider></code> xml tag. */ public class AppWidgetProviderInfo implements Parcelable { /** * Widget is not resizable. */ public static final int RESIZE_NONE = 0; /** * Widget is resizable in the horizontal axis only. */ public static final int RESIZE_HORIZONTAL = 1; /** * Widget is resizable in the vertical axis only. */ public static final int RESIZE_VERTICAL = 2; /** * Widget is resizable in both the horizontal and vertical axes. */ public static final int RESIZE_BOTH = RESIZE_HORIZONTAL | RESIZE_VERTICAL; /** * Identity of this AppWidget component. This component should be a {@link * android.content.BroadcastReceiver}, and it will be sent the AppWidget intents Loading Loading @@ -124,6 +142,13 @@ public class AppWidgetProviderInfo implements Parcelable { */ public int previewImage; /** * The rules by which a widget can be resized. See {@link #RESIZE_NONE}, * {@link #RESIZE_NONE}, {@link #RESIZE_HORIZONTAL}, * {@link #RESIZE_VERTICAL}, {@link #RESIZE_BOTH}. */ public int resizableMode; public AppWidgetProviderInfo() { } Loading @@ -145,6 +170,7 @@ public class AppWidgetProviderInfo implements Parcelable { this.icon = in.readInt(); this.previewImage = in.readInt(); this.autoAdvanceViewId = in.readInt(); this.resizableMode = in.readInt(); } public void writeToParcel(android.os.Parcel out, int flags) { Loading @@ -168,6 +194,7 @@ public class AppWidgetProviderInfo implements Parcelable { out.writeInt(this.icon); out.writeInt(this.previewImage); out.writeInt(this.autoAdvanceViewId); out.writeInt(this.resizableMode); } public int describeContents() { Loading
core/res/res/values/attrs.xml +7 −0 Original line number Diff line number Diff line Loading @@ -4549,6 +4549,13 @@ <!-- The view id of the AppWidget subview which should be auto-advanced. by the widget's host. --> <attr name="autoAdvanceViewId" format="reference" /> <!-- Optional parameter which indicates if and how this widget can be resized. --> <attr name="resizeMode" format="integer"> <flag name="none" value="0x0" /> <flag name="horizontal" value="0x1" /> <flag name="vertical" value="0x2" /> </attr> </declare-styleable> <!-- =============================== --> Loading
core/res/res/values/public.xml +2 −1 Original line number Diff line number Diff line Loading @@ -1647,4 +1647,5 @@ =============================================================== --> <eat-comment /> <public type="attr" name="textCursorDrawable" id="0x01010362" /> <public type="attr" name="resizeMode" /> </resources>