Closed marcoforlin closed 9 years ago
Update: as predictable, the main issue was probably the size of the image, I could partially solve the issue by reducing the update speed by changing the reveal_size.
I say partially because the computation of the scratched percentage is still heavy and will probably behave worse on less powerful hardware.
bye, Marco
Yes Marco, this library is just a quick hack for scratch view and not the proper way of drawing . There will be performance issue on less powerful device due to the heavy drawing loop. Meanwhile I don't have much free time to revamp it now...
Hi, ok got it, thanks for the confirmation.
For now I will also stick with this code, if I do any useful updates to it in the future I will let you know.
bye, Marco
Hello,
thanks for your library. I added it to my project and it works fine as long as: mOnScratchCallback.onScratch(getScratchedRatio());
is not called.
I see that this is working fine in your demo project. The main difference is that in my case I am putting the view inside a fragment, but I don't know if that would be any different.
Do you have any suggestion?
thanks, kind regards Marco
my xml for this view: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/fragment" >
<ImageView android:id="@+id/scratch_img" android:layout_width="450dp" android:layout_height="620dp" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:scaleType="fitXY"/>
then i simply load an image in the imageview, and one in the scratchView. This works fine when not updating the percentage.