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
5aee3fcb
Commit
5aee3fcb
authored
Dec 18, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix albums layout
parent
17cfe07f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
25 deletions
+19
-25
ScreenController.kt
...l/roompark/presentation/screen/albums/ScreenController.kt
+13
-21
albums_screen.xml
app/src/main/res/layout/albums_screen.xml
+6
-4
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/ScreenController.kt
View file @
5aee3fcb
...
@@ -19,6 +19,7 @@ import com.biganto.visual.roompark.presentation.screen.albums.util.AlbumsHeaderA
...
@@ -19,6 +19,7 @@ import com.biganto.visual.roompark.presentation.screen.albums.util.AlbumsHeaderA
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.extensions.scaleCenterCrop
import
com.biganto.visual.roompark.util.extensions.scaleCenterCrop
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
com.biganto.visual.roompark.util.view_utils.grid.CeilsDecoration
import
com.google.android.material.textview.MaterialTextView
import
com.squareup.picasso.Picasso
import
com.squareup.picasso.Picasso
import
jp.wasabeef.picasso.transformations.BlurTransformation
import
jp.wasabeef.picasso.transformations.BlurTransformation
import
jp.wasabeef.picasso.transformations.ColorFilterTransformation
import
jp.wasabeef.picasso.transformations.ColorFilterTransformation
...
@@ -49,19 +50,18 @@ class AlbumsScreenController :
...
@@ -49,19 +50,18 @@ class AlbumsScreenController :
@BindView
(
R
.
id
.
albums_recycler_view
)
@BindView
(
R
.
id
.
albums_recycler_view
)
lateinit
var
albumsRecyclerView
:
RecyclerView
lateinit
var
albumsRecyclerView
:
RecyclerView
@BindView
(
R
.
id
.
photo_albums_container
)
@BindView
(
R
.
id
.
photo_albums_container
)
lateinit
var
nestedScrollView
:
NestedScrollView
lateinit
var
nestedScrollView
:
NestedScrollView
@BindView
(
R
.
id
.
header_album_title
)
lateinit
var
currentAlbomTitle
:
MaterialTextView
val
photosBackgroundTarget
=
object
:
com
.
squareup
.
picasso
.
Target
{
private
val
photosBackgroundTarget
=
object
:
com
.
squareup
.
picasso
.
Target
{
override
fun
onPrepareLoad
(
placeHolderDrawable
:
Drawable
?)
{
override
fun
onPrepareLoad
(
placeHolderDrawable
:
Drawable
?)
{
Timber
.
d
(
"View measures: 1 - "
+
"${nestedScrollView.width} "
+
"/ ${nestedScrollView.height} "
+
"/ ${nestedScrollView.measuredWidth} "
+
"/${nestedScrollView.measuredHeight}"
)
nestedScrollView
.
background
=
placeHolderDrawable
nestedScrollView
.
background
=
placeHolderDrawable
}
}
...
@@ -70,19 +70,10 @@ class AlbumsScreenController :
...
@@ -70,19 +70,10 @@ class AlbumsScreenController :
}
}
override
fun
onBitmapLoaded
(
bitmap
:
Bitmap
?,
from
:
Picasso
.
LoadedFrom
?)
{
override
fun
onBitmapLoaded
(
bitmap
:
Bitmap
?,
from
:
Picasso
.
LoadedFrom
?)
{
Timber
.
d
(
"View measures: 2 - "
+
bitmap
?.
scaleCenterCrop
(
nestedScrollView
)
?.
let
{
"${nestedScrollView.width} "
+
nestedScrollView
.
background
=
BitmapDrawable
(
activity
?.
resources
,
it
)
"/ ${nestedScrollView.height} "
+
}
"/ ${nestedScrollView.measuredWidth} "
+
"/${nestedScrollView.measuredHeight}"
)
val
croppedBtimpa
=
bitmap
?.
scaleCenterCrop
(
nestedScrollView
)
nestedScrollView
.
background
=
BitmapDrawable
(
activity
?.
resources
,
croppedBtimpa
)
}
}
}
}
...
@@ -168,9 +159,10 @@ class AlbumsScreenController :
...
@@ -168,9 +159,10 @@ class AlbumsScreenController :
)
)
}
}
viewState
.
list
.
first
{
it
.
albumId
==
viewState
.
selectedAlbumId
}.
previewUrl
.
let
{
viewState
.
list
.
first
{
it
.
albumId
==
viewState
.
selectedAlbumId
}.
let
{
currentAlbomTitle
.
text
=
it
.
title
picassoAsync
picassoAsync
.
load
(
it
)
.
load
(
it
.
previewUrl
)
.
transform
(
BlurTransformation
(
activity
,
13
,
2
))
.
transform
(
BlurTransformation
(
activity
,
13
,
2
))
.
transform
(
ColorFilterTransformation
(
0
xCC000000
.
toInt
()))
.
transform
(
ColorFilterTransformation
(
0
xCC000000
.
toInt
()))
.
into
(
photosBackgroundTarget
)
.
into
(
photosBackgroundTarget
)
...
...
app/src/main/res/layout/albums_screen.xml
View file @
5aee3fcb
...
@@ -10,20 +10,21 @@
...
@@ -10,20 +10,21 @@
<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"
android:layout_height=
"
wrap_content
"
android:layout_height=
"
121dp
"
android:background=
"@color/colorPrimary"
android:background=
"@color/colorPrimary"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:itemCount=
"1"
tools:itemCount=
"1"
tools:listitem=
"@layout/
estate_card
_viewholder"
/>
tools:listitem=
"@layout/
album_header_preview
_viewholder"
/>
<androidx.core.widget.NestedScrollView
<androidx.core.widget.NestedScrollView
android:id=
"@+id/photo_albums_container"
android:id=
"@+id/photo_albums_container"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:layout_weight=
"1"
>
android:layout_weight=
"1"
android:background=
"@color/colorOpacityBackground"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -34,13 +35,14 @@
...
@@ -34,13 +35,14 @@
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"32dp"
android:orientation=
"horizontal"
>
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=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
...
...
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