Skip to content

Commit 406a78e

Browse files
default tile mode CLAMP
1 parent 3291f69 commit 406a78e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/src/main/res/layout/activity_main.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
android:id="@+id/scratch_view"
1818
android:layout_width="300dp"
1919
android:layout_height="300dp"
20-
app:overlay_image="@drawable/scratch_card"
2120
app:tile_mode="CLAMP"
2221
app:overlay_width="300dp"
2322
app:overlay_height="300dp"

scratchview/src/main/java/com/anupkumarpanwar/scratchview/ScratchView.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ private void init() {
159159

160160

161161
String tileMode = arr.getString(R.styleable.ScratchView_tile_mode);
162+
if (tileMode == null) {
163+
tileMode = "CLAMP";
164+
}
162165

163166
Bitmap scratchBitmap = BitmapFactory.decodeResource(getResources(), overlayImage);
164167
scratchBitmap = Bitmap.createScaledBitmap(scratchBitmap, (int) overlayWidth, (int) overlayHeight, false);

0 commit comments

Comments
 (0)