Using Cursor Adapters on Google Glass CardScrollView

Reading time ~1 minute

Overview

Out of the box CardScrollView in the Google Glass GDK will only allow adapters of type CardScrollAdapter to be set on them. So I am going to share with you two custom classes that allow you to use a CursorAdapter on any of your CardScrollViews.

Note these are exact reuses of the CursorAdapter that is used in the standard Android SDK so I am not reinventing the wheel here. All I did was tweak them to allow for use with the GDK CardScrollView.

Code

You will need to add these two new classes to your project. Both CardCursorAdapter and CursorFilter. Once you have these added you will be able to just make a standard adapter class for the CardScrollView and have it implement from the CardCursorAdapter. Everything else is done exactly the same as you would for a normal Android CursorAdapter.

Gist Code

Animating Toolbar Titles

When you change a title in a toolbar, it just flashes to a new value. I'm going to show you how to create an animation for transitioning between values. Continue reading

Separate your Release and Debug only code

Published on October 16, 2015

Using The Design Library's CoordinatedLayout

Published on October 07, 2015