Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Custom Notification with big animated gif image

I want to make a Custom Notification with big animated gif image. So I cannot find a solution resolve this problem. Because i can only use RemoteView to custome layout. Creating custom android notification without RemoteView

But RemoteView just support some basic view.
https://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout

How can i do this?

like image 350
Hati Avatar asked Mar 15 '17 07:03

Hati


People also ask

How do you make a big picture notification on android?

Provide the bitmap to be used as the payload for the BigPicture notification. Provide the content Uri to be used as the payload for the BigPicture notification. Overrides ContentTitle in the big form of the template. Set the content description of the big picture.

Can we send GIF in push notification?

AFAIK videos and GIFs are not supported in the notification.

How do you animate a GIF on Android?

First you'll need to install GIFDroid from the Android Market, then open the app. Step 1: Press either the Select Video or Record Video button. Select Video will open your Gallery to choose a video. Step 2: Choose the section of the video you want to make into an animated GIF.


1 Answers

there is no good solution for this but you can use this trick :

you can set imageView to remoteView of your notification and than change the image of your imageView per gif frame and update your remoteView imageView image and your notification and you should do this on separate Thread because it is costly!

for splinting your gif to separate images you can try this sulutions :

splitting out side of your project :

https://ezgif.com/split

splitting inside your project and in runtime :

Split GIF into frames

please notify me if this solution worked for you

like image 117
Amir Hossein Mirzaei Avatar answered Oct 02 '22 23:10

Amir Hossein Mirzaei