sharish / scratchview Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
How to stop the image from being scratched?
images randoms:ArrayListOf = [R.drawable.a,R.drawable.b,etc..]
R = random.nextInt(2)
Hey, trying to scratch.setBackroundResource(imageRandom[R]
but I got a crash ... why?
Hi and thank you for this library, it's very helpful!
But I have a question, can we get the percentage or check if the whole scratch area is revealed? as for now, we only can detect the percentage of the text/image area inside the scratch view. Any help would be appreciated! Thank you very much
Hello, in ScratchTextView.java, AsyncTask is Deprecated so what can we do about that, i have used Executors
many times but here we need params
from doInBackground
which we can't get from Executors
..
can not revel 100% in one touch.
in PhonePe and Tez if we reveal 30% then we touch out of scrachview it will automatically reveal 100% so how can I revel 100% in this scratch card?
Is it possible to get the percent of discover surface?
java.lang.IllegalArgumentException: width and height must be > 0 at android.graphics.Bitmap.createBitmap(Bitmap.java:1074) at android.graphics.Bitmap.createBitmap(Bitmap.java:1041) at android.graphics.Bitmap.createBitmap(Bitmap.java:991) at android.graphics.Bitmap.createBitmap(Bitmap.java:952) at com.cooltechworks.views.ScratchTextView.onSizeChanged(ScratchTextView.java:175) at android.view.View.sizeChange(View.java:22602) at android.view.View.setFrame(View.java:22544) at android.widget.TextView.setFrame(TextView.java:7137) at android.view.View.layout(View.java:22404) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout(LinearLayout.java:1565) at android.view.View.layout(View.java:22407) at android.view.ViewGroup.layout(ViewGroup.java:6589) at androidx.viewpager.widget.ViewPager.onLayout(ViewPager.java:1775) at android.view.View.layout(View.java:22407) at android.view.ViewGroup.layout(ViewGroup.java:6589) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout(LinearLayout.java:1565) at android.view.View.layout(View.java:22407) at android.view.ViewGroup.layout(ViewGroup.java:6589) at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1915) at android.view.View.layout(View.java:22407) at android.view.ViewGroup.layout(ViewGroup.java:6589) at androidx.coordinatorlayout.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1193) at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:880) at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:899) at android.view.View.layout(View.java:22407) at android.view.ViewGroup.layout(ViewGroup.java:6589) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:22407) at android.view.ViewGroup.layout(ViewGroup.java:6589) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout(LinearLayout.java:1565) at android.view.View.layout(View.java:22407) at android.view.ViewGroup.layout(ViewGroup.java:6589) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:22407) at android.view.ViewGroup.layout(ViewGroup.java:6589) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656) at android.widget.LinearLayout.onLayout(LinearLayout.java:1565) at android.view.View.layout(View.java:22407) at android.view.ViewGroup.layout(ViewGroup.java:6589) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at com.android.internal.policy.DecorView.onLayout(DecorView.java:1075) at android.view.View.layout(View.java:22407)
java.lang.IllegalArgumentExceptionwidth and height must be > 0
com.cooltechworks.views.ScratchTextView.onSizeChanged(ScratchTextView.java:160)
Hello, please where we can configure speed of scratch
Could you please tell me how stop the scratching when the percent value is higher than 50% for example.
I've tried several methods but none of them work.
When wanna to reveal the component before displaying, we try to call the Reveal function in body of OnCreate() Activity, the app will crash by dint of many exceptions
I am getting repeated crash in this.
HI,
How can i re-draw the scrachable layer?
I created a ScratchImageView and a ScratchTextView. In order to reveal the content, I had to tap over the image and this is not equivalent to shown behaviour of scratching the image as shown on DemoScreen.
Am I missing on something or this is the actual behaviour?
I was trying to use this awesome lib with React-Native. Is there a way to programmatically set sources ?
How to change foreground color ?
Scratching of the view is working only if the layout has been inflated in Activity. User is not able to scratch the view in case layout has been inflated in Dialog or BottomSheetDialogFragment. What can be the potential reason? @sharish
I have noticed that in Android Oreo the scratch image is being tile.
Is there a fix for this?
can not set image resource programetically, if remove src from xml file and try to set src programetically using "scratchimageview.setimageresource" it displays nothing
Hello using RecyclerView in the adapter class the listener doesn't get fired... :(
please help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.