Skip to content
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

Switch does not respect clickable/focusable false #64

Closed
m-radzikowski opened this issue Aug 10, 2016 · 2 comments
Closed

Switch does not respect clickable/focusable false #64

m-radzikowski opened this issue Aug 10, 2016 · 2 comments

Comments

@m-radzikowski
Copy link

m-radzikowski commented Aug 10, 2016

We have a scenario in which I need to use SwitchButton as indicator, without capability to click on it and change it's state. But click in the area of switch should be handled by component below it, like usual in Android.

I've created two switches, one native and one SwitchButton:

    <Switch
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="false"
        android:focusable="false"/>

    <com.kyleduo.switchbutton.SwitchButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="false"
        android:focusable="false"/>

Click on the native Android switch does nothing to it and is handled by component underneath. But SwitchButton ignores clickable and focusable config and changes state when clicked / moved.

Right now we've to create workaround with listeners to manually prevent state change and pass click event to other view.

Tested on version 1.4.2.

@kyleduo
Copy link
Owner

kyleduo commented Aug 10, 2016

I'll ckeck it out asap.

@kyleduo
Copy link
Owner

kyleduo commented Aug 15, 2016

Fixed in 1.4.3. Thanks for pointing out this.

@kyleduo kyleduo closed this as completed Aug 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants