[Xamarin Blog] Introduction to Android Material Design

JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai
edited August 2014 in Xamarin.Android

I just posted an Introduction to Android Material Design on the Xamarin Blog. Where I cover the new Material Themes, Elevations, and Drawable Tinting features in Android L.

Please use this thread for discussion.

Posts

  • JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    Post is live with tons of great samples!

  • CheesebaronCheesebaron DKInsider, University mod

    Cool stuff. However, it is not really necessary to set the minimum target so high if you just follow the Android convention of putting themes into values folders like:

    Resources
        |---> values-v14
        |---> values-v21
        |---> values
    

    Where the vXX indicates the API level, and inside of those folders you have the API specific themes and values. So when running your app on API levels lower than 21 it would use the other values, which is pretty neat.

  • JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    Yup that is correct you shouldn't have to set it to 21, which is why I mention the values folder for older targets. However, just following Google's guidance form IO:

    at 42:54

    Mostly, you shouldn't be shipping L apps to the store just yet and they do say the minimum should be L for now.

    I will ensure this is worded correctly though and put a link to backwards compatibility doc.

  • ChristopherDrososChristopherDrosos GRMember ✭✭

    Great article, keep them coming, Android L is the future

  • RobertCastlesRobertCastles USMember
    edited October 2014

    Thanks for the walkthrough! I'm a little lost in converting an existing application. My maximum target API level available in my project properties is 19. I don't see how to set it to 21 although I'm on latest stable Xamarin and have the SDK library 21 installed. It seems that the reference then in values\Styles is then not finding the definition of the theme and the build has this error:

    \Resources\values\styles.xml(2): error : Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light'.

    Also, if possible, I'd like to implement material design but run on 4.4 (down to 4.0). Are there any instructions on implementing a compatibility library to provide a material theme in Android 4 with Xamarin?

    Thanks!

    Edit:
    Perhaps to get the SDK21 support I need to look at the 4.0.381 alpha. I would still like to get information on compatibility though.

  • JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    @RobertCastles‌ Currently Android L is only support on the Alpha Channel of Xamarin.

    Additionally you need to make sure you have all of your SDKs updated in the Android SDK Manager. See this post: http://blog.xamarin.com/android-l-developer-preview-android-wear-support/

    Jeremie and I gave a few talks at Evolve as well on Material Design:

    https://www.youtube.com/watch?feature=player_embedded&v=A1WKe08uxd4

    and

  • RobertCastlesRobertCastles USMember
    edited October 2014

    Thanks for the videos! I will gladly review. I am still facing two issues.

    1. I have installed alpha and I don't see 21 as a build target. I will review the wear support link to confirm I have all the prerequisites.

    2. Will there be a path for Xamarin applications to implement Material design for android 4.X OSs via the compatibility library?

    Edit:

    I see there is information about compatibility library and using nuget. I'll try and report back. I'm not sure if that will allow for the API 21 selection, but will check.

    Thanks.

  • JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    @RobertCastles did you install all of the Android SDKs for API 20, L preview? I believe now there is also a 21 API, however they just added this so it might not be supported just yet.

    The material design is only Android L at this time. However, they just added it to support v7 library:
    http://developer.android.com/tools/support-library/index.html
    Changes for v7 appcompat library:
    Added support for material design user interfaces.

    So as soon as that is bound it will be exposed via a NuGet and Component.

  • StefanosKaratzogiannisStefanosKaratzogiannis GRUniversity ✭✭

    @JamesMontemagno‌ I'd love to see an Android Support Library v7 AppCompat bound on v21, updated on components... Any ideas if it's gonna be soon?

  • JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    The components team works on all the bindings so while I don't have any specifics on dates they have been extremely fast on the last versions of the libraries.

  • Hi, I currently have the following installed.
    Visual Studio 2012, Win8.1
    Latest Alpha Xamarin

    Through the SDK
    Android 5.0 (API21)
    Android 4.4W2 (API20)
    Android 4.4.2 (API19)

    Then, I have the manual download of the Android-L extracted to the android platforms folder.

    I still am unable to select API 21 or any -L option as my build target. API 19 is the highest offered. Any ideas?

  • I meant to add that I have also tried manually renaming the Android-21 folder to see if that would help pick up the Android-L folder.

  • Is there any other trick I might try to be able to select SDK 21? I currently have Alpha installed and Android-20, Android-L folders (no 21) in the "android-sdk\platforms" folder. Those were installed using the SDK manager.

  • JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai

    @RobertCastles I believe google changed everything from L to 21 now so the "preview" bits might not work anymore (I am not 100% positive as I thought they still worked for me). I have reached out to the team to comment to see if they know a workaround.

  • palspals INMember

    @JamesMontemagno . hie really liked your work . its awsome.. had learn so much .. i wanna create tool bar like google play store . can you provide me a code?? thanks in advance

Sign In or Register to comment.