Loading tools/layoutlib/bridge/src/android/animation/PropertyValuesHolder_Delegate.java +5 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.animation; import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; /** * Delegate implementing the native methods of android.animation.PropertyValuesHolder Loading @@ -34,20 +35,24 @@ import com.android.layoutlib.bridge.impl.DelegateManager; */ /*package*/ class PropertyValuesHolder_Delegate { @LayoutlibDelegate /*package*/ static int nGetIntMethod(Class<?> targetClass, String methodName) { // return 0 to force PropertyValuesHolder to use Java reflection. return 0; } @LayoutlibDelegate /*package*/ static int nGetFloatMethod(Class<?> targetClass, String methodName) { // return 0 to force PropertyValuesHolder to use Java reflection. return 0; } @LayoutlibDelegate /*package*/ static void nCallIntMethod(Object target, int methodID, int arg) { // do nothing } @LayoutlibDelegate /*package*/ static void nCallFloatMethod(Object target, int methodID, float arg) { // do nothing } Loading tools/layoutlib/bridge/src/android/app/Fragment_Delegate.java +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.app; import com.android.ide.common.rendering.api.IProjectCallback; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import android.content.Context; import android.os.Bundle; Loading Loading @@ -48,6 +49,7 @@ public class Fragment_Delegate { * Like {@link #instantiate(Context, String, Bundle)} but with a null * argument Bundle. */ @LayoutlibDelegate /*package*/ static Fragment instantiate(Context context, String fname) { return instantiate(context, fname, null); } Loading @@ -66,6 +68,7 @@ public class Fragment_Delegate { * the given fragment class. This is a runtime exception; it is not * normally expected to happen. */ @LayoutlibDelegate /*package*/ static Fragment instantiate(Context context, String fname, Bundle args) { try { if (sProjectCallback != null) { Loading tools/layoutlib/bridge/src/android/content/res/Resources_Theme_Delegate.java +5 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.content.res; import com.android.layoutlib.bridge.impl.RenderSessionImpl; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import android.content.res.Resources.NotFoundException; import android.content.res.Resources.Theme; Loading @@ -32,12 +33,14 @@ import android.util.TypedValue; */ public class Resources_Theme_Delegate { @LayoutlibDelegate /*package*/ static TypedArray obtainStyledAttributes( Resources thisResources, Theme thisTheme, int[] attrs) { return RenderSessionImpl.getCurrentContext().obtainStyledAttributes(attrs); } @LayoutlibDelegate /*package*/ static TypedArray obtainStyledAttributes( Resources thisResources, Theme thisTheme, int resid, int[] attrs) Loading @@ -45,6 +48,7 @@ public class Resources_Theme_Delegate { return RenderSessionImpl.getCurrentContext().obtainStyledAttributes(resid, attrs); } @LayoutlibDelegate /*package*/ static TypedArray obtainStyledAttributes( Resources thisResources, Theme thisTheme, AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) { Loading @@ -52,6 +56,7 @@ public class Resources_Theme_Delegate { set, attrs, defStyleAttr, defStyleRes); } @LayoutlibDelegate /*package*/ static boolean resolveAttribute( Resources thisResources, Theme thisTheme, int resid, TypedValue outValue, Loading tools/layoutlib/bridge/src/android/graphics/AvoidXfermode_Delegate.java +2 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.graphics; import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import java.awt.Composite; Loading Loading @@ -59,6 +60,7 @@ public class AvoidXfermode_Delegate extends Xfermode_Delegate { // ---- native methods ---- @LayoutlibDelegate /*package*/ static int nativeCreate(int opColor, int tolerance, int nativeMode) { AvoidXfermode_Delegate newDelegate = new AvoidXfermode_Delegate(); return sManager.addDelegate(newDelegate); Loading tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java +9 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import com.android.layoutlib.bridge.android.BridgeResources.NinePatchInputStream import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.ninepatch.NinePatchChunk; import com.android.resources.Density; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import android.graphics.BitmapFactory.Options; Loading @@ -42,6 +43,7 @@ import java.io.InputStream; // ------ Java delegates ------ @LayoutlibDelegate /*package*/ static Bitmap finishDecode(Bitmap bm, Rect outPadding, Options opts) { if (bm == null || opts == null) { return bm; Loading Loading @@ -82,10 +84,12 @@ import java.io.InputStream; // ------ Native Delegates ------ @LayoutlibDelegate /*package*/ static void nativeSetDefaultConfig(int nativeConfig) { // pass } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeStream(InputStream is, byte[] storage, Rect padding, Options opts) { Bitmap bm = null; Loading Loading @@ -129,29 +133,34 @@ import java.io.InputStream; return bm; } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeFileDescriptor(FileDescriptor fd, Rect padding, Options opts) { opts.inBitmap = null; return null; } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeAsset(int asset, Rect padding, Options opts) { opts.inBitmap = null; return null; } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeByteArray(byte[] data, int offset, int length, Options opts) { opts.inBitmap = null; return null; } @LayoutlibDelegate /*package*/ static byte[] nativeScaleNinePatch(byte[] chunk, float scale, Rect pad) { // don't scale for now. This should not be called anyway since we re-implement // BitmapFactory.finishDecode(); return chunk; } @LayoutlibDelegate /*package*/ static boolean nativeIsSeekable(FileDescriptor fd) { return true; } Loading Loading
tools/layoutlib/bridge/src/android/animation/PropertyValuesHolder_Delegate.java +5 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.animation; import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; /** * Delegate implementing the native methods of android.animation.PropertyValuesHolder Loading @@ -34,20 +35,24 @@ import com.android.layoutlib.bridge.impl.DelegateManager; */ /*package*/ class PropertyValuesHolder_Delegate { @LayoutlibDelegate /*package*/ static int nGetIntMethod(Class<?> targetClass, String methodName) { // return 0 to force PropertyValuesHolder to use Java reflection. return 0; } @LayoutlibDelegate /*package*/ static int nGetFloatMethod(Class<?> targetClass, String methodName) { // return 0 to force PropertyValuesHolder to use Java reflection. return 0; } @LayoutlibDelegate /*package*/ static void nCallIntMethod(Object target, int methodID, int arg) { // do nothing } @LayoutlibDelegate /*package*/ static void nCallFloatMethod(Object target, int methodID, float arg) { // do nothing } Loading
tools/layoutlib/bridge/src/android/app/Fragment_Delegate.java +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.app; import com.android.ide.common.rendering.api.IProjectCallback; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import android.content.Context; import android.os.Bundle; Loading Loading @@ -48,6 +49,7 @@ public class Fragment_Delegate { * Like {@link #instantiate(Context, String, Bundle)} but with a null * argument Bundle. */ @LayoutlibDelegate /*package*/ static Fragment instantiate(Context context, String fname) { return instantiate(context, fname, null); } Loading @@ -66,6 +68,7 @@ public class Fragment_Delegate { * the given fragment class. This is a runtime exception; it is not * normally expected to happen. */ @LayoutlibDelegate /*package*/ static Fragment instantiate(Context context, String fname, Bundle args) { try { if (sProjectCallback != null) { Loading
tools/layoutlib/bridge/src/android/content/res/Resources_Theme_Delegate.java +5 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.content.res; import com.android.layoutlib.bridge.impl.RenderSessionImpl; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import android.content.res.Resources.NotFoundException; import android.content.res.Resources.Theme; Loading @@ -32,12 +33,14 @@ import android.util.TypedValue; */ public class Resources_Theme_Delegate { @LayoutlibDelegate /*package*/ static TypedArray obtainStyledAttributes( Resources thisResources, Theme thisTheme, int[] attrs) { return RenderSessionImpl.getCurrentContext().obtainStyledAttributes(attrs); } @LayoutlibDelegate /*package*/ static TypedArray obtainStyledAttributes( Resources thisResources, Theme thisTheme, int resid, int[] attrs) Loading @@ -45,6 +48,7 @@ public class Resources_Theme_Delegate { return RenderSessionImpl.getCurrentContext().obtainStyledAttributes(resid, attrs); } @LayoutlibDelegate /*package*/ static TypedArray obtainStyledAttributes( Resources thisResources, Theme thisTheme, AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) { Loading @@ -52,6 +56,7 @@ public class Resources_Theme_Delegate { set, attrs, defStyleAttr, defStyleRes); } @LayoutlibDelegate /*package*/ static boolean resolveAttribute( Resources thisResources, Theme thisTheme, int resid, TypedValue outValue, Loading
tools/layoutlib/bridge/src/android/graphics/AvoidXfermode_Delegate.java +2 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.graphics; import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import java.awt.Composite; Loading Loading @@ -59,6 +60,7 @@ public class AvoidXfermode_Delegate extends Xfermode_Delegate { // ---- native methods ---- @LayoutlibDelegate /*package*/ static int nativeCreate(int opColor, int tolerance, int nativeMode) { AvoidXfermode_Delegate newDelegate = new AvoidXfermode_Delegate(); return sManager.addDelegate(newDelegate); Loading
tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java +9 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import com.android.layoutlib.bridge.android.BridgeResources.NinePatchInputStream import com.android.layoutlib.bridge.impl.DelegateManager; import com.android.ninepatch.NinePatchChunk; import com.android.resources.Density; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; import android.graphics.BitmapFactory.Options; Loading @@ -42,6 +43,7 @@ import java.io.InputStream; // ------ Java delegates ------ @LayoutlibDelegate /*package*/ static Bitmap finishDecode(Bitmap bm, Rect outPadding, Options opts) { if (bm == null || opts == null) { return bm; Loading Loading @@ -82,10 +84,12 @@ import java.io.InputStream; // ------ Native Delegates ------ @LayoutlibDelegate /*package*/ static void nativeSetDefaultConfig(int nativeConfig) { // pass } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeStream(InputStream is, byte[] storage, Rect padding, Options opts) { Bitmap bm = null; Loading Loading @@ -129,29 +133,34 @@ import java.io.InputStream; return bm; } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeFileDescriptor(FileDescriptor fd, Rect padding, Options opts) { opts.inBitmap = null; return null; } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeAsset(int asset, Rect padding, Options opts) { opts.inBitmap = null; return null; } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeByteArray(byte[] data, int offset, int length, Options opts) { opts.inBitmap = null; return null; } @LayoutlibDelegate /*package*/ static byte[] nativeScaleNinePatch(byte[] chunk, float scale, Rect pad) { // don't scale for now. This should not be called anyway since we re-implement // BitmapFactory.finishDecode(); return chunk; } @LayoutlibDelegate /*package*/ static boolean nativeIsSeekable(FileDescriptor fd) { return true; } Loading