public class ScratchTextView
extends AppCompatTextView
| Modifier and Type | Class and Description |
|---|---|
static interface |
ScratchTextView.IRevealListener |
| Modifier and Type | Field and Description |
|---|---|
static float |
STROKE_WIDTH |
| Constructor and Description |
|---|
ScratchTextView(android.content.Context context) |
ScratchTextView(android.content.Context context,
android.util.AttributeSet set) |
ScratchTextView(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
| Modifier and Type | Method and Description |
|---|---|
int |
getColor() |
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()
Reveals the hidden text by erasing the scratch area.
|
void |
setRevealListener(ScratchTextView.IRevealListener listener) |
void |
setStrokeWidth(int multiplier)
Set the strokes width based on the parameter multiplier.
|
public static final float STROKE_WIDTH
public ScratchTextView(android.content.Context context)
public ScratchTextView(android.content.Context context,
android.util.AttributeSet set)
public ScratchTextView(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 reveal()
public boolean onTouchEvent(android.view.MotionEvent event)
public int getColor()
public void setRevealListener(ScratchTextView.IRevealListener listener)
public boolean isRevealed()