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 ...@@ -33,7 +33,7 @@ private const val TIMEOUT_SECONDS=120L
private const val WRITE_SECONDS=120L private const val WRITE_SECONDS=120L
private const val READ_SECONDS=120L private const val READ_SECONDS=120L
val INTERCEPT_LOG_LEVEL = HttpLoggingInterceptor.Level.NONE val INTERCEPT_LOG_LEVEL = HttpLoggingInterceptor.Level.HEADERS
@Module @Module
class RetrofitModule{ class RetrofitModule{
......
...@@ -158,7 +158,9 @@ class AlbumsScreenController : ...@@ -158,7 +158,9 @@ class AlbumsScreenController :
lateinit var picassoAsync:Picasso lateinit var picassoAsync:Picasso
private fun render(viewState: AlbumsScreenViewState.AlbumsListLoaded) { 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 { headersRecyclerView.let {
it.scrollToPosition( it.scrollToPosition(
...@@ -166,28 +168,20 @@ class AlbumsScreenController : ...@@ -166,28 +168,20 @@ class AlbumsScreenController :
) )
} }
viewState.list.first { it.albumId == viewState.selectedAlbumId }.previewUrl.let {
try { picassoAsync
val urlToLoadBg = .load(it)
viewState.list.first { it.albumId == viewState.selectedAlbumId }.previewUrl .transform(BlurTransformation(activity, 13, 2))
Timber.d("URL TO LOAD BG $urlToLoadBg") .transform(ColorFilterTransformation(0xCC000000.toInt()))
urlToLoadBg.let { .into(photosBackgroundTarget)
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){ 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 ...@@ -3,6 +3,7 @@ package com.biganto.visual.roompark.presentation.screen.favorites.util
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager import androidx.recyclerview.widget.StaggeredGridLayoutManager
import androidx.recyclerview.widget.StaggeredGridLayoutManager.GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS
import butterknife.BindView import butterknife.BindView
import com.biganto.visual.roompark.R import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.RoomParkApplication import com.biganto.visual.roompark.base.RoomParkApplication
...@@ -38,6 +39,9 @@ class AlbumListAdapter : CommonRecyclerAdapter<AlbumViewHolder, AlbumSortedModel ...@@ -38,6 +39,9 @@ class AlbumListAdapter : CommonRecyclerAdapter<AlbumViewHolder, AlbumSortedModel
photosRecyclerView.isNestedScrollingEnabled = false photosRecyclerView.isNestedScrollingEnabled = false
photosRecyclerView.layoutManager = photosRecyclerView.layoutManager =
StaggeredGridLayoutManager(4, RecyclerView.VERTICAL) StaggeredGridLayoutManager(4, RecyclerView.VERTICAL)
(photosRecyclerView.layoutManager as StaggeredGridLayoutManager)
.gapStrategy = GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS
val adapter = PhotosAdapter() val adapter = PhotosAdapter()
photosRecyclerView.adapter = adapter photosRecyclerView.adapter = adapter
photosRecyclerView.itemAnimator = null photosRecyclerView.itemAnimator = null
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:text="TextView" /> android:text="TextView" />
...@@ -18,8 +19,17 @@ ...@@ -18,8 +19,17 @@
android:id="@+id/photos_recyclerview" android:id="@+id/photos_recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="12dp" android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="vertical" android:orientation="vertical"
tools:itemCount="1" tools:itemCount="1"
tools:listitem="@layout/photo_preview_viewholder" /> 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> </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