Can't add page to Android Wear notification without the card background -
it's quite possible android wear doesn't support there seems there should workaround. want add custom second page notification, don't want have white card background.
here's how create notifications:
intent secondpageintent = new intent(this, secondpageactivity.class); pendingintent secondpagependingintent = pendingintent.getactivity(this, 0, secondpageintent, 0); notification secondpagenotification = new notificationcompat.builder(this) .extend(new notificationcompat.wearableextender() .setdisplayintent(secondpagependingintent) .sethintshowbackgroundonly(true) ) .build(); intent firstpageintent = new intent(this, firstpageactivity.class); pendingintent firstpagependingintent = pendingintent.getactivity(this, 0, firstpageintent, pendingintent.flag_update_current); notificationcompat.builder builder = new notificationcompat.builder(this) .setsmallicon(r.drawable.ic_launcher) .extend(new notificationcompat.wearableextender() .setdisplayintent(firstpagependingintent) .setbackground(bitmapfactory.decoderesource(getresources(), r.drawable.background)) .addpage(secondpagenotification) ); notificationmanagercompat notificationmanager = notificationmanagercompat.from(this); notificationmanager.notify(curnotificationid++, builder.build()); i've tried:
- setting sethintshowbackgroundonly doesn't anything
- from within secondpageactivity, try grab parentactivity , set it's alpha 0. doesn't work, parentactivity null.
- calling setcustomcontentheight(0) doesn't remove card, gets skinny
- i tried not using second page instead launching activity when user swipes doesn't good
i have no idea try next. i'm experienced engineer pretty new android. ideas or suggestions helpful.
thanks!
if want rid of white card have set
setcustomsizepreset(wearableextender.size_full_screen)
instead of that:
your custom content appear on entire screen (without card decoration).
please notice background of custom activity defined style declared in manifest. unfortunately theme transparent background won't work, background needs opaque:(
this submitted issue here: https://code.google.com/p/android/issues/detail?id=73900
hope allow transparent backgrounds there in future:\
Comments
Post a Comment