У меня есть ответ изображения от api всякий раз, когда я перехожу к определенному экрану c, ответ выглядит следующим образом:
{
"id": 550,
"backdrops": [
{
"aspect_ratio": 1.77777777777778,
"file_path": "/fCayJrkfRaCRCTh8GqN30f8oyQF.jpg",
"height": 720,
"iso_639_1": null,
"vote_average": 0,
"vote_count": 0,
"width": 1280
}
],
"posters": [
{
"aspect_ratio": 0.666666666666667,
"file_path": "/fpemzjF623QVTe98pCVlwwtFC5N.jpg",
"height": 1800,
"iso_639_1": "en",
"vote_average": 0,
"vote_count": 0,
"width": 1200
}
]
}
Я использую эти изображения внутри viewPager2
в панель приложения, и она в основном действует как слайд.
Проблема в том, что когда я использую слайд, каждый раз, когда я смахиваю на следующее изображение, я получаю странную линию внизу изображения.
Первое изображение на слайде -
![enter image description here](https://i.stack.imgur.com/nfcNB.png)
The other images in the slide -
Код держателя вида View Pager:
class MyViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
private var movieImageSlider = itemView.imageViewSlider
fun bind(movieImage: Backdrop) {
val currentUrl = "https://image.tmdb.org/t/p/w400${movieImage.filePath}"
Glide.with(itemView.context)
.load(currentUrl)
.placeholder(R.drawable.ic_launcher_background)
.error(R.drawable.ic_launcher_foreground)
.into(movieImageSlider)
}
}
Код элемента ViewPage:
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageViewSlider"
android:layout_width="0dp"
android:layout_height="250dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_launcher_background"
app:layout_collapseMode="parallax"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>