mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fixed buggy page transform in library
This commit is contained in:
parent
847c70a127
commit
4a0989c9c5
1 changed files with 2 additions and 1 deletions
|
@ -3,10 +3,11 @@ package com.lagradost.cloudstream3.ui.library
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.viewpager2.widget.ViewPager2
|
import androidx.viewpager2.widget.ViewPager2
|
||||||
import kotlinx.android.synthetic.main.library_viewpager_page.view.*
|
import kotlinx.android.synthetic.main.library_viewpager_page.view.*
|
||||||
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
class LibraryScrollTransformer : ViewPager2.PageTransformer {
|
class LibraryScrollTransformer : ViewPager2.PageTransformer {
|
||||||
override fun transformPage(page: View, position: Float) {
|
override fun transformPage(page: View, position: Float) {
|
||||||
val padding = (-position * page.width).toInt()
|
val padding = (-position * page.width).roundToInt()
|
||||||
page.page_recyclerview.setPadding(
|
page.page_recyclerview.setPadding(
|
||||||
padding, 0,
|
padding, 0,
|
||||||
-padding, 0
|
-padding, 0
|
||||||
|
|
Loading…
Reference in a new issue