Android-Toggle-Switch icon indicating copy to clipboard operation
Android-Toggle-Switch copied to clipboard

bug on android below 5.0

Open kekhong95 opened this issue 6 years ago • 3 comments

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

kekhong95 avatar Mar 19 '19 01:03 kekhong95

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

4sskick avatar Jul 18 '19 11:07 4sskick

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

EmilsKadikis avatar Jul 26 '19 07:07 EmilsKadikis

Any plans to merge this?

luizfp avatar Mar 01 '20 18:03 luizfp