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
fdcdf6b9
Commit
fdcdf6b9
authored
Dec 13, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
albums header scroll via nestedScrollView
parent
598c2505
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
55 deletions
+84
-55
ScreenController.kt
...l/roompark/presentation/screen/albums/ScreenController.kt
+11
-2
AlbumListAdapter.kt
...mpark/presentation/screen/albums/util/AlbumListAdapter.kt
+1
-1
albums_screen.xml
app/src/main/res/layout/albums_screen.xml
+61
-46
date_album_viewholder.xml
app/src/main/res/layout/date_album_viewholder.xml
+11
-6
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/ScreenController.kt
View file @
fdcdf6b9
...
@@ -3,6 +3,7 @@ package com.biganto.visual.roompark.presentation.screen.albums
...
@@ -3,6 +3,7 @@ package com.biganto.visual.roompark.presentation.screen.albums
import
android.os.Bundle
import
android.os.Bundle
import
android.view.View
import
android.view.View
import
androidx.core.os.bundleOf
import
androidx.core.os.bundleOf
import
androidx.core.widget.NestedScrollView
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
butterknife.BindView
import
butterknife.BindView
...
@@ -14,6 +15,7 @@ import com.biganto.visual.roompark.conductor.BigantoBaseController
...
@@ -14,6 +15,7 @@ import com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.presentation.screen.albums.util.AlbumsHeaderAdapter
import
com.biganto.visual.roompark.presentation.screen.albums.util.AlbumsHeaderAdapter
import
com.biganto.visual.roompark.presentation.screen.favorites.util.AlbumListAdapter
import
com.biganto.visual.roompark.presentation.screen.favorites.util.AlbumListAdapter
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
com.squareup.picasso.Picasso
import
javax.inject.Inject
import
javax.inject.Inject
...
@@ -41,9 +43,15 @@ class AlbumsScreenController :
...
@@ -41,9 +43,15 @@ class AlbumsScreenController :
lateinit
var
albumsRecyclerView
:
RecyclerView
lateinit
var
albumsRecyclerView
:
RecyclerView
@BindView
(
R
.
id
.
photo_albums_container
)
lateinit
var
nestedScrollView
:
NestedScrollView
private
fun
bindRecycler
()
{
private
fun
bindRecycler
()
{
headersRecyclerView
.
isNestedScrollingEnabled
=
tru
e
headersRecyclerView
.
isNestedScrollingEnabled
=
fals
e
headersRecyclerView
.
layoutManager
=
headersRecyclerView
.
layoutManager
=
LinearLayoutManager
(
activity
,
RecyclerView
.
HORIZONTAL
,
false
)
LinearLayoutManager
(
activity
,
RecyclerView
.
HORIZONTAL
,
false
)
headersRecyclerView
.
adapter
=
AlbumsHeaderAdapter
()
headersRecyclerView
.
adapter
=
AlbumsHeaderAdapter
()
...
@@ -55,7 +63,7 @@ class AlbumsScreenController :
...
@@ -55,7 +63,7 @@ class AlbumsScreenController :
,
resources
?.
getDimensionPixelSize
(
R
.
dimen
.
ceil_grid_padding
))
,
resources
?.
getDimensionPixelSize
(
R
.
dimen
.
ceil_grid_padding
))
)
)
albumsRecyclerView
.
isNestedScrollingEnabled
=
tru
e
albumsRecyclerView
.
isNestedScrollingEnabled
=
fals
e
albumsRecyclerView
.
layoutManager
=
albumsRecyclerView
.
layoutManager
=
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
albumsRecyclerView
.
adapter
=
AlbumListAdapter
()
albumsRecyclerView
.
adapter
=
AlbumListAdapter
()
...
@@ -118,6 +126,7 @@ class AlbumsScreenController :
...
@@ -118,6 +126,7 @@ class AlbumsScreenController :
(
it
.
adapter
as
AlbumsHeaderAdapter
).
getItemPosition
(
viewState
.
selectedAlbumId
)
(
it
.
adapter
as
AlbumsHeaderAdapter
).
getItemPosition
(
viewState
.
selectedAlbumId
)
)
)
}
}
}
}
private
fun
render
(
viewState
:
AlbumsScreenViewState
.
AlbumsSelected
){
private
fun
render
(
viewState
:
AlbumsScreenViewState
.
AlbumsSelected
){
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/util/AlbumListAdapter.kt
View file @
fdcdf6b9
...
@@ -35,7 +35,7 @@ class AlbumListAdapter : CommonRecyclerAdapter<AlbumViewHolder, AlbumSortedModel
...
@@ -35,7 +35,7 @@ class AlbumListAdapter : CommonRecyclerAdapter<AlbumViewHolder, AlbumSortedModel
override
fun
onViewBound
(
model
:
AlbumSortedModel
)
{
override
fun
onViewBound
(
model
:
AlbumSortedModel
)
{
albumTitle
.
text
=
model
.
title
albumTitle
.
text
=
model
.
title
photosRecyclerView
.
isNestedScrollingEnabled
=
tru
e
photosRecyclerView
.
isNestedScrollingEnabled
=
fals
e
photosRecyclerView
.
layoutManager
=
photosRecyclerView
.
layoutManager
=
StaggeredGridLayoutManager
(
4
,
RecyclerView
.
VERTICAL
)
StaggeredGridLayoutManager
(
4
,
RecyclerView
.
VERTICAL
)
val
adapter
=
PhotosAdapter
()
val
adapter
=
PhotosAdapter
()
...
...
app/src/main/res/layout/albums_screen.xml
View file @
fdcdf6b9
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<
androidx.constraintlayout.widget.Constraint
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/container"
android:id=
"@+id/container"
...
@@ -8,18 +8,6 @@
...
@@ -8,18 +8,6 @@
android:background=
"@color/colorOpacityBackground"
android:background=
"@color/colorOpacityBackground"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/albums_recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginStart=
"16dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/include12"
tools:itemCount=
"3"
tools:listitem=
"@layout/date_album_viewholder"
/>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/headers_recycler_view"
android:id=
"@+id/headers_recycler_view"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -32,39 +20,66 @@
...
@@ -32,39 +20,66 @@
tools:itemCount=
"1"
tools:itemCount=
"1"
tools:listitem=
"@layout/estate_card_viewholder"
/>
tools:listitem=
"@layout/estate_card_viewholder"
/>
<androidx.core.widget.NestedScrollView
android:id=
"@+id/photo_albums_container"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/header_album_title"
android:id=
"@+id/header_album_title"
style=
"@style/Header_TextView.Inverted_Header"
style=
"@style/Header_TextView.Inverted_Header"
android:layout_width=
"0dp
"
android:layout_width=
"wrap_content
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"32dp
"
android:layout_weight=
"1
"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:text=
"Дом №1"
android:text=
"Дом №1"
/>
android:textAlignment=
"viewStart"
app:layout_constraintEnd_toStartOf=
"@+id/include"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/headers_recycler_view"
/>
<include
<include
android:id=
"@+id/include"
android:id=
"@+id/include"
layout=
"@layout/bell_switch_view"
layout=
"@layout/bell_switch_view"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"32dp
"
android:layout_gravity=
"center_vertical
"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
app:layout_constraintBottom_toBottomOf=
"@+id/header_album_title"
android:baselineAligned=
"false"
app:layout_constraintEnd_toEndOf=
"parent"
android:gravity=
"center_vertical|end"
/>
app:layout_constraintTop_toBottomOf=
"@+id/headers_recycler_view"
/>
</LinearLayout>
<include
<include
android:id=
"@+id/include12"
android:id=
"@+id/include12"
layout=
"@layout/horizontal_divider"
layout=
"@layout/horizontal_divider"
android:layout_width=
"0dp
"
android:layout_width=
"match_parent
"
android:layout_height=
"1dp"
android:layout_height=
"1dp"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
app:layout_constraintEnd_toEndOf=
"parent"
android:backgroundTint=
"@color/colorOpacityBackgroundInv"
/>
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/header_album_title"
/>
<androidx.recyclerview.widget.RecyclerView
</androidx.constraintlayout.widget.ConstraintLayout>
android:id=
"@+id/albums_recycler_view"
\ No newline at end of file
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"12dp"
tools:itemCount=
"2"
tools:listitem=
"@layout/date_album_viewholder"
/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/date_album_viewholder.xml
View file @
fdcdf6b9
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_height=
"match_parent"
>
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
style=
"@style/Common_Text.Inverted"
android:id=
"@+id/date_title_textview"
android:id=
"@+id/date_title_textview"
style=
"@style/Common_Text.Inverted"
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_marginEnd=
"16dp"
android:text=
"TextView"
/>
android:text=
"TextView"
/>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
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_marginTop=
"8dp"
android:layout_marginEnd=
"12dp"
android:layout_marginBottom=
"16dp"
android:orientation=
"vertical"
android:orientation=
"vertical"
/>
tools:itemCount=
"1"
tools:listitem=
"@layout/photo_preview_viewholder"
/>
</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