Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a Bundle card using GDK?

Is there a way to create a Timeline Bundle card using the GDK?

I'm currently creating a Timeline card this way:

mLiveCard = mTimelineManager.createLiveCard(LIVE_CARD_ID);
mLiveCard.setViews(views);
mLiveCard.publish(LiveCard.PublishMode.REVEAL);

This creates a single Live card in the Timeline. I tried adding another with the same TAG, thinking it would bundle them together and the most recent will be the Bundle Cover card, but it didn't do the trick.

I looked at the docs, and all I could find is how to do it using the Mirror API. So is there a way to create a Bundle card using the GDK? Or is this only available through the Mirror API? Thanks.

like image 605
Eduard Avatar asked Mar 22 '23 02:03

Eduard


1 Answers

You do not need to use Mirror API for this.

You can mimic a bundle using a live card by publishing a LiveCard whose action is a pending intent to start an activity containing a CardScrollView, which then would contain the cards that you want in the bundle. Tapping the LiveCard would then launch that activity and let the user scroll through those cards. You can also go further and attach a menu to the activity so that you can configure menu items for each of the cards, since at that point it's just a regular Android activity and layout.

The tag passed into createLiveCard is purely for debugging purposes – it is not used for any other kind of identification or grouping.

like image 89
Tony Allevato Avatar answered Mar 29 '23 20:03

Tony Allevato