-
Notifications
You must be signed in to change notification settings - Fork 48
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
Consuming click event #3
Comments
Could you try: |
Thanks for quick response, that's not working. Turns out that JustifiedTextView is consuming click event everywhere. |
Could you send the code of your custom TextView ? |
Code for CustomTextView -
I was testing in a different scenario in which the JustifiedTextView was inside a ViewPager. On click of the TextView, I had to perform an event. Using a custom TextView extending TextView is working fine but if I extend JustifiedTextView, clicks are not going through. Even if I use JustifiedTextView in xml as child of ViewPager, it is consuming click event. |
I tried to adjust the code of the example to test it (app/src/java/com/uncopt/android/example/justify/MyJustifiedTextView). This is also a class extending JustifiedTextView and it is inside a ViewPager. If you comment the lines with but still use your CustomTextView, does it work? |
I tried your solution but it didn't work. Forget about JustifiedTextView in a ViewPager, when extend JustifiedTextView, all the TextView starts consuming event (even after removing setFont()). Eg - consider a linear layout with padded TextView. I have a onClickListener on LinearLayout which works fine with TextView .i.e either I click on the empty space or on the TextView, I get click event. However, if I extend JustifiedTextView, clicking on the text stops working. If I click on the empty space of linear layout, I get click event. However, if I click on text, no event is fired. |
I am using using your JustifiedTextView everywhere in my app but it is consuming click event itself. If I use normal TextView then it is working fine.
I have tried setting following attributes in the xml to JustifiedTextView but it is still consuming click event. What else can I do ?
android:clickable="false" android:enabled="false" android:focusable="false" android:focusableInTouchMode="false"
The text was updated successfully, but these errors were encountered: