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

Commit 034d10bf authored by Deepanshu Gupta's avatar Deepanshu Gupta Committed by Android Git Automerger
Browse files

am e5d3baf2: LayoutLib: Fix bitmap scaling.

* commit 'e5d3baf2':
  LayoutLib: Fix bitmap scaling.
parents dd62fb43 e5d3baf2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.content.res;

import com.android.SdkConstants;
import com.android.ide.common.rendering.api.ArrayResourceValue;
import com.android.ide.common.rendering.api.DensityBasedResourceValue;
import com.android.ide.common.rendering.api.LayoutLog;
import com.android.ide.common.rendering.api.LayoutlibCallback;
import com.android.ide.common.rendering.api.ResourceValue;
@@ -661,13 +662,18 @@ public final class BridgeResources extends Resources {
        Pair<String, ResourceValue> value = getResourceValue(id, mPlatformResourceFlag);

        if (value != null) {
            String v = value.getSecond().getValue();
            ResourceValue resVal = value.getSecond();
            String v = resVal.getValue();

            if (v != null) {
                if (ResourceHelper.parseFloatAttribute(value.getFirst(), v, outValue,
                        false /*requireUnit*/)) {
                    return;
                }
                if (resVal instanceof DensityBasedResourceValue) {
                    outValue.density =
                      ((DensityBasedResourceValue) resVal).getResourceDensity().getDpiValue();
                }

                // else it's a string
                outValue.type = TypedValue.TYPE_STRING;
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ import java.util.Set;
            if (opts.inPremultiplied) {
                bitmapCreateFlags.add(BitmapCreateFlags.PREMULTIPLIED);
            }
            opts.inScaled = false;
        }

        try {