Skip to content

Conversation

@kekhong95
Copy link

when i testing on samsung s4 , my app crash by your lib
my log :
com.llollox.androidtoggleswitch.widgets.BaseToggleSwitch.setElevation(BaseToggleSwitch.kt:272)
at com.llollox.androidtoggleswitch.widgets.BaseToggleSwitch.a(BaseToggleSwitch.kt:368)
at com.llollox.androidtoggleswitch.widgets.BaseToggleSwitch.setEntries(BaseToggleSwitch.kt:335)
at com.llollox.androidtoggleswitch.widgets.BaseToggleSwitch.(BaseToggleSwitch.kt:225)

i fixed with java :

public class ToggleSwitchJava extends ToggleSwitch {

public ToggleSwitchJava(@NotNull Context context, @Nullable AttributeSet attrs) {
    super(context, attrs);
}

@Override
public void setElevation(float elevation) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
        super.setElevation(elevation);
    else ViewCompat.setElevation(this,elevation);
}

}
you need update your lib to fixed problem

@4sskick
Copy link

4sskick commented Jul 18, 2019

please update!
I got the error also with android pre-lollipop

@EmilsKadikis
Copy link

I have the same issue.
This fix would be very much appreciated.

@luizfp
Copy link

luizfp commented Mar 1, 2020

Any plans to merge this?

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

Successfully merging this pull request may close these issues.

4 participants