scratchCardLayout
scratchCardLayout copied to clipboard
onScratchComplete
it's being called zillions of time if you keep scrolling. i wanna do something on complete it's doing that thousands of times.
Hi Rishabh,
I am also facing this issue, but I found one solution for this...
For me it is working perfectly as per my requirement.
Please you try this to and let me know:
please copy and paste this code.
ScratchCardLayout scratchCardLayout = findViewById(R.id.scratchCard);
scratchCardLayout.setScratchDrawable(getResources().getDrawable(R.drawable.top));
scratchCardLayout.setScratchWidthDip(60f);
scratchCardLayout.setScratchEnabled(true);
scratchCardLayout.setScratchListener(new ScratchListener() {
@Override
public void onScratchStarted() {
}
@Override
public void onScratchProgress(ScratchCardLayout scratchCardLayout, int i) {
if (i >= 50) {
scratchCardLayout.setRevealFullAtPercent(i);
System.out.println("print I : " + i);
System.out.println("Revealed."); // this will call one time only after this I did not use **onScratchComplete** method
}
}
@Override
public void onScratchComplete() {
}
});