Upgrade to Pro — share decks privately, control downloads, hide ads and more …



# About me
- Twitter
- https://twitter.com/shihochandesu

- Github
- https://github.com/shihochan

# Links
- What's New in the Android OS User Interface (Google I/O'19)
- https://www.youtube.com/watch?v=nWbW58RMteI

- Bubbles
- https://developer.android.com/preview/features/bubbles

- Android Q- Implementing Bubbles
- https://medium.com/mindorks/android-q-implementing-bubbles-96aa14ccb9c3

- Set up the Android Q SDK
- https://developer.android.com/preview/setup-sdk


Yuki Shiho

May 17, 2019


  1. Shibuya.apk #34 in 2019/05/17 Bubbles

  2. About me 志甫 侑紀 / YUKI SHIHO @shihochan Software Engineer

    at AbemaTV, Inc. @shihochandesu Shibuya.apk Cat LOVER KEYAKIZAKA 46
  3. • Bubbles • Live Coding • Tips Agenda

  4. • The platform alternative to SAW • SYSTEM_ALERT_WINDOW is fully

    deprecated • Bubbles is new in Q Bubbles
  5. Anatomy of a Bubble

  6. 1.Configure the activity shown in the bubble 2.Construct BubbleMetadata and

    add it to your notification 3.Send that notification Build Bubbles
  7. <activity android:name=".BubbleActivity" android:theme="@style/AppTheme" android:label="Reminder" android:allowEmbedded="true" android:documentLaunchMode="always" android:resizeableActivity="true" /> 1.Configure the

    activity in AndroidManifest.xml AndroidManifest.xml
  8. // Create bubble intent val target = Intent(context, BubbleActivity::class.java) val

    bubbleIntent = PendingIntent.getActivity(context, 0, target, 0) // Create bubble metadata val bubbleMetadata = Notification.BubbleMetadata.Builder() .setDesiredHeight(600) .setIcon(Icon.createWithResource(context, R.mipmap.ic_launcher_roun .setIntent(bubbleIntent) .build() 2.Construct BubbleMetadata
  9. val builder = Notification.Builder(context, CHANNEL_ID) .setContentIntent(pendingIntent) .setContentTitle(notificationTitle) .setSmallIcon(R.mipmap.ic_launcher_round) .setBubbleMetadata(bubbleMetadata) notificationManager.notify(id,

    builder.build()) 2.Add BubbleMetadata to notification
  10. Live Coding

  11. Tips

  12. Tips • The first time you send the notification, it

    has to be in a notification channel with IMPORTANCE_HIGH. • Only send if it is important enough such as ongoing communications, or if the user has explicitly requested a bubble for some content. • the bubble can be disabled by the user. In that case, a bubble notification is shown as a normal notification.
  13. Shibuya.apk #34 in 2019/05/17 Thanks