fossasia / badgemagic-android

Badge Magic with LEDs - Android App https://play.google.com/apps/testing/org.fossasia.badgemagic
Apache License 2.0
1.85k stars 206 forks source link

Implement back and forth animation #892

Open mariobehling opened 11 months ago

mariobehling commented 11 months ago

The Python version has a back and forth animation.

Please implement the same here

bicycle

This option should be part of the animation screen (middle option). Screenshot from 2024-02-26 11-27-33

amrsalah3 commented 8 months ago

According to BadgeBLE, the device only supports 8 types of animations that are already included in BadgeMagic Android app. The python version implements this back-and-forth animation by sending 2 messages to the device: One message sliding to the left then the same but sliding to the right (and repeat).

However, the android version doesn't support sending more than 1 message (Please checkSendingUtils.kt):

fun convertToDeviceDataModel(message: Message): DataToSend {
        return DataToSend(listOf(message))
 }  

Therefore, we need first to modify the project to support accepting a list of messages, not only 1 message. After that, we can implement this back-and-forth animation easily.

amrsalah3 commented 8 months ago

https://github.com/fossasia/badgemagic-android/pull/644