2

Trying to implement a custom notification, but I am getting this awful expansion to the notification when i try to forcefully expand it (In my case was not expecting it). This only happens when i switch off screen and then try to interact with the notification other times it acts normal and does not expand when i forcefully try too.

Also tried to cover up the white expansion by setting notification color like below :

.setColor(ContextCompat.getColor(context, R.color.notification_background_light))

did not make much difference.

Testing environment
Device : LG H815
OS : Android 6.0

SNAPHOT : here

CODE :

builder = new NotificationCompat.Builder(context);

        builder.setSmallIcon(R.mipmap.ic_launcher)
                .setContent(remoteViews)
                .setContentIntent(pendingIntent)
                .setColor(ContextCompat.getColor(context, R.color.notification_background_light))
                .setOngoing(true);

        notificationManager.notify(notification_id,builder.build());

i don't know if its an error from my side.
Thanks in advance

Community
  • 1
  • 1
  • make sure your setContent view height does not exceed recommended size 64dp to something below 200 i will update – Charuක Jan 28 '17 at 06:52
  • @Charuka my layout is 64dp hardcoded it to my relative layout of the notification – BlueDaBaDee Jan 28 '17 at 06:54
  • great can you do something add a background color to that custom view still if the other part remains same it means allocated size for the push layout seems bigger on that device! Is it normal push view or expanded one? – Charuක Jan 28 '17 at 06:58
  • @Charuka the blue cyan you see in the snapshot is the result of background color that I have added to my "Relative Layout" = the parent container/layout for my notification – BlueDaBaDee Jan 28 '17 at 07:05
  • then for sure that 64dp is the problem for that device add like 90 dp run and see what happens – Charuක Jan 28 '17 at 07:06
  • @Charuka did not make any difference still has that weird thing. – BlueDaBaDee Jan 28 '17 at 07:31
  • post your code of push view creation – Charuක Jan 28 '17 at 07:32

0 Answers0