Git Product home page Git Product logo

Comments (9)

RiccardoMoro avatar RiccardoMoro commented on June 30, 2024

If I remember correctly API >=16 means more than 90% (about 95%) of the active devices, it's not all, but it's more than enough I guess.
With API >= 16 I've avoided some problems that might have occurred, especially because I do not have any device previous to jellybean to test on (I do not completely trust emulators, I've seen error on them that did not occurr on real devices and vice verse)
If you have one and need this library for API < 16 feel free to downgrade the API version and test it, if it works open me a pull request and I will happily accept and merge it!
Let me know

from rmswitch.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on June 30, 2024

But have you tested it on emulators of API 15 or below?
Maybe it is possible ?

from rmswitch.

RiccardoMoro avatar RiccardoMoro commented on June 30, 2024

Nope, I also think this library needs some small changes to be used in API < 16

from rmswitch.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on June 30, 2024

what changes? Currently, trying to run on pre-API 16, I get a crash with this error:

12-10 00:12:01.839 2151-2151/com.rm.switchsample E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rm.switchsample/com.rm.switchsample.ActivityMain}: android.view.InflateException: Binary XML file line #27: Error inflating class com.rm.rmswitch.RMTristateSwitch
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #27: Error inflating class com.rm.rmswitch.RMTristateSwitch
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143)
at com.rm.switchsample.ActivityMain.onCreate(ActivityMain.java:63)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 
at android.app.ActivityThread.access$1500(ActivityThread.java:117) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:130) 
at android.app.ActivityThread.main(ActivityThread.java:3683) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:507) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.ClassNotFoundException: com.rm.rmswitch.RMTristateSwitch in loader dalvik.system.PathClassLoader[/data/app/com.rm.switchsample-1.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.view.LayoutInflater.createView(LayoutInflater.java:471)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:623) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:626) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:408) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143) 
at com.rm.switchsample.ActivityMain.onCreate(ActivityMain.java:63) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 
at android.app.ActivityThread.access$1500(ActivityThread.java:117) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at android.os.Looper.loop(Looper.java:130) 
at android.app.ActivityThread.main(ActivityThread.java:3683) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:507) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
at dalvik.system.NativeStart.main(Native Method) 

from rmswitch.

RiccardoMoro avatar RiccardoMoro commented on June 30, 2024

Ok, I found the problem.
To animate the switch movements, i use LayoutTransition.CHANGING, which is available only in api 16+
I will push an update with min sdk version set as 11, but devices with api < 16 will not see animation for the switch toggle movements.. I'll write it down in the TODO section of the README, when I'll have time I will fix this too.
Thanks again for the feedback @AndroidDeveloperLB

from rmswitch.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on June 30, 2024

from rmswitch.

RiccardoMoro avatar RiccardoMoro commented on June 30, 2024

Mmm on my emulator is having a really strange behaviour on api < 16 :(
I'll have to keep this change on a separated branch until I found a real device to test on.
I'm looking into your library right now

from rmswitch.

RiccardoMoro avatar RiccardoMoro commented on June 30, 2024

I'm sorry but I do not have real experience on old android API or Preferences.. Also, reading on other libraries/websites, everyone seems to have that problem with animations on Switch and CheckBox Preferences backward compatibility.. I do not think I'll be able to help you @AndroidDeveloperLB

from rmswitch.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on June 30, 2024

from rmswitch.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.