quran_android
quran_android copied to clipboard
Refactor HighlightingImageView
This issue stems out from the discussion at #1313 (Floating Highlights) where it was proposed that HighlightingImageView
is too cluttered and needs to be refactored out into standalone classes. Some classes related to ayah animation were already extracted out, but two remained. Need some pointers on how to deal with them as:
only two classes remain. AnimationUpdateListener and OverlayParams. These classes are using some members from the enclosing class, so I am not sure how will I refactor them.
More specifically, AnimationUpdateListener
uses the following:
-
invalidate()
: to refresh the view, as we now have newly calculated animation coords -
highlightCoordinates
: to put the newly calculated coords
OverlayParams
uses the following:
-
invalidate()
: to refresh the view - a bunch of constants which can be easily taken care of
-
pageBounds
: which is used exclusively by this class, so can be easily dealt with
Please note: in the actual code OverlayParams
is a static data class, what I am referring to here is the "concept" of overlay parameters which can be refactored out. So, technically, in order to refactor, I have to not only create the class after including necessary methods in it, but also move it out from HighlightingImageView.
@aabdurrahman I see that you've contributed in this respect. Feel free to close this issue.