This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.graphics.drawable.Drawable | |
import android.util.AttributeSet | |
import android.view.View | |
import android.view.ViewGroup | |
import android.view.animation.AnimationUtils | |
import android.widget.ImageView | |
import android.widget.ViewSwitcher | |
import com.bumptech.glide.load.DataSource | |
import com.bumptech.glide.load.engine.GlideException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.graphics.Color; | |
import android.graphics.drawable.GradientDrawable; | |
import android.support.annotation.Nullable; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.view.ViewPropertyAnimator; | |
import static android.graphics.drawable.GradientDrawable.LINEAR_GRADIENT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ViewAnimationUtils { | |
public static AnimatorSet createLinearReveal(final View viewToReveal, final int offsetWidth, final int offsetHeight, final int duration) { | |
viewToReveal.clearAnimation(); | |
final int targetWidth = viewToReveal.getMeasuredWidth(); | |
final int targetHeight = viewToReveal.getMeasuredHeight(); | |
viewToReveal.getLayoutParams().height = offsetHeight; | |
viewToReveal.requestLayout(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ScratchView extends View { | |
private static final float DRAWING_PAINT_STROKE_WIDTH = 75f; | |
private static final int DRAWING_MOVE_TOLERANCE = 10; | |
private static final double SCRATCHED_RATIO = 90.0; | |
private static final float DEFAULT_SCALE = 1f; | |
private Path mDrawingPath; | |
private Paint mDrawingPaint; | |
private Paint mBitmapPaint; | |
private Canvas mDrawingCanvas; |