mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 06:17:57 +01:00 
			
		
		
		
	Remove no predictive animations. Upgrade Kotlin to 1.0.3
This commit is contained in:
		| @@ -1,13 +1,14 @@ | ||||
| package eu.kanade.tachiyomi.widget | ||||
|  | ||||
| import android.content.Context | ||||
| import android.support.v7.widget.GridLayoutManager | ||||
| import android.support.v7.widget.RecyclerView | ||||
| import android.util.AttributeSet | ||||
|  | ||||
| class AutofitRecyclerView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : | ||||
|         RecyclerView(context, attrs) { | ||||
|  | ||||
|     private val manager = NpaGridLayoutManager(context, 1) | ||||
|     private val manager = GridLayoutManager(context, 1) | ||||
|  | ||||
|     private var columnWidth = -1 | ||||
|  | ||||
|   | ||||
| @@ -1,27 +0,0 @@ | ||||
| package eu.kanade.tachiyomi.widget | ||||
|  | ||||
| import android.content.Context | ||||
| import android.support.v7.widget.GridLayoutManager | ||||
| import android.util.AttributeSet | ||||
|  | ||||
| /** | ||||
|  * No Predictive Animations GridLayoutManager | ||||
|  */ | ||||
| open class NpaGridLayoutManager : GridLayoutManager { | ||||
|  | ||||
|     constructor(context: Context, spanCount: Int) : super(context, spanCount) {} | ||||
|  | ||||
|     constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) | ||||
|         : super(context, attrs, defStyleAttr, defStyleRes) {} | ||||
|  | ||||
|     constructor(context: Context, spanCount: Int, orientation: Int, reverseLayout: Boolean) | ||||
|         : super(context, spanCount, orientation, reverseLayout) {} | ||||
|  | ||||
|     /** | ||||
|      * Disable predictive animations. There is a bug in RecyclerView which causes views that | ||||
|      * are being reloaded to pull invalid ViewHolders from the internal recycler stack if the | ||||
|      * adapter size has decreased since the ViewHolder was recycled. | ||||
|      */ | ||||
|     override fun supportsPredictiveItemAnimations() = false | ||||
|  | ||||
| } | ||||
| @@ -1,27 +0,0 @@ | ||||
| package eu.kanade.tachiyomi.widget | ||||
|  | ||||
| import android.content.Context | ||||
| import android.support.v7.widget.LinearLayoutManager | ||||
| import android.util.AttributeSet | ||||
|  | ||||
| /** | ||||
|  * No Predictive Animations LinearLayoutManager | ||||
|  */ | ||||
| open class NpaLinearLayoutManager : LinearLayoutManager { | ||||
|  | ||||
|     constructor(context: Context): super(context) {} | ||||
|  | ||||
|     constructor(context: Context, orientation: Int, reverseLayout: Boolean) | ||||
|         : super(context, orientation, reverseLayout) {} | ||||
|  | ||||
|     constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) | ||||
|         : super(context, attrs, defStyleAttr, defStyleRes) {} | ||||
|  | ||||
|     /** | ||||
|      * Disable predictive animations. There is a bug in RecyclerView which causes views that | ||||
|      * are being reloaded to pull invalid ViewHolders from the internal recycler stack if the | ||||
|      * adapter size has decreased since the ViewHolder was recycled. | ||||
|      */ | ||||
|     override fun supportsPredictiveItemAnimations() = false | ||||
|  | ||||
| } | ||||
| @@ -1,9 +1,10 @@ | ||||
| package eu.kanade.tachiyomi.widget | ||||
|  | ||||
| import android.content.Context | ||||
| import android.support.v7.widget.LinearLayoutManager | ||||
| import android.support.v7.widget.RecyclerView | ||||
|  | ||||
| class PreCachingLayoutManager(context: Context) : NpaLinearLayoutManager(context) { | ||||
| class PreCachingLayoutManager(context: Context) : LinearLayoutManager(context) { | ||||
|  | ||||
|     companion object { | ||||
|         const val DEFAULT_EXTRA_LAYOUT_SPACE = 600 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user