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
...
@@ -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
{
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/ScreenController.kt
View file @
43eaa412
...
@@ -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
(
0
xCC000000
.
toInt
()))
urlToLoadBg
.
let
{
.
into
(
photosBackgroundTarget
)
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
){
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
...
@@ -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
...
...
app/src/main/res/layout/date_album_viewholder.xml
View file @
43eaa412
...
@@ -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
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