Unless you’ve been living under a rock then you already know about the Apple Watch, have ordered one or your wearing one right now. At the moment I’ve been getting my head around how WatchKit apps will work for my the apps of my clients. The truth be told is that not all apps need […]
In addition to achieving the 1 Million developer milestone last week, Xamarin developers also enjoyed a great show at Microsoft Build 2015, with a packed attendee party on opening night, multiple sessions covering mobile development with Xamarin, and the debut of Microsoft’s Visual Studio 2015 Release Candidate with improved Xamarin integration. Kicking Off Build 2015 […]
The post Build 2015: Visual Studio Integration & Developer Celebrations appeared first on Xamarin Blog.
It’s conference season again and May is the perfect time to catch a Xamarin event near you! Here is a list of a few events happening around the world you won’t want to miss. Microsoft Ignite Chicago, IL: May 5th – 8th Go Mobile with C#, Visual Studio, and Xamarin by James Montemagno Xamarin Dev […]
Google went on a spree a few weeks back updating all of their support libraries to rev 22.1. If you haven’t read about all the changes be sure to read through the official Android Developer’s blog for a full breakdown. The most drastic change to the support libraries was to v7 AppCompat with the new AppCompatActivity, but there were several other enhancement to the libraries including one of my favorite Palette. If you don’t remember what palette is, it allows you to sample a color palette from any bitmap to theme your application. Here is a simple example of the before and after:
With rev 22.1, available as a NuGet package for your Xamarin.Android applications, the speed in which palettes are now generated are now 5 to 10 times faster! Here are some stats from Chris Banes’ blog:
After you update your NuGets to the latest version (currently 188.8.131.52 as of May 2nd 2015), you may notice that your old Palette methods were deprecated. This is because Google has replaced the older Palette.Generate and Palette.GenerateAsync methods with the tried and true Builder pattern. This will feel very familiar if you have worked with AlertDialogs or Notifications. It is basically a way of chaining property setters in a row (kind of linq style) since java doesn’t really have getters for properties that you could construct. So here is our old code:
In the latter method call the “this” is your current implementation of
Palette.IPaletteAsyncListener, which will get a callback when the generate has been completed and the new way of generating a palette uses this same interface implementation, but looks a bit different:
Updating to the latest NuGet packages will have some drastic improvements in speed as you saw in Chris’ chart because according to Chris Banes: “In this release, we went back to some old-style optimizations for the colour quantization. Things like less object allocations, more appropriate data structures and a reduction in algorithmic complexity. “
There you have it! You can grab a sample from our Xamarin.Android samples gallery. Now go make things beautiful.