Android Modal Styling
Bubbl Android emits payloads through NotificationRouter. Your app controls the modal UI.
Recommended flow
- Receive payload (
intentextrapayloadorNotificationRouter.BROADCAST) - Parse to
NotificationRouter.DomainNotification - Render in custom
DialogFragment/ bottom sheet - Track engagement with
BubblSdk.cta,trackSurveyEvent,submitSurveyResponse
Reference host pattern
ModalFragment.newInstance(notification)
.show(supportFragmentManager, "notification_modal")
Inside modal:
- Headline + body
- Conditional media block (
image,video,audio,survey) - CTA button when
ctaLabel+ctaUrlexist - Survey question renderer when
questionspresent
XML structure example
dialog_notification.xmltv_headlinetv_bodyiv_mediavideo_containeraudio_containersurvey_containerbtn_cta
Theme and color tokens
Use central resources to keep modal/survey styling consistent:
res/values/colors.xmlres/drawable/survey_card_background.xmlres/drawable/survey_choice_background.xmlres/values/dimens.xml
Survey interaction styling
- Choice states: selected, unselected, pressed
- Rating stars: filled/unfilled colors
- Disabled submit until complete
- Inline validation and post-submit success state
Example shape drawable for choices
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<shape>
<solid android:color="@color/survey_choice_selected" />
<corners android:radius="12dp" />
</shape>
</item>
<item>
<shape>
<solid android:color="@color/survey_choice_unselected" />
<corners android:radius="12dp" />
</shape>
</item>
</selector>
Media rendering recommendations
- Image: Glide/Picasso with center crop or fit center
- Video/audio: Media3
ExoPlayeror embeddedWebViewfor YouTube - Keep cleanup in
onDismiss/onDestroyViewto release player resources