mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 16:18:55 +01:00 
			
		
		
		
	Storio imported from Jitpack. Also fix an issue with the progress bar animation on the reader
This commit is contained in:
		@@ -116,21 +116,15 @@ class ReaderProgressBar @JvmOverloads constructor(
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Called when the aggregated visibility of this view changes. It also starts of stops the
 | 
			
		||||
     * rotation animation according to [isVisible].
 | 
			
		||||
     * Called when the visibility of this view changes.
 | 
			
		||||
     */
 | 
			
		||||
    override fun onVisibilityAggregated(isVisible: Boolean) {
 | 
			
		||||
        super.onVisibilityAggregated(isVisible)
 | 
			
		||||
 | 
			
		||||
        if (isVisible != aggregatedIsVisible) {
 | 
			
		||||
            aggregatedIsVisible = isVisible
 | 
			
		||||
 | 
			
		||||
            // let's be nice with the UI thread
 | 
			
		||||
            if (isVisible) {
 | 
			
		||||
                startAnimation()
 | 
			
		||||
            } else {
 | 
			
		||||
                stopAnimation()
 | 
			
		||||
            }
 | 
			
		||||
    override fun setVisibility(visibility: Int) {
 | 
			
		||||
        super.setVisibility(visibility)
 | 
			
		||||
        val isVisible = visibility == View.VISIBLE
 | 
			
		||||
        if (isVisible) {
 | 
			
		||||
            startAnimation()
 | 
			
		||||
        } else {
 | 
			
		||||
            stopAnimation()
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user