James Montemagno
James Montemagno

Live, Love, Bike, and Code.

Live, Love, Bike, and Code

Share


Tags


Essential Xamarin.Android Templates for Visual Studio

During my Effective Navigation in Android talk at last years Xamarin Evolve I had the opportunity of showcasing my Xamarin.Android Templates Pack for Visual Studio, which you can get from the Visual Studio Gallery under “Tools->Extensions and Updates”. I like the templates that come installed with Xamarin, however the flexibility of Visual Studio to easily create project and item templates led me to creating this pack which included:

Project:

  1. Navigation Drawer

Item:

  1. Single Menu Item
  2. Search Menu Item
  3. Share Menu Item

While these were great at the time the entire Android ecosystem has shifted towards AppCompat for Material Design in apps. So I worked all day and night Sunday to update my Templates pack to bundle in a bunch of AppCompat project templates, and also extended the item templates to include AppCompat versions. 

Android Blank App AppCompat 

The first template creates a standard blank app, but adds all resource files for you automatically for theming as well as some simple navigation. It also uses the new Toolbar.

Android Navigation Drawer AppCompat 

Probably the most requested template and most used is a nice Navigation Drawer sample with everything you need including images in your navigation drawer and proper selector colors for older API levels.

All The Menu Templates!

I have also update all of the Menu Item xmls to include a standard and AppCompat version. I also have the code that you need to copy into your Activity so you don’t need to go look it up!


One More Thing

I also decided to include a nice Adapter item template with my recommend method of proper view reuse, which you can read more about at http://blog.xamarin.com/creating-highly-performant-smooth-scrolling-android-listviews/. This way you don’t have to remember all that nasty ViewHolder logic. I do plan on introducing a RecyclerView Adapter in the future as well. 

Requests Welcome

All of my project and item templates can be found on GitHub: https://github.com/jamesmontemagno/xamarin-templates and you are free to open up an Issue with a request for Android project or item templates that you might like to see.

Demo

I also decided to do a walkthrough of the templates:

Copyright © James Montemagno 2015 All rights reserved. Privacy Policy

View Comments