From 3030193dc179b3010f2dd3bffe9c1dec54da38fc Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Wed, 16 Jun 2010 18:32:00 -0700 Subject: Removed warnings in LayoutInflater. These changes are similar to those of CL 49296. They do not include the generic fixes done on GenericInflater.java, which had issues and broke the build. Added a asSubClass method in LayoutInflater which will (correctly) throw a ClassCastException when the inflated class is not a View subclass. Performance testing on these changes showed a 10% performance improvement, which is still to be explained. Change-Id: Id4d3b45f0945baccdbbda15fcce095e855b23c9a --- core/java/android/appwidget/AppWidgetHostView.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/java/android/appwidget') diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java index 5375193..f372529 100644 --- a/core/java/android/appwidget/AppWidgetHostView.java +++ b/core/java/android/appwidget/AppWidgetHostView.java @@ -23,9 +23,9 @@ import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; -import android.os.SystemClock; -import android.os.Parcelable; import android.os.Parcel; +import android.os.Parcelable; +import android.os.SystemClock; import android.util.AttributeSet; import android.util.Log; import android.util.SparseArray; @@ -58,7 +58,7 @@ public class AppWidgetHostView extends FrameLayout { // When we're inflating the initialLayout for a AppWidget, we only allow // views that are allowed in RemoteViews. static final LayoutInflater.Filter sInflaterFilter = new LayoutInflater.Filter() { - public boolean onLoadClass(Class clazz) { + public boolean onLoadClass(Class clazz) { return clazz.isAnnotationPresent(RemoteViews.RemoteView.class); } }; @@ -276,6 +276,7 @@ public class AppWidgetHostView extends FrameLayout { } } + @Override protected boolean drawChild(Canvas canvas, View child, long drawingTime) { if (CROSSFADE) { int alpha; -- cgit v1.1