Commit 43eaa412 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

need to develop isue with duplicated (4 times) wieholder album items

parent eae58505
......@@ -33,7 +33,7 @@ private const val TIMEOUT_SECONDS=120L
private const val WRITE_SECONDS=120L
private const val READ_SECONDS=120L
val INTERCEPT_LOG_LEVEL = HttpLoggingInterceptor.Level.NONE
val INTERCEPT_LOG_LEVEL = HttpLoggingInterceptor.Level.HEADERS
@Module
class RetrofitModule{
......
......@@ -158,7 +158,9 @@ class AlbumsScreenController :
lateinit var picassoAsync:Picasso
private fun render(viewState: AlbumsScreenViewState.AlbumsListLoaded) {
(headersRecyclerView.adapter as AlbumsHeaderAdapter).setItems(viewState.list)
(headersRecyclerView.adapter as AlbumsHeaderAdapter).setItems(
viewState.list.sortedByDescending { it.published }
)
headersRecyclerView.let {
it.scrollToPosition(
......@@ -166,28 +168,20 @@ class AlbumsScreenController :
)
}
try {
val urlToLoadBg =
viewState.list.first { it.albumId == viewState.selectedAlbumId }.previewUrl
Timber.d("URL TO LOAD BG $urlToLoadBg")
urlToLoadBg.let {
picassoAsync
.load(it)
.transform(BlurTransformation(activity, 13, 2))
.transform(ColorFilterTransformation(0xCC000000.toInt()))
.into(photosBackgroundTarget)
}
viewState.list.first { it.albumId == viewState.selectedAlbumId }.previewUrl.let {
picassoAsync
.load(it)
.transform(BlurTransformation(activity, 13, 2))
.transform(ColorFilterTransformation(0xCC000000.toInt()))
.into(photosBackgroundTarget)
}
catch (e:java.lang.Exception){Timber.e(e)}
}
private fun render(viewState: AlbumsScreenViewState.AlbumsSelected){
(albumsRecyclerView.adapter as AlbumListAdapter).setItems(viewState.list)
(albumsRecyclerView.adapter as AlbumListAdapter).setItems(
viewState.list.sortedByDescending { it.published }
)
}
......
......@@ -3,6 +3,7 @@ package com.biganto.visual.roompark.presentation.screen.favorites.util
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import androidx.recyclerview.widget.StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS
import butterknife.BindView
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.RoomParkApplication
......@@ -38,6 +39,9 @@ class AlbumListAdapter : CommonRecyclerAdapter<AlbumViewHolder, AlbumSortedModel
photosRecyclerView.isNestedScrollingEnabled = false
photosRecyclerView.layoutManager =
StaggeredGridLayoutManager(4, RecyclerView.VERTICAL)
(photosRecyclerView.layoutManager as StaggeredGridLayoutManager)
.gapStrategy = GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS
val adapter = PhotosAdapter()
photosRecyclerView.adapter = adapter
photosRecyclerView.itemAnimator = null
......
......@@ -11,6 +11,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="TextView" />
......@@ -18,8 +19,17 @@
android:id="@+id/photos_recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="vertical"
tools:itemCount="1"
tools:listitem="@layout/photo_preview_viewholder" />
<include
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="4dp"
android:layout_marginTop="16dp"
android:background="@color/colorGray" />
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment