Search code examples
javaandroidgoogle-glassgoogle-gdk

CardBuilder Layout.AUTHOR switch order of elements


I'm working on a google glass application and I'm using the CardBuilder (previously was Card but now deprecated)class.

With the arrival of CardBuilder there are a couple of different Layouts proposed, and the one that interests me is Layout.AUTHOR.

enter image description here

I was wondering if it was possible to "change" the order of the elements, and if so what would be the best method? Such as having the Footnote replaced with the Heading (composed of the icon, heading, and subheading.. ).

Here is what I'm currently doing:

CardBuilder c = new CardBuilder(getApplicationContext(), Layout.AUTHOR)
            .setHeading(title)
            .setSubheading(duration)
            .setText(summary)
            .setFootnote(authors);

Here is what I would like to do, but I can't since I am currently unable to change the order. (Visual order would be Text, and then Heading with no footnote).

CardBuilder c = new CardBuilder(getApplicationContext(), Layout.AUTHOR)
            .setHeading(authors)
            .setSubheading(duration)
            .setText(title + "\n\n" + summary);

If my explanations are unclear, please let me know and I shall revise my post. Thanks.


Solution

  • You will need to create your own layout to do what you want. CardBuilder is intended to make it easy for developers to create user interfaces that match those used elsewhere in the Glass platform by plugging data into a template; letting developers arbitrarily change the order would defeat the purpose.