-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use ScratchableLinearLayout Programmatically #15
Comments
Can you give some more context of what's not working to help troubleshoot your case? Are those views actually being added to the hierarchy? Are they correctly overlapping one another? Have you also tried calling the attach function on the controller with the scratchable/behind views?
Where I don't believe n unattached canvas would suffice in any case, as there'd never be anything attached to the UI to draw to. |
Thanks for so quick reply. I was actually just quickly hacking to make things work ( my bad ) #Context so I was trying to render it from React-Native as a Native Module. This can be done defining a class extending Relevant : so this class has function called createViewInstance which will return any type of View and that will be rendered ultimately . so there are no R.idsss and stuff For my case I want to render ScratchableLinearLayout
Now I just want to just render the scratch part programmatically , the bottom part I will render through JS (react-native) [ so we can ignore that ]. So How can I possibly set a canvas and controller to this scratchImageView. Thanks |
That's ok, Android's
I don't think you can ignore it here, as the ScratchoffProcessor needs both a scratchable/foreground (the scratchable surface) View and the behind/background (the content being revealed) View in order to function properly. When you attach the processor to both the scratchable and behind Views, it renders the drawing cache of the behind View to a Bitmap, hides the real content, attaches the necessary touch interceptors, and starts the background processors that make it all work together. Meaning, it should work as long as you have a real View to use for the behind view that you can pass to the processor's |
Hey I was trying to use this sweet library via React-Native . so i tried something like that :
Looks like I made some strong assumptions to make it work and this is not working(lol) . What would be the correct way of Programmatically (purely) using this library .
The text was updated successfully, but these errors were encountered: