
날씨 앱을 만들고 있습니다.
알림을 제작중인데요. 저는 맨위에 있는 알림(weawow앱)처럼 icon과 appname이 보이지않으며, 주변에 빈 공간이 없는 알림을 제작하고 싶습니다.
하지만 무슨 수를 써봐도 저렇게 나오지 않고 2번째 알림(제가 만든 앱의 알림)처럼 최소화/최대화가 가능하고 icon과 appname이 보이게 알림이 생성됩니다.
찾아보니까 알림의 우선순위를 최고 우선순위로 하거나, 알림 생성시 setWhen의 값을 0으로 설정하는 등의 방식으로 하면 된다고 하는데 전혀 먹히질 않네요.
어떻게 하면 저렇게 항상 최대화 된 커스텀알림을 만들수 있을까요?
https://stackoverflow.com/questions/63371810/android-notification-always-expanded-rectangular
이것과 100% 동일한 질문입니다.
------------
저의 코드입니다.
builder.setPriority(NotificationCompat.PRIORITY_DEFAULT).setVibrate(new long[]{0L}).setDefaults(NotificationCompat.DEFAULT_LIGHTS |
NotificationCompat.DEFAULT_SOUND).setSound(null).setSilent(true).setOngoing(true)
.setSmallIcon(icon).setCustomContentView(remoteViews)
.setStyle(new androidx.media.app.NotificationCompat.DecoratedMediaCustomViewStyle())
.setCustomBigContentView(remoteViews).setShowWhen(false).setAutoCancel(false);
Notification notification = builder.build();