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

Commit d0dfe300 authored by Hyunyoung Song's avatar Hyunyoung Song
Browse files

Support fraction type for inset* for InsetDrawable.

b/36024318

Test: manually tested on default icons.
Test: $ runtest --path=cts/tests/tests/graphics/src/android/graphics/drawable/cts/InsetDrawableTest.java

adb  shell am instrument -e class 'android.graphics.drawable.cts.InsetDrawableTest' -w 'android.graphics.cts/android.support.test.runner.AndroidJUnitRunner'

android.graphics.drawable.cts.InsetDrawableTest:........................

Time: 0.132

OK (26 tests)

Change-Id: Ie8d24680b6884e65017f07723a371120f5ae610c
parent 61bce9ab
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -14168,7 +14168,9 @@ package android.graphics.drawable {
  public class InsetDrawable extends android.graphics.drawable.DrawableWrapper {
    ctor public InsetDrawable(android.graphics.drawable.Drawable, int);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, float);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, int, int, int, int);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, float, float, float, float);
  }
  public class LayerDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
+2 −0
Original line number Diff line number Diff line
@@ -14935,7 +14935,9 @@ package android.graphics.drawable {
  public class InsetDrawable extends android.graphics.drawable.DrawableWrapper {
    ctor public InsetDrawable(android.graphics.drawable.Drawable, int);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, float);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, int, int, int, int);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, float, float, float, float);
  }
  public class LayerDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
+2 −0
Original line number Diff line number Diff line
@@ -14212,7 +14212,9 @@ package android.graphics.drawable {
  public class InsetDrawable extends android.graphics.drawable.DrawableWrapper {
    ctor public InsetDrawable(android.graphics.drawable.Drawable, int);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, float);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, int, int, int, int);
    ctor public InsetDrawable(android.graphics.drawable.Drawable, float, float, float, float);
  }
  public class LayerDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback {
+8 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@android:color/white" />
    <foreground android:drawable="@mipmap/sym_def_app_icon_maskable" />
    <foreground>
        <inset android:insetLeft="27.7%"
            android:insetTop="27.7%"
            android:insetRight="27.7%"
            android:insetBottom="27.7%">
            <bitmap android:src="@mipmap/sym_def_app_icon"/>
        </inset>
    </foreground>
</adaptive-icon>
+5 −5
Original line number Diff line number Diff line
@@ -5752,11 +5752,11 @@
    <declare-styleable name="InsetDrawable">
        <attr name="visible" />
        <attr name="drawable" />
        <attr name="inset"  format="dimension"/>
        <attr name="insetLeft" format="dimension" />
        <attr name="insetRight" format="dimension" />
        <attr name="insetTop" format="dimension" />
        <attr name="insetBottom" format="dimension" />
        <attr name="inset"  format="fraction|dimension"/>
        <attr name="insetLeft" format="fraction|dimension" />
        <attr name="insetRight" format="fraction|dimension" />
        <attr name="insetTop" format="fraction|dimension" />
        <attr name="insetBottom" format="fraction|dimension" />
    </declare-styleable>

    <!-- Drawable used to draw bitmaps. -->
Loading