Custom Colour Spans

Regular readers of Styling Android should know that I’m a huge fan of Spans and believe that a good understanding of Spans is essential in order to get the best out of TextView. That said sometimes just doing simple things, such as simply changing the text colour, can seem a little awkward. In this article we’ll look at how to roll your own Span implementations, and see how easy it can be to utilise custom Spans.
Continue reading

RecyclerView FastScroll – Part 1

In the previous series we looked at how we could get smoothScrollToPosition() working in a timely manner when using LinearLayoutManager with a large data set. An alternative UX approach to using smoothScrollToPosition() which may be applicable in some use-cases is to avoid smooth scrolling altogether and use the fast scroll behaviour which has long been a staple of ListView. However, RecyclerView does not have fast scroll built in so, in this short series, we’ll look at how to implement fast scroll in RecyclerView.
Continue reading

Scrolling RecyclerView – Part 3

In the previous article we did an exploration in to how smooth scrolling in LinearLayoutManager is performed in order to understand why calling smoothScrollToPosition() on RecyclerView does not permit us to specify a duration for the scroll. In this article we’ll look at how we can customise this behaviour given we understand how the list items will be used within the RecyclerView.
Continue reading

Scrolling RecyclerView – Part 2

In the previous article we got a basic RecyclerView with a large data set working and found that the smoothScrollToPosition() behaviour worked well when moving relatively small amounts, but was far too slow to be usable when moving much larger distances. In this article we’ll explore why this is by taking a deep dive in to the LinearLayoutManager and SmoothScroller components of RecyclerView.
Continue reading

Floating Action Button – Part 2

In the previous article we constructed a simple implementation of a Floating Action Button which conformed to the material design guidelines in terms of being elevated above the background (with the appropriate shadow) and rising to meet your finger when it is touched. In this article we’ll turn our attention to animating the icon to toggle between two states.
Continue reading

Floating Action Button – Part 1

One of the many new design patterns introduced as part of material design is the Floating Action Button. However, at the time of writing, there is isn’t a control baked in to Android to achieve this, so in this series we’ll look at how to implement a FAB which conforms to the material guidelines.
Continue reading

VectorDrawables – Part 4

Previously in this series we’ve looked at how we can create VectorDrawables and animate path groups, and also animate the rendering of the paths. However, there is even more that we can animate by actually modifying the SVG path data itself, and in this concluding article in this series we’ll look at how we can do that.
Continue reading