diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index dfeffc7..342a7ae 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -17,7 +17,6 @@ android:id="@+id/scratch_view" android:layout_width="300dp" android:layout_height="300dp" - app:overlay_image="@drawable/scratch_card" app:tile_mode="CLAMP" app:overlay_width="300dp" app:overlay_height="300dp" diff --git a/scratchview/src/main/java/com/anupkumarpanwar/scratchview/ScratchView.java b/scratchview/src/main/java/com/anupkumarpanwar/scratchview/ScratchView.java index 6be5597..b29da15 100644 --- a/scratchview/src/main/java/com/anupkumarpanwar/scratchview/ScratchView.java +++ b/scratchview/src/main/java/com/anupkumarpanwar/scratchview/ScratchView.java @@ -159,6 +159,9 @@ private void init() { String tileMode = arr.getString(R.styleable.ScratchView_tile_mode); + if (tileMode == null) { + tileMode = "CLAMP"; + } Bitmap scratchBitmap = BitmapFactory.decodeResource(getResources(), overlayImage); scratchBitmap = Bitmap.createScaledBitmap(scratchBitmap, (int) overlayWidth, (int) overlayHeight, false);