home-assistant-android/app
Rogue136198 0c9e8ac65f
Improve Notification GIFs (#2657)
* Modify Notification GIF Framerate

Modoify VIDEO_INCREMENT_MICROSECONDS to have notification GIFs generate a frame every 0.5 seconds for a video instead of the current every 2 seconds. This should result in smoother notification animations thus improving the UX

* Increase processingFrames.size

Increase processingFrames.size as increasing the framerate results in the animation ending too soon

* Scale video to a max width of 480 while maintaining video ratio

Notification video width scaled to 480. (1920 / 4) Height will scale accordingly while maintaining video aspect ratio. e.g. 1920x2560 will be scaled to 480x640

Frames are set to every 1 seconds with 5 frames resulting in a 5 second GIF

* Update MessagingManager.kt

Based on research and rapid prototyping under another fork, I've decided that scaling the image to a fixed width and a ratioed height is not going to work. There are issues that need to be resolved which result in the image being cut off and stretched in the notification. 

End result is the only overall change is changing the frame generation from once every 2 seconds to once every 1 second. This has improved the fluidity of notifications but I understand is my own subjective opinion.

This means there is still a potential case where 4K cameras will exceed the size limits of notifications.

* Typo fix

* Re-Implement Scaling to a Constant Width

* Update MessagingManager.kt

* Add logic to not scale videos smaller than specified width and Increase GIF speed (ViewFlipper)

* Tune processing times

Tune processing time to have one frame generated every 0.75s, then frames are played back at 3x speed. This results in 9 seconds of activity being played in 3 seconds.

* Implement Dynamic Frame Count

Dynamic number of frames up to a specified size limit (currently 2.5MB)

* Review Before Merge
2022-08-13 20:33:00 -04:00
..
src Improve Notification GIFs (#2657) 2022-08-13 20:33:00 -04:00
build.gradle.kts Add fragment dependency to resolve settings view model crashes (#2764) 2022-08-05 01:25:19 +00:00
proguard-rules.pro Initial commit 2019-04-01 22:52:08 -07:00