public class ScratchImageView
extends AppCompatImageView
| Modifier and Type | Class and Description |
|---|---|
static interface |
ScratchImageView.IRevealListener |
| Modifier and Type | Field and Description |
|---|---|
static float |
STROKE_WIDTH |
| Constructor and Description |
|---|
ScratchImageView(android.content.Context context) |
ScratchImageView(android.content.Context context,
android.util.AttributeSet set) |
ScratchImageView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clears the scratch area to reveal the hidden image.
|
int |
getColor() |
android.graphics.Paint |
getErasePaint() |
int[] |
getImageBounds() |
boolean |
isRevealed() |
protected void |
onDraw(android.graphics.Canvas canvas) |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
boolean |
onTouchEvent(android.view.MotionEvent event) |
void |
reveal() |
void |
setEraserMode() |
void |
setRevealListener(ScratchImageView.IRevealListener listener) |
void |
setStrokeWidth(int multiplier)
Set the strokes width based on the parameter multiplier.
|
public static final float STROKE_WIDTH
public ScratchImageView(android.content.Context context)
public ScratchImageView(android.content.Context context,
android.util.AttributeSet set)
public ScratchImageView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
public void setStrokeWidth(int multiplier)
multiplier - can be 1,2,3 and so on to set the stroke width of the paint.protected void onSizeChanged(int w,
int h,
int oldw,
int oldh)
protected void onDraw(android.graphics.Canvas canvas)
public void clear()
public void reveal()
public boolean onTouchEvent(android.view.MotionEvent event)
public int getColor()
public android.graphics.Paint getErasePaint()
public void setEraserMode()
public void setRevealListener(ScratchImageView.IRevealListener listener)
public boolean isRevealed()
public int[] getImageBounds()