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.
Post is live with tons of great samples!
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:
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.
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:
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.
Great article, keep them coming, Android L is the future
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?
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.
@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:
Thanks for the videos! I will gladly review. I am still facing two issues.
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.
Will there be a path for Xamarin applications to implement Material design for android 4.X OSs via the compatibility library?
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.
@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:
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.
@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?
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.
@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.
@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
Xamarin Inc., as a wholly-owned Microsoft subsidiary acting as a separate legal entity, adheres to the Microsoft Privacy Statement: Privacy & cookies