remoteview

Custom notification layout gives unnecessary margin

你说的曾经没有我的故事 提交于 2021-02-10 03:07:40
问题 I am creating a custom notification layout for my application. NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID) .setSmallIcon(R.drawable.ic_notification_icon) .setPriority(NotificationCompat.PRIORITY_DEFAULT) .setCustomContentView(notificationLayoutCollapsed) .setOngoing(playing) .setCustomBigContentView(notificationLayoutExpanded) .setStyle(new NotificationCompat.DecoratedCustomViewStyle()) .setContentIntent(pendingIntent); My notification

Custom notification layout gives unnecessary margin

最后都变了- 提交于 2021-02-10 03:05:18
问题 I am creating a custom notification layout for my application. NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID) .setSmallIcon(R.drawable.ic_notification_icon) .setPriority(NotificationCompat.PRIORITY_DEFAULT) .setCustomContentView(notificationLayoutCollapsed) .setOngoing(playing) .setCustomBigContentView(notificationLayoutExpanded) .setStyle(new NotificationCompat.DecoratedCustomViewStyle()) .setContentIntent(pendingIntent); My notification

Custom notification layout gives unnecessary margin

China☆狼群 提交于 2021-02-10 03:04:48
问题 I am creating a custom notification layout for my application. NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID) .setSmallIcon(R.drawable.ic_notification_icon) .setPriority(NotificationCompat.PRIORITY_DEFAULT) .setCustomContentView(notificationLayoutCollapsed) .setOngoing(playing) .setCustomBigContentView(notificationLayoutExpanded) .setStyle(new NotificationCompat.DecoratedCustomViewStyle()) .setContentIntent(pendingIntent); My notification

Custom notification layout gives unnecessary margin

岁酱吖の 提交于 2021-02-10 03:04:32
问题 I am creating a custom notification layout for my application. NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID) .setSmallIcon(R.drawable.ic_notification_icon) .setPriority(NotificationCompat.PRIORITY_DEFAULT) .setCustomContentView(notificationLayoutCollapsed) .setOngoing(playing) .setCustomBigContentView(notificationLayoutExpanded) .setStyle(new NotificationCompat.DecoratedCustomViewStyle()) .setContentIntent(pendingIntent); My notification

setRotation of TextView in RemoteViews (app widget)

早过忘川 提交于 2021-02-05 09:38:29
问题 I have a widget whose xml layout is simple: an ImageView and a TextView . I can hardcode the rotation of the TextView in the xml by using android:rotation . However I want to be able to set the rotation of the TextView programmatically. It seems that a View has a setRotation() method, so the TextView will inherit this method, such that a "normal" TextView can be rotated programmatically used this method. But when the TextView is buried within a RemoteViews , you have to call the methods

Android Notification TextView Marquee Do Not Work?

放肆的年华 提交于 2020-01-05 08:53:13
问题 I am trying to create custom notification status bar like Samsung Galaxy S3 stock Music Player . I am using RemoteViews for custom layout. But my textview components does not working at marquee mode. My codes is below. And Where I make mistake? I spent a lot of time to solve this problem, but I am not luck. Samsung Galaxy S3 stock music player notification bar: This is my xml layout code: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res

How to show custom UI for firebase notification when the app is in background?

雨燕双飞 提交于 2020-01-04 08:09:09
问题 I use this class to show notification whit my own UI (RemoteViews) , received from firebase console. This works fine when the app is foreground , but when the app is in background, notification displayed in default style of device.What should I do to show notification in my own UI even the app is foreground or background? public class MyFirebaseMessagingService extends FirebaseMessagingService { private static final String TAG = "Mehdi"; @Override public void onMessageReceived(RemoteMessage

Couldn't Expand RemoteViews - Bad notification

你离开我真会死。 提交于 2020-01-03 07:24:07
问题 Lately I've been receiving more and more reports of users getting a RemoteServiceException error. The stack trace i'm given every time is as follows: android.app.RemoteServiceException: Bad notification posted from package com.smithyproductions.fasttracks: Couldn't expand RemoteViews for: StatusBarNotification(pkg=com.smithyproductions.fasttracks id=311095 tag=null score=0 notn=Notification(pri=0 contentView=com.smithyproductions.fasttracks/0x7f03007d vibrate=null sound=null defaults=0x0

How to use Glide in remoteViews?

孤街醉人 提交于 2020-01-01 04:35:30
问题 I'm using Glide for all loading images from server, but I'm having troubleshooting trying to set them in a correct way to notifications and RemoteControlClientCompat (that cool thing with lock screens). I am developing a music player, so every time that a song is changed the song cover from notifications has to change. I have this code and it works for the first time (althoug the image is load from url or from drawable), but not when it is called for second time. The image doesn't change!

Reliable way of retrieving StatusbarNotification details (title, notification text)

点点圈 提交于 2019-12-31 13:01:15
问题 I'd like to get as much information out of a StatusBarNotification -object as possible. Right now, the only "reliable" information that can be accessed is the tickerText -property. I'm using the following code to get the notification's title and text via RemoteViews , but a lot of the time, the title and/or text will simply be null :-(: //Get the title and text String mTitle = ""; String mText = ""; try { RemoteViews remoteView = sbn.getNotification().contentView; LayoutInflater inflater =