How to move ChildDrawable in LayerDrawable
<p>here is my code</p>

<pre><code>protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test_layer_drawable2);
    ImageView i = (ImageView) findViewById(R.id.i);
    LayerDrawable ld = new LayerDrawable(new Drawable[]{dra(this, R.drawable.ic_insert_drive_file_black_48dp), new Rect()});
    ld.setLayerInsetTop(1, 200);
    ld.setLayerInsetLeft(1, 200);
    i.setImageDrawable(ld);
}
</code></pre>

<p>here is Rect</p>

<pre><code>class Rect extends Drawable {
        Context c;

        @Override
        public void draw(Canvas canvas) {
            c = getApplicationContext();
            Paint p = new Paint();
            p.setStrokeWidth(2);
            p.setStyle(Paint.Style.STROKE);
            p.setColor(col(c, R.color.colorAccent));
            canvas.drawRect(100, 100, 200, 200, p);
        }

        @Override
        public void setAlpha(int alpha) {

        }

        @Override
        public void setColorFilter(ColorFilter colorFilter) {

        }

        @Override
        public int getOpacity() {
            return 0;
        }
    }
</code></pre>

<p>the output is:</p>

<p><a href="https://i.stack.imgur.com/dznlP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dznlP.png" alt="enter image description here"></a></p>

<p>I hope move rectangle to the right-bottom of ImageView, how to do that?</p>

<p>when i use <code>setLayerInsetTop</code>, it only change rectangle's size</p>