How to maintain backwards compatibility while utilising Android API Level 15?

后端 未结 3 1188
一向
一向 2021-01-02 05:04

Ice cream sandwich introduced a lot of new UI design elements but market penetration is still only 4% or so. If one wanted to future-proof their application and utilise some

3条回答
  •  春和景丽
    2021-01-02 05:46

    While I agree with @Ollie C, I think there are other options to add other than just using the Actionbar Sherlock library, while saying this I actively participate in the ABS community and agree it is fantasmagoricly really useful and contains all the UI assets will probably need.

    You could look at graceful degradation of UI components back through the API levels. So for example:

    You could create in the values folder and set the style like so

    
    
        
     
    

    Then for Android 3.0+ devices, create values-v11 folder:

    
    
        
    
    

    And for 4.0+ devices, create values-v14:

    
    
        
    
    

    REF: http://android-developers.blogspot.co.uk/2012/01/holo-everywhere.html, How to use Holo.Light theme, and fall back to 'Light' on pre-honeycomb devices?

    There is also this project: https://github.com/ChristopheVersieux/HoloEverywhere that it attempting to bring the holo theme.

    Finally; Google encourage the developers to include UI components from the SDK to help with the backward compatibility issue, rather than referencing them directly from the Android OS. While this is not your question, it does help provide some consistency.

提交回复
热议问题