Loading tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java +14 −4 Original line number Diff line number Diff line Loading @@ -85,15 +85,18 @@ import java.io.InputStream; // ------ Native Delegates ------ @LayoutlibDelegate /*package*/ static void nativeSetDefaultConfig(int nativeConfig) { // pass /*package*/ static Bitmap nativeDecodeStream(InputStream is, byte[] storage, Rect padding, Options opts) { return nativeDecodeStream(is, storage, padding, opts, false, 1.f); } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeStream(InputStream is, byte[] storage, Rect padding, Options opts) { Rect padding, Options opts, boolean applyScale, float scale) { Bitmap bm = null; //TODO support rescaling Density density = Density.MEDIUM; if (opts != null) { density = Density.getEnum(opts.inDensity); Loading Loading @@ -146,6 +149,13 @@ import java.io.InputStream; return null; } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeAsset(int asset, Rect padding, Options opts, boolean applyScale, float scale) { opts.inBitmap = null; return null; } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeByteArray(byte[] data, int offset, int length, Options opts) { Loading tools/layoutlib/bridge/src/android/view/ViewRootImpl_Delegate.java 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; /** * Delegate used to provide new implementation of a select few methods of {@link ViewRootImpl} * * Through the layoutlib_create tool, the original methods of ViewRootImpl have been replaced * by calls to methods of the same name in this delegate class. * */ public class ViewRootImpl_Delegate { @LayoutlibDelegate /*package*/ static boolean isInTouchMode() { return false; // this allows displaying selection. } } tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java +1 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,7 @@ public final class CreateInfo implements ICreateInfo { "android.view.LayoutInflater#rInflate", "android.view.LayoutInflater#parseInclude", "android.view.View#isInEditMode", "android.view.ViewRootImpl#isInTouchMode", "android.view.inputmethod.InputMethodManager#getInstance", "android.util.Log#println_native", "com.android.internal.util.XmlUtils#convertValueToInt", Loading Loading
tools/layoutlib/bridge/src/android/graphics/BitmapFactory_Delegate.java +14 −4 Original line number Diff line number Diff line Loading @@ -85,15 +85,18 @@ import java.io.InputStream; // ------ Native Delegates ------ @LayoutlibDelegate /*package*/ static void nativeSetDefaultConfig(int nativeConfig) { // pass /*package*/ static Bitmap nativeDecodeStream(InputStream is, byte[] storage, Rect padding, Options opts) { return nativeDecodeStream(is, storage, padding, opts, false, 1.f); } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeStream(InputStream is, byte[] storage, Rect padding, Options opts) { Rect padding, Options opts, boolean applyScale, float scale) { Bitmap bm = null; //TODO support rescaling Density density = Density.MEDIUM; if (opts != null) { density = Density.getEnum(opts.inDensity); Loading Loading @@ -146,6 +149,13 @@ import java.io.InputStream; return null; } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeAsset(int asset, Rect padding, Options opts, boolean applyScale, float scale) { opts.inBitmap = null; return null; } @LayoutlibDelegate /*package*/ static Bitmap nativeDecodeByteArray(byte[] data, int offset, int length, Options opts) { Loading
tools/layoutlib/bridge/src/android/view/ViewRootImpl_Delegate.java 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view; import com.android.tools.layoutlib.annotations.LayoutlibDelegate; /** * Delegate used to provide new implementation of a select few methods of {@link ViewRootImpl} * * Through the layoutlib_create tool, the original methods of ViewRootImpl have been replaced * by calls to methods of the same name in this delegate class. * */ public class ViewRootImpl_Delegate { @LayoutlibDelegate /*package*/ static boolean isInTouchMode() { return false; // this allows displaying selection. } }
tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java +1 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,7 @@ public final class CreateInfo implements ICreateInfo { "android.view.LayoutInflater#rInflate", "android.view.LayoutInflater#parseInclude", "android.view.View#isInEditMode", "android.view.ViewRootImpl#isInTouchMode", "android.view.inputmethod.InputMethodManager#getInstance", "android.util.Log#println_native", "com.android.internal.util.XmlUtils#convertValueToInt", Loading