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
00df4a29
Commit
00df4a29
authored
Mar 19, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix read flag (remove hardcoded value)
parent
e3619ad6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
11 deletions
+15
-11
FeedsRepository.kt
...nto/visual/roompark/data/data_provider/FeedsRepository.kt
+1
-3
feeds.kt
...in/java/com/biganto/visual/roompark/domain/model/feeds.kt
+5
-5
ScreenPresenter.kt
...sual/roompark/presentation/screen/auth/ScreenPresenter.kt
+1
-1
ScreenPresenter.kt
...ual/roompark/presentation/screen/deals/ScreenPresenter.kt
+1
-0
Adapter.kt
...visual/roompark/presentation/screen/deals/util/Adapter.kt
+1
-1
ScreenPresenter.kt
...roompark/presentation/screen/favorites/ScreenPresenter.kt
+1
-0
ScreenPresenter.kt
...roompark/presentation/screen/feed_list/ScreenPresenter.kt
+1
-0
Adapter.kt
...al/roompark/presentation/screen/feed_list/util/Adapter.kt
+2
-0
feed_direct_viewholder.xml
app/src/main/res/layout/feed_direct_viewholder.xml
+2
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/data/data_provider/FeedsRepository.kt
View file @
00df4a29
...
@@ -55,7 +55,6 @@ class FeedsContractModule @Inject constructor(
...
@@ -55,7 +55,6 @@ class FeedsContractModule @Inject constructor(
.
doOnNext
{
Timber
.
d
(
"raw0 $it"
)
}
.
doOnNext
{
Timber
.
d
(
"raw0 $it"
)
}
.
map
{
it
.
items
}
.
map
{
it
.
items
}
.
map
{
fromRaw
(
it
,
feedAlias
)
}
.
map
{
fromRaw
(
it
,
feedAlias
)
}
.
doOnNext
{
Timber
.
d
(
"raw enitites $it"
)
}
.
doOnNext
(
db
::
blockingUpsert
)
.
doOnNext
(
db
::
blockingUpsert
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
...
@@ -66,7 +65,6 @@ class FeedsContractModule @Inject constructor(
...
@@ -66,7 +65,6 @@ class FeedsContractModule @Inject constructor(
db
.
fetchArticles
(
feedAlias
,
pageSize
,
startIndex
)
db
.
fetchArticles
(
feedAlias
,
pageSize
,
startIndex
)
.
toList
()
.
toList
()
.
toObservable
()
.
toObservable
()
.
doOnNext
{
Timber
.
d
(
"db items: ${it.size}"
)
}
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
private
fun
fetchArticles
(
feedAlias
:
String
,
pageSize
:
Int
=
10
,
startIndex
:
Int
=
0
)
private
fun
fetchArticles
(
feedAlias
:
String
,
pageSize
:
Int
=
10
,
startIndex
:
Int
=
0
)
...
@@ -123,7 +121,7 @@ class FeedsContractModule @Inject constructor(
...
@@ -123,7 +121,7 @@ class FeedsContractModule @Inject constructor(
private
fun
fetchArticle
(
articleId
:
Int
):
Observable
<
ArticleModel
>
=
private
fun
fetchArticle
(
articleId
:
Int
):
Observable
<
ArticleModel
>
=
Observable
.
mergeDelayError
(
Observable
.
mergeDelayError
(
arrayListOf
(
fetchArticleDb
(
articleId
),
fetchArticleApi
(
articleId
))
arrayListOf
(
fetchArticleDb
(
articleId
),
fetchArticleApi
(
articleId
))
).
map
{
fromEntity
(
it
,
true
)
}
).
map
{
fromEntity
(
it
)
}
override
fun
articleRead
(
articleId
:
Int
):
Completable
=
override
fun
articleRead
(
articleId
:
Int
):
Completable
=
db
.
setArticleReadState
(
articleId
,
true
)
db
.
setArticleReadState
(
articleId
,
true
)
...
...
app/src/main/java/com/biganto/visual/roompark/domain/model/feeds.kt
View file @
00df4a29
...
@@ -48,22 +48,22 @@ fun fromEntity(entity: FeedEntity):FeedModel = FeedModel(
...
@@ -48,22 +48,22 @@ fun fromEntity(entity: FeedEntity):FeedModel = FeedModel(
alias
=
entity
.
alias
alias
=
entity
.
alias
)
)
fun
fromEntity
(
entity
:
ArticleEntity
):
ArticlePreviewModel
=
ArticlePreviewModel
(
fun
fromEntity
Preview
(
entity
:
ArticleEntity
):
ArticlePreviewModel
=
ArticlePreviewModel
(
articleId
=
entity
.
id
,
articleId
=
entity
.
id
,
published
=
entity
.
published
,
published
=
entity
.
published
,
title
=
entity
.
title
,
title
=
entity
.
title
,
announce
=
entity
.
announce
?:
""
,
announce
=
entity
.
announce
?:
""
,
previewUrl
=
entity
.
preview
?:
""
,
previewUrl
=
entity
.
preview
?:
""
,
isRead
=
false
isRead
=
entity
.
read
)
)
fun
fromEntity
(
parentId
:
String
,
entity
:
List
<
ArticleEntity
>):
ArticlesPreviewModel
=
fun
fromEntity
(
parentId
:
String
,
entity
:
List
<
ArticleEntity
>):
ArticlesPreviewModel
=
ArticlesPreviewModel
(
ArticlesPreviewModel
(
parentFeedAlias
=
parentId
,
parentFeedAlias
=
parentId
,
articles
=
fromEntity
(
entity
,
::
fromEntity
)
articles
=
fromEntity
(
entity
,
::
fromEntity
Preview
)
)
)
fun
fromEntity
(
entity
:
ArticleEntity
,
read
:
Boolean
)
:
ArticleModel
=
fun
fromEntity
(
entity
:
ArticleEntity
)
:
ArticleModel
=
ArticleModel
(
ArticleModel
(
articleId
=
entity
.
id
,
articleId
=
entity
.
id
,
published
=
entity
.
published
,
published
=
entity
.
published
,
...
@@ -71,7 +71,7 @@ fun fromEntity(entity: ArticleEntity,read:Boolean) : ArticleModel =
...
@@ -71,7 +71,7 @@ fun fromEntity(entity: ArticleEntity,read:Boolean) : ArticleModel =
htmlBody
=
entity
.
body
!!
,
htmlBody
=
entity
.
body
!!
,
previewUrl
=
entity
.
preview
?:
DEFAULT_ROOM_PARK_PREVIEW
,
previewUrl
=
entity
.
preview
?:
DEFAULT_ROOM_PARK_PREVIEW
,
bottomPhotoList
=
entity
.
photo
,
bottomPhotoList
=
entity
.
photo
,
isRead
=
read
isRead
=
entity
.
read
)
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/auth/ScreenPresenter.kt
View file @
00df4a29
...
@@ -46,7 +46,7 @@ class AuthScreenPresenter @Inject constructor(
...
@@ -46,7 +46,7 @@ class AuthScreenPresenter @Inject constructor(
val
state
=
restoreStateObservable
val
state
=
restoreStateObservable
.
mergeWith
(
onAuth
)
.
mergeWith
(
onAuth
)
.
doOnError
{
Timber
.
e
(
it
)
}
.
doOnError
{
Timber
.
e
(
it
)
}
.
onErrorReturn
(
::
parseError
)
.
onErrorReturn
(
::
parseError
)
.
subscribeOn
(
Schedulers
.
single
())
.
subscribeOn
(
Schedulers
.
single
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenPresenter.kt
View file @
00df4a29
...
@@ -40,6 +40,7 @@ class DealsScreenPresenter @Inject constructor(
...
@@ -40,6 +40,7 @@ class DealsScreenPresenter @Inject constructor(
val
state
=
restoreStateObservable
val
state
=
restoreStateObservable
.
mergeWith
(
fetchDeals
)
.
mergeWith
(
fetchDeals
)
.
doOnError
{
Timber
.
e
(
it
)}
.
doOnError
{
Timber
.
e
(
it
)}
.
onErrorReturn
(
::
parseError
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/util/Adapter.kt
View file @
00df4a29
...
@@ -69,7 +69,7 @@ class DealViewHolder(itemView: View) : CommonViewHolder<DealPreviewModel>(itemVi
...
@@ -69,7 +69,7 @@ class DealViewHolder(itemView: View) : CommonViewHolder<DealPreviewModel>(itemVi
@BindView
(
R
.
id
.
start_tour_image_view
)
lateinit
var
tourScreen
:
RoundedImageView
@BindView
(
R
.
id
.
start_tour_image_view
)
lateinit
var
tourScreen
:
RoundedImageView
@BindView
(
R
.
id
.
deal_read
)
lateinit
var
dealReadFlag
:
RoundedImage
View
@BindView
(
R
.
id
.
deal_read
)
lateinit
var
dealReadFlag
:
View
val
onStartFlatObs
:
Observable
<
Int
?>
get
()
=
startFlat
.
clicks
().
map
{
bindedModel
.
estateId
}
val
onStartFlatObs
:
Observable
<
Int
?>
get
()
=
startFlat
.
clicks
().
map
{
bindedModel
.
estateId
}
val
onStartTourObs
:
Observable
<
Int
?>
get
()
=
startTour
.
clicks
().
map
{
bindedModel
.
tourId
}
val
onStartTourObs
:
Observable
<
Int
?>
get
()
=
startTour
.
clicks
().
map
{
bindedModel
.
tourId
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/favorites/ScreenPresenter.kt
View file @
00df4a29
...
@@ -29,6 +29,7 @@ class FavoritesScreenPresenter @Inject constructor(
...
@@ -29,6 +29,7 @@ class FavoritesScreenPresenter @Inject constructor(
val
state
=
restoreStateObservable
val
state
=
restoreStateObservable
.
mergeWith
(
prefetchCards
)
.
mergeWith
(
prefetchCards
)
.
doOnError
{
Timber
.
e
(
it
)}
.
doOnError
{
Timber
.
e
(
it
)}
.
onErrorReturn
(
::
parseError
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feed_list/ScreenPresenter.kt
View file @
00df4a29
...
@@ -34,6 +34,7 @@ class ArticlesScreenPresenter @Inject constructor(
...
@@ -34,6 +34,7 @@ class ArticlesScreenPresenter @Inject constructor(
val
state
=
restoreStateObservable
val
state
=
restoreStateObservable
.
mergeWith
(
prefetchCards
)
.
mergeWith
(
prefetchCards
)
.
doOnError
{
Timber
.
e
(
it
)}
.
doOnError
{
Timber
.
e
(
it
)}
.
onErrorReturn
(
::
parseError
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feed_list/util/Adapter.kt
View file @
00df4a29
...
@@ -10,6 +10,7 @@ import com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyc
...
@@ -10,6 +10,7 @@ import com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyc
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import
com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import
com.biganto.visual.roompark.util.extensions.setGone
import
com.biganto.visual.roompark.util.extensions.setGone
import
com.bumptech.glide.Glide
import
com.bumptech.glide.Glide
import
timber.log.Timber
import
java.text.SimpleDateFormat
import
java.text.SimpleDateFormat
import
java.util.*
import
java.util.*
...
@@ -38,6 +39,7 @@ class ArticleViewHolder(itemView: View) : CommonViewHolder<ArticlePreviewModel>(
...
@@ -38,6 +39,7 @@ class ArticleViewHolder(itemView: View) : CommonViewHolder<ArticlePreviewModel>(
override
fun
onViewBound
(
model
:
ArticlePreviewModel
)
{
override
fun
onViewBound
(
model
:
ArticlePreviewModel
)
{
Timber
.
d
(
"readeed?: ${model.isRead} of ${model.title}"
)
articleDate
.
text
=
dateFormatter
.
format
(
model
.
published
)
articleDate
.
text
=
dateFormatter
.
format
(
model
.
published
)
articleTitle
.
text
=
model
.
title
articleTitle
.
text
=
model
.
title
articleIsRead
.
setGone
(
model
.
isRead
)
articleIsRead
.
setGone
(
model
.
isRead
)
...
...
app/src/main/res/layout/feed_direct_viewholder.xml
View file @
00df4a29
...
@@ -35,7 +35,8 @@
...
@@ -35,7 +35,8 @@
android:background=
"@drawable/new_feed_icon"
android:background=
"@drawable/new_feed_icon"
android:visibility=
"visible"
android:visibility=
"visible"
app:layout_constraintStart_toStartOf=
"@+id/guideline"
app:layout_constraintStart_toStartOf=
"@+id/guideline"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
tools:visibility=
"visible"
/>
<TextView
<TextView
android:id=
"@+id/feed_date_text_view"
android:id=
"@+id/feed_date_text_view"
...
...
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