Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3e586af authored by Xavier Ducrohet's avatar Xavier Ducrohet Committed by Android (Google) Code Review
Browse files

Merge "LayoutLib: Properly compute available space to layouts." into honeycomb

parents 0a5481db 16584225
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,5 +8,6 @@
	<classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_PLAT_SRC/dalvik/libcore/xml/src/main/java"/>
	<classpathentry kind="var" path="ANDROID_PLAT_SRC/out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar" sourcepath="/ANDROID_PLAT_SRC/frameworks/base"/>
	<classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/ninepatch/ninepatch-prebuilt.jar"/>
	<classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/resources/resources-prebuilt.jar"/>
	<classpathentry kind="output" path="bin"/>
</classpath>
+2 −1
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@ LOCAL_SRC_FILES := $(call all-java-files-under,src)

LOCAL_JAVA_LIBRARIES := \
	kxml2-2.3.0 \
	layoutlib_api-prebuilt
	layoutlib_api-prebuilt \
	resources-prebuilt

LOCAL_STATIC_JAVA_LIBRARIES := \
	temp_layoutlib \
+3 −3
Original line number Diff line number Diff line
@@ -17,8 +17,8 @@
package android.graphics;

import com.android.ide.common.rendering.api.LayoutLog;
import com.android.ide.common.rendering.api.ResourceDensity;
import com.android.layoutlib.bridge.Bridge;
import com.android.resources.Density;

import android.content.res.AssetManager;
import android.content.res.Resources;
@@ -462,9 +462,9 @@ public class BitmapFactory {
            // into is.read(...) This number is not related to the value passed
            // to mark(...) above.
            try {
                ResourceDensity density = ResourceDensity.MEDIUM;
                Density density = Density.MEDIUM;
                if (opts != null) {
                    density = ResourceDensity.getEnum(opts.inDensity);
                    density = Density.getEnum(opts.inDensity);
                }
                bm = Bitmap_Delegate.createBitmap(is, true, density);
            } catch (IOException e) {
+8 −8
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@
package android.graphics;

import com.android.ide.common.rendering.api.LayoutLog;
import com.android.ide.common.rendering.api.ResourceDensity;
import com.android.layoutlib.bridge.Bridge;
import com.android.layoutlib.bridge.impl.DelegateManager;
import com.android.resources.Density;

import android.graphics.Bitmap.Config;
import android.os.Parcel;
@@ -89,12 +89,12 @@ public final class Bitmap_Delegate {
     * @see Bitmap#isMutable()
     * @see Bitmap#getDensity()
     */
    public static Bitmap createBitmap(File input, boolean isMutable, ResourceDensity density)
    public static Bitmap createBitmap(File input, boolean isMutable, Density density)
            throws IOException {
        // create a delegate with the content of the file.
        Bitmap_Delegate delegate = new Bitmap_Delegate(ImageIO.read(input), Config.ARGB_8888);

        return createBitmap(delegate, isMutable, density.getDpi());
        return createBitmap(delegate, isMutable, density.getDpiValue());
    }

    /**
@@ -107,12 +107,12 @@ public final class Bitmap_Delegate {
     * @see Bitmap#isMutable()
     * @see Bitmap#getDensity()
     */
    public static Bitmap createBitmap(InputStream input, boolean isMutable, ResourceDensity density)
    public static Bitmap createBitmap(InputStream input, boolean isMutable, Density density)
            throws IOException {
        // create a delegate with the content of the stream.
        Bitmap_Delegate delegate = new Bitmap_Delegate(ImageIO.read(input), Config.ARGB_8888);

        return createBitmap(delegate, isMutable, density.getDpi());
        return createBitmap(delegate, isMutable, density.getDpiValue());
    }

    /**
@@ -126,11 +126,11 @@ public final class Bitmap_Delegate {
     * @see Bitmap#getDensity()
     */
    public static Bitmap createBitmap(BufferedImage image, boolean isMutable,
            ResourceDensity density) throws IOException {
            Density density) throws IOException {
        // create a delegate with the given image.
        Bitmap_Delegate delegate = new Bitmap_Delegate(image, Config.ARGB_8888);

        return createBitmap(delegate, isMutable, density.getDpi());
        return createBitmap(delegate, isMutable, density.getDpiValue());
    }

    /**
@@ -425,7 +425,7 @@ public final class Bitmap_Delegate {

        // the density doesn't matter, it's set by the Java method.
        return createBitmap(delegate, false /*isMutable*/,
                ResourceDensity.DEFAULT_DENSITY /*density*/);
                Density.DEFAULT_DENSITY /*density*/);
    }

    /*package*/ static void nativePrepareToDraw(int nativeBitmap) {
+5 −0
Original line number Diff line number Diff line
@@ -55,6 +55,11 @@ public class BridgeRenderSession extends RenderSession {
        return mSession.getImage();
    }

    @Override
    public boolean isAlphaChannelImage() {
        return mSession.isAlphaChannelImage();
    }

    @Override
    public List<ViewInfo> getRootViews() {
        return mSession.getViewInfos();
Loading