Go With the Flow – Handling Configuration Changes with Flow

Last week we covered how to use flow with a master-detail view. I got some great feedback from Ray Ryan and Logan Johnson from the Square team. This week I’m going to be covering how to handle rotation. Crash on Rotation If you had tried rotating last weeks example you would have noticed a bug. Specifically when you rotate from …

Code Highlighting with Prism.JS

I have been using prismjs for a bit now. I like it. I noticed today though that it doesn’t color annotations in Java. My initial attempt at annotation coloring worked. Prism.languages.java = Prism.languages.extend(‘clike’, { ‘annotation’: /(@{1}\w*\(.*?\))|(@{1}\w+)/i, ‘keyword’: /\b(abstract|continue|for|new|switch|assert|default|goto…)\b/, ‘number’: /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i, ‘operator’: { pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m, lookbehind: true } }); Until but it failed to color annotations with parameters for some reason. …

Master Detail with Square’s Flow

Update I got some amazing feedback from Ray Rayan and Logan Johnson. I’ll likely be creating a supplemental post to cover their notes. One thing that should definitely go in this post is that Flow is in Alpha and the API isn’t stable. The api can change, so if you decide to use it and I hope you do 😉 …

More Kotlin Features to Love

Constants are important One of the things that I’ve come to appreciate more and more as a programmer are constants. Before I would have yawned and said big deal why? Now I’d say they are so important as they prevent so many needless bugs. If we are guaranteed that something is not null then we can focus simply on getting …

Debugging with Jack

Overriding Variable Contents in the Debugger Debugging is always a very important feature of an IDE. One useful tip that I don’t hear much about while debugging is being able to change the contents of a variable in the middle of debugging session. If the debugger is halted on a line you simply need to execute the Evaluate Expression Command(⌥+F8). …

Love for Kotlin

I spent a fair amount of time learning how annotation processors work. I made a sample library called ascent on github for injecting custom fonts into fields. It was a great way to learn. The benefit of annotation processors is boilerplate destruction. I’ve always disliked having to write code over and over again, one example of that is converting values …

Why I Love Zeplin

One of my favorite apps is Zeplin. If you haven’t heard of it before, it’s an amazing desktop app that helps you build pixel perfect mobile apps. To understand why it’s amazing let’s look at a typical workflow for coding up a design. Back when I first started android development the development flow was the following:

Patch Nine Not at Compile Time

If you aren’t familiar patch nines are really cool png files that have defined stretch areas as well as padding areas. I had experimented before and found that it was possible to generate patch nines at runtime in android. I posted some sample code on stack overflow here.

Book Review: 100 Android Interview Questions

I’m finally getting around to reading through this book that one of my colleagues wrote. I do like a good portion of the questions. I was a little disappointed that the questions weren’t all android specific(some that were Java specific). Overall I think this is a good set of questions to use as the basis for either preparing for an …