Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
43eaa412
Commit
43eaa412
authored
Dec 16, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
need to develop isue with duplicated (4 times) wieholder album items
parent
eae58505
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
20 deletions
+28
-20
RetrofitModule.kt
...oompark/data/repository/api/retrofit/di/RetrofitModule.kt
+1
-1
ScreenController.kt
...l/roompark/presentation/screen/albums/ScreenController.kt
+12
-18
AlbumListAdapter.kt
...mpark/presentation/screen/albums/util/AlbumListAdapter.kt
+4
-0
date_album_viewholder.xml
app/src/main/res/layout/date_album_viewholder.xml
+11
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/di/RetrofitModule.kt
View file @
43eaa412
...
...
@@ -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
{
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/ScreenController.kt
View file @
43eaa412
...
...
@@ -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
(
0
xCC000000
.
toInt
()))
.
into
(
photosBackgroundTarget
)
}
viewState
.
list
.
first
{
it
.
albumId
==
viewState
.
selectedAlbumId
}.
previewUrl
.
let
{
picassoAsync
.
load
(
it
)
.
transform
(
BlurTransformation
(
activity
,
13
,
2
))
.
transform
(
ColorFilterTransformation
(
0
xCC000000
.
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
}
)
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/util/AlbumListAdapter.kt
View file @
43eaa412
...
...
@@ -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
...
...
app/src/main/res/layout/date_album_viewholder.xml
View file @
43eaa412
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment