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
f387e3f6
Commit
f387e3f6
authored
Mar 23, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
photos addapter and viewholder
parent
dcef423f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
1 deletion
+62
-1
ScreenController.kt
.../roompark/presentation/screen/article/ScreenController.kt
+14
-0
articleBottomPhotoAdapter.kt
...entation/screen/article/util/articleBottomPhotoAdapter.kt
+39
-0
feed_read_screen.xml
app/src/main/res/layout/feed_read_screen.xml
+1
-1
photo_article_slider_viewholder.xml
app/src/main/res/layout/photo_article_slider_viewholder.xml
+8
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/ScreenController.kt
View file @
f387e3f6
...
@@ -13,6 +13,7 @@ import com.biganto.visual.roompark.R
...
@@ -13,6 +13,7 @@ import com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.presentation.screen.article.util.ArticleBottomPhotoAdapter
import
com.biganto.visual.roompark.presentation.screen.article.util.HtmlPageAdapter
import
com.biganto.visual.roompark.presentation.screen.article.util.HtmlPageAdapter
import
com.biganto.visual.roompark.presentation.screen.article.util.HtmlTag
import
com.biganto.visual.roompark.presentation.screen.article.util.HtmlTag
import
com.biganto.visual.roompark.util.extensions.formatToSimple
import
com.biganto.visual.roompark.util.extensions.formatToSimple
...
@@ -56,6 +57,9 @@ class ArticleScreenController :
...
@@ -56,6 +57,9 @@ class ArticleScreenController :
@BindView
(
R
.
id
.
articleBodyRecyclerView
)
@BindView
(
R
.
id
.
articleBodyRecyclerView
)
lateinit
var
articleRecyclerView
:
RecyclerView
lateinit
var
articleRecyclerView
:
RecyclerView
@BindView
(
R
.
id
.
article_photos_recylcerView
)
lateinit
var
bottomPhotosRecyclerView
:
RecyclerView
private
val
blurPreview
:
ImageView
by
lazy
{
private
val
blurPreview
:
ImageView
by
lazy
{
headerBlock
.
findViewById
<
ImageView
>(
R
.
id
.
articlePreviewBlurred
)
headerBlock
.
findViewById
<
ImageView
>(
R
.
id
.
articlePreviewBlurred
)
}
}
...
@@ -79,6 +83,12 @@ class ArticleScreenController :
...
@@ -79,6 +83,12 @@ class ArticleScreenController :
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
LinearLayoutManager
(
activity
,
RecyclerView
.
VERTICAL
,
false
)
articleRecyclerView
.
adapter
=
HtmlPageAdapter
()
articleRecyclerView
.
adapter
=
HtmlPageAdapter
()
articleRecyclerView
.
itemAnimator
=
null
articleRecyclerView
.
itemAnimator
=
null
bottomPhotosRecyclerView
.
layoutManager
=
LinearLayoutManager
(
activity
,
RecyclerView
.
HORIZONTAL
,
false
)
bottomPhotosRecyclerView
.
adapter
=
ArticleBottomPhotoAdapter
()
bottomPhotosRecyclerView
.
itemAnimator
=
null
}
}
override
fun
onViewBound
(
v
:
View
)
{
override
fun
onViewBound
(
v
:
View
)
{
...
@@ -121,6 +131,10 @@ class ArticleScreenController :
...
@@ -121,6 +131,10 @@ class ArticleScreenController :
articleDate
.
text
=
viewState
.
item
.
published
.
formatToSimple
articleDate
.
text
=
viewState
.
item
.
published
.
formatToSimple
viewState
.
item
.
bottomPhotoList
?.
let
{
(
bottomPhotosRecyclerView
.
adapter
as
ArticleBottomPhotoAdapter
).
setItems
(
it
)
}
Glide
.
with
(
blurPreview
)
Glide
.
with
(
blurPreview
)
.
load
(
viewState
.
item
.
previewUrl
)
.
load
(
viewState
.
item
.
previewUrl
)
.
transform
(
BlurTransformation
(
40
,
4
))
.
transform
(
BlurTransformation
(
40
,
4
))
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/util/articleBottomPhotoAdapter.kt
0 → 100644
View file @
f387e3f6
package
com.biganto.visual.roompark.presentation.screen.article.util
import
android.view.View
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.data.repository.db.requrey.TitledPhoto
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import
com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
kotlin.reflect.KClass
/**
* Created by Vladislav Bogdashkin on 29.01.2020.
*/
class
ArticleBottomPhotoAdapter
:
CommonRecyclerAdapter
<
ArticleBottomPhotoViewHolder
,
TitledPhoto
>()
{
override
val
vhKlazz
:
KClass
<
ArticleBottomPhotoViewHolder
>
get
()
=
ArticleBottomPhotoViewHolder
::
class
override
fun
getVhLayout
():
Int
=
R
.
layout
.
photo_article_slider_viewholder
}
class
ArticleBottomPhotoViewHolder
(
itemView
:
View
)
:
CommonViewHolder
<
TitledPhoto
>(
itemView
){
override
fun
onViewBound
(
model
:
TitledPhoto
)
{
// articleTitle.text = model.title
Glide
.
with
(
itemView
)
.
load
(
model
.
url
)
.
centerCrop
()
.
fitCenter
()
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
into
((
itemView
as
RoundedImageView
))
}
}
app/src/main/res/layout/feed_read_screen.xml
View file @
f387e3f6
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/article_photos_
viewholder
"
android:id=
"@+id/article_photos_
recylcerView
"
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:layout_marginTop=
"32dp"
...
...
app/src/main/res/layout/photo_article_slider_viewholder.xml
0 → 100644
View file @
f387e3f6
<?xml version="1.0" encoding="utf-8"?>
<com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"256dp"
android:layout_height=
"228dp"
android:layout_margin=
"16dp"
android:scaleType=
"centerCrop"
app:image_corner_radius=
"4dp"
/>
\ 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