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
ddbb760d
Commit
ddbb760d
authored
Mar 23, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix miscellaneous
parent
3efb4f3f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
62 additions
and
25 deletions
+62
-25
ScreenController.kt
.../roompark/presentation/screen/article/ScreenController.kt
+2
-5
ScreenController.kt
...oompark/presentation/screen/feed_list/ScreenController.kt
+17
-0
ScreenPresenter.kt
...roompark/presentation/screen/feed_list/ScreenPresenter.kt
+15
-4
ScreenViewState.kt
...roompark/presentation/screen/feed_list/ScreenViewState.kt
+7
-1
ScreenPresenter.kt
...ual/roompark/presentation/screen/feeds/ScreenPresenter.kt
+17
-8
ScreenViewState.kt
...ual/roompark/presentation/screen/feeds/ScreenViewState.kt
+1
-1
feed_read_header.xml
app/src/main/res/layout/feed_read_header.xml
+3
-6
No files found.
app/src/main/java/com/biganto/visual/roompark/presentation/screen/article/ScreenController.kt
View file @
ddbb760d
...
...
@@ -15,21 +15,17 @@ import com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.conductor.BigantoBaseController
import
com.biganto.visual.roompark.conductor.dialogs.PhotoDialogController
import
com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler
import
com.biganto.visual.roompark.domain.model.FeedModel
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.HtmlTag
import
com.biganto.visual.roompark.util.extensions.formatToSimple
import
com.biganto.visual.roompark.util.extensions.setGone
import
com.bluelinelabs.conductor.RouterTransaction
import
com.bumptech.glide.Glide
import
com.bumptech.glide.load.engine.DiskCacheStrategy
import
com.google.android.material.textview.MaterialTextView
import
com.jakewharton.rxbinding3.recyclerview.scrollStateChanges
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
jp.wasabeef.glide.transformations.BlurTransformation
import
timber.log.Timber
import
java.util.concurrent.TimeUnit
import
javax.inject.Inject
...
...
@@ -150,6 +146,7 @@ class ArticleScreenController :
articleDate
.
text
=
viewState
.
item
.
published
.
formatToSimple
bottomPhotosRecyclerView
.
setGone
(
viewState
.
item
.
bottomPhotoList
.
isNullOrEmpty
())
viewState
.
item
.
bottomPhotoList
?.
let
{
(
bottomPhotosRecyclerView
.
adapter
as
ArticleBottomPhotoAdapter
).
setItems
(
it
)
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feed_list/ScreenController.kt
View file @
ddbb760d
...
...
@@ -123,6 +123,7 @@ class ArticlesScreenController :
is
ArticlesScreenViewState
.
Idle
->
render
(
viewState
)
is
ArticlesScreenViewState
.
ArticlesLoaded
->
render
(
viewState
)
is
ArticlesScreenViewState
.
ArticlesScrollPage
->
render
(
viewState
)
is
ArticlesScreenViewState
.
RestoreView
->
render
(
viewState
)
is
ArticlesScreenViewState
.
SomeError
->
render
(
viewState
)
}
}
...
...
@@ -144,6 +145,22 @@ class ArticlesScreenController :
(
articlesRecyclerView
.
adapter
as
ArticlesAdapter
).
addItems
(
viewState
.
items
)
}
private
fun
render
(
viewState
:
ArticlesScreenViewState
.
RestoreView
){
progressBar
.
setGone
(
true
)
emptyListNotice
.
setGone
(
true
)
articlesRecyclerView
.
setGone
(
true
)
if
(
viewState
.
restore
.
articles
.
isNullOrEmpty
())
{
emptyListNotice
.
setGone
(
false
)
articlesRecyclerView
.
setGone
(
true
)
}
else
{
emptyListNotice
.
setGone
(
true
)
articlesRecyclerView
.
setGone
(
false
)
(
articlesRecyclerView
.
adapter
as
ArticlesAdapter
).
setItems
(
viewState
.
restore
.
articles
)
}
}
private
fun
render
(
viewState
:
ArticlesScreenViewState
.
ArticlesLoaded
)
{
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feed_list/ScreenPresenter.kt
View file @
ddbb760d
...
...
@@ -23,6 +23,14 @@ class ArticlesScreenPresenter @Inject constructor(
)
:
BigantoBasePresenter
<
ArticlesScreen
,
ArticlesScreenViewState
>()
{
private
val
restoreModel
=
RestoreModel
(
mutableListOf
())
override
fun
detachView
()
{
super
.
detachView
()
restoreStateObservable
.
accept
(
ArticlesScreenViewState
.
RestoreView
(
restoreModel
))
}
override
fun
defaultErrorViewStateHandler
()
=
{
e
:
ExceptionString
->
ArticlesScreenViewState
.
SomeError
(
e
)}
...
...
@@ -35,10 +43,13 @@ class ArticlesScreenPresenter @Inject constructor(
val
getNewArticlesPage
=
intent
(
ArticlesScreen
::
requsetsNewArticles
)
.
flatMap
{
interactor
.
fetchArticlesPage
(
feedId
,
FEED_PAGE_SIZE
,
it
)
}
.
map
<
ArticlesScreenViewState
>
{
// restoreModel.articles = it.articles
Timber
.
d
(
"arrived list: ${it.articles.size}"
)
ArticlesScreenViewState
.
ArticlesScrollPage
(
it
.
articles
.
toList
())
.
map
<
ArticlesScreenViewState
>
{
articlePage
->
articlePage
.
articles
.
asSequence
()
.
filter
{
!
restoreModel
.
articles
.
contains
(
it
)
}
.
toList
()
.
let
{
uniqueItems
->
restoreModel
.
articles
.
addAll
(
uniqueItems
)}
ArticlesScreenViewState
.
ArticlesScrollPage
(
articlePage
.
articles
.
toList
())
}
.
onErrorReturn
(
::
parseError
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feed_list/ScreenViewState.kt
View file @
ddbb760d
...
...
@@ -14,4 +14,10 @@ sealed class ArticlesScreenViewState : BigantoBaseViewState() {
class
ArticlesLoaded
(
val
items
:
List
<
ArticlePreviewModel
>)
:
ArticlesScreenViewState
()
class
SomeError
(
val
exception
:
ExceptionString
)
:
ArticlesScreenViewState
()
class
ArticlesScrollPage
(
val
items
:
List
<
ArticlePreviewModel
>)
:
ArticlesScreenViewState
()
class
RestoreView
(
val
restore
:
RestoreModel
)
:
ArticlesScreenViewState
()
}
data class
RestoreModel
(
var
articles
:
MutableList
<
ArticlePreviewModel
>
)
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenPresenter.kt
View file @
ddbb760d
...
...
@@ -28,7 +28,8 @@ class FeedsScreenPresenter @Inject constructor(
arrayListOf
(),
arrayListOf
(),
arrayListOf
(),
arrayListOf
())
mutableListOf
()
)
override
fun
attachView
(
view
:
FeedsScreen
)
{
...
...
@@ -67,9 +68,13 @@ class FeedsScreenPresenter @Inject constructor(
val
getFeedArticlesPreview
=
intent
(
FeedsScreen
::
feedsTabSelected
)
.
flatMap
{
interactor
.
fetchArticles
(
it
)
}
.
map
<
FeedsScreenViewState
>
{
restoreModel
.
articles
=
it
.
articles
FeedsScreenViewState
.
GetFeedArticlesPreview
(
it
.
articles
.
toList
())
.
map
<
FeedsScreenViewState
>
{
articlePage
->
articlePage
.
articles
.
asSequence
()
.
filter
{
!
restoreModel
.
articles
.
contains
(
it
)
}
.
toList
()
.
let
{
uniqueItems
->
restoreModel
.
articles
.
addAll
(
uniqueItems
)}
FeedsScreenViewState
.
GetFeedArticlesPreview
(
articlePage
.
articles
.
toList
())
}
.
onErrorReturn
(
::
parseError
)
...
...
@@ -95,10 +100,14 @@ class FeedsScreenPresenter @Inject constructor(
val
getNewArticlesPage
=
intent
(
FeedsScreen
::
requsetsNewArticles
)
.
flatMap
{
interactor
.
fetchArticles
(
it
.
first
.
alias
,
FEED_PREVIEW_PAGE_SIZE
,
it
.
second
)
}
.
map
<
FeedsScreenViewState
>
{
restoreModel
.
articles
=
it
.
articles
Timber
.
d
(
"arrived list: ${it.articles.size}"
)
FeedsScreenViewState
.
ArticlesScrollPage
(
it
.
articles
.
toList
())
.
map
<
FeedsScreenViewState
>
{
articlePage
->
articlePage
.
articles
.
asSequence
()
.
filter
{
!
restoreModel
.
articles
.
contains
(
it
)
}
.
toList
()
.
let
{
uniqueItems
->
restoreModel
.
articles
.
addAll
(
uniqueItems
)}
FeedsScreenViewState
.
ArticlesScrollPage
(
articlePage
.
articles
.
toList
())
}
.
onErrorReturn
(
::
parseError
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenViewState.kt
View file @
ddbb760d
...
...
@@ -38,5 +38,5 @@ data class RestoreModel(
var
feeds
:
List
<
FeedModel
>,
var
albums
:
List
<
AlbumPreviewModel
>,
var
cams
:
List
<
WebCamModel
>,
var
articles
:
List
<
ArticlePreviewModel
>
var
articles
:
MutableList
<
ArticlePreviewModel
>
)
\ No newline at end of file
app/src/main/res/layout/feed_read_header.xml
View file @
ddbb760d
...
...
@@ -16,19 +16,17 @@
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:srcCompat=
"@drawable/default_image_placeholder"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<com.biganto.visual.roompark.util.view_utils.image_view.RoundedImageView
android:id=
"@+id/articlePreview"
app:image_corner_radius=
"4dp"
android:layout_width=
"125dp"
android:layout_height=
"125dp"
android:layout_marginStart=
"16dp"
android:layout_marginTop=
"44dp"
app:image_corner_radius=
"4dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:srcCompat=
"@drawable/ic_favorites"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<com.google.android.material.textview.MaterialTextView
android:id=
"@+id/articleDate"
...
...
@@ -37,7 +35,6 @@
android:layout_height=
"wrap_content"
android:layout_marginStart=
"24dp"
android:includeFontPadding=
"false"
android:text=
"22 / 02 / 2019"
android:visibility=
"visible"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
...
...
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