Back to project page drive-android-svg.
The source code is released under:
Apache License
If you think the Android project drive-android-svg listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.goodow.drive.android.svg.view; //w ww . j a v a 2 s.c om import android.graphics.Canvas; import android.graphics.drawable.Drawable; import android.graphics.drawable.InsetDrawable; /** * Created by liudenghui on 14-6-19. */ public class MyDrawable extends InsetDrawable { public MyDrawable(Drawable drawable) { super(drawable, 0); } private float mOffset; private float mPosition; public void setmOffset(float offset) { mOffset = offset; } public void setPosition(float position) { mPosition = position; invalidateSelf(); } @Override public void draw(Canvas canvas) { canvas.save(); canvas.translate(-mOffset * getBounds().width() * mPosition, 0); super.draw(canvas); canvas.restore(); } }