Monday, June 13, 2016

How do I display notification pages with expandable custom layouts in Android Wear?

Leave a Comment

What's the proper way of having a tall custom activity layout in a notification page that starts off collapsed?

Details We have a top-level notification to which I am adding pages, each with its own custom activity (via WearableExtender#setDisplayIntent(...)). This works great!

We also have an Asset image that corresponds to each of these custom activities and we want to show that behind them such that we take advantage of the beautiful transitions provided by the wear system UI. To do this, we use WearableExtender#setBackground(toBitmap(asset)) and this, too, works great!

The problem: in order to see the background, we need the custom activity to not take up the entire screen. Therefore, we use a custom preset size smaller than setCustomSizePreset(WearableExtender.SIZE_FULL_SCREEN) but now, our custom Activity is scrolled off the bottom of the screen (it has a minimum height) and slightly cut off. The white "card" part can't be scrolled up to expose the rest of the card.

The question: is there a proper way to tell the system UI to make the card that contains the custom activity expandable like the other cards? In other words: is there a way to start the card collapsed to the very bottom such that it's only "peeking" from the bottom but allow the user to expand it to full screen?

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment