quran / quran_android

a quran reading application for android
http://android.quran.com
GNU General Public License v3.0
1.99k stars 882 forks source link

Highlight Ayat animation #1551

Open nacer80 opened 3 years ago

nacer80 commented 3 years ago

السلام عليكم ورحمة الله وبركاته

My brothers @murtraja & @ahmedre Jazekoum Allaho kheiren The highlight animation is very great but I have one suggestion, in case of next Ayah is in two lines is difficult to follow animation in tow ways in the same time so I think if the highlight animation starts in the first line then the second. وجزاكم الله خيرا

Screenshot_20210222-144958_Quran 1313#issue

murtraja commented 3 years ago

@nacer80 I agree with you. We are still figuring out the best way to do this. The issue is dealing with multiple cases using a general approach rather than showing different animation for different cases, thereby not complicating the code.

For example, consider 38->39, ayah 38 is left-oriented and 39 is right-oriented, whereas 39->40 it is the opposite. Moreover, the highlights are broken if the word segments are far. For example, consider ayah 34, the highlight for this is broken and separate over the two words, so animating 2 separate highlights into one is also a challenge.

Now coming to the animation which you're proposing, if someone needs to implement this, they can do it by chaining the animations such that the end of the animation of the first segment should trigger the start of the animation of the second segment. They must make sure that it doesn't take very long and also that if user changes the currently playing ayah, the animation should dynamically change its trajectory towards the new ayah, similar to the current behaviour.

@nacer80 Thank you for creating this issue. It will be helpful to discuss the ideas, strategies and algorithms for this.