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
12e9333a
Commit
12e9333a
authored
Nov 28, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
seems to work as expected
parent
726ddcfd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
13 deletions
+18
-13
FeedsRepository.kt
...nto/visual/roompark/data/data_provider/FeedsRepository.kt
+1
-1
AppComponent.kt
...ava/com/biganto/visual/roompark/di/dagger/AppComponent.kt
+5
-8
ScreenController.kt
...al/roompark/presentation/screen/feeds/ScreenController.kt
+1
-1
ScreenDI.kt
...nto/visual/roompark/presentation/screen/feeds/ScreenDI.kt
+11
-3
No files found.
app/src/main/java/com/biganto/visual/roompark/data/data_provider/FeedsRepository.kt
View file @
12e9333a
...
...
@@ -77,7 +77,7 @@ class FeedsContractModule @Inject constructor(
private
fun
fetchArticles
(
feedId
:
Int
,
pageSize
:
Int
=
10
,
startIndex
:
Int
=
0
):
Observable
<
ArticlesPreviewModel
>
=
Observable
.
mergeDelayError
(
arrayListOf
(
fetchArticlessApi
(
feedId
,
pageSize
,
startIndex
),
fetchArticlesDb
(
feedId
,
pageSize
,
startIndex
))
).
take
(
1
).
map
{
fromEntity
(
feedId
,
it
)
}
).
map
{
fromEntity
(
feedId
,
it
)
}
private
val
fetchFeedsApi
=
...
...
app/src/main/java/com/biganto/visual/roompark/di/dagger/AppComponent.kt
View file @
12e9333a
...
...
@@ -7,9 +7,6 @@ import com.biganto.visual.roompark.data.repository.api.IRoomParkApi
import
com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModule
import
com.biganto.visual.roompark.data.repository.db.IDb
import
com.biganto.visual.roompark.data.repository.db.requrey.DbModule
import
com.biganto.visual.roompark.domain.contract.AuthContract
import
com.biganto.visual.roompark.domain.contract.DevProgressContract
import
com.biganto.visual.roompark.domain.contract.FeedsContract
import
dagger.BindsInstance
import
dagger.Component
import
dagger.android.AndroidInjectionModule
...
...
@@ -38,16 +35,16 @@ import javax.inject.Singleton
AndroidSupportInjectionModule
::
class
,
// MappingProvider::class,
ActivityModule
::
class
,
ContractRepositoryModule
::
class
,
//
ContractRepositoryModule::class,
AppActivityModule
::
class
])
interface
AppComponent
:
AndroidInjector
<
RoomParkApplication
>{
fun
authC
():
AuthContract
fun
feedsC
():
FeedsContract
//
fun authC():AuthContract
//
//
fun feedsC():FeedsContract
fun
feedsAlb
():
DevProgressContract
//
fun feedsAlb(): DevProgressContract
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenController.kt
View file @
12e9333a
...
...
@@ -78,7 +78,7 @@ class FeedsScreenController :
.
map
{
feedsRecyclerView
.
layoutManager
as
LinearLayoutManager
}
.
map
{
it
.
findLastCompletelyVisibleItemPosition
()
}
.
doOnNext
{
Timber
.
d
(
"Visible items $it of ${(feedsRecyclerView.adapter?.itemCount?:0) - 3}"
)
}
.
filter
{
feedsRecyclerView
.
adapter
?.
itemCount
?:
0
>
0
}
.
filter
{
storedFeedsList
.
isNotEmpty
()
}
.
filter
{
it
>(
feedsRecyclerView
.
adapter
?.
itemCount
?:
0
)-
2
}
.
map
{
feedsRecyclerView
.
adapter
?.
itemCount
?:
0
}
.
map
{
Pair
(
storedFeedsList
[
feedsTabs
.
selectedTabPosition
],
it
)}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/feeds/ScreenDI.kt
View file @
12e9333a
...
...
@@ -2,10 +2,14 @@ package com.biganto.visual.roompark.presentation.screen.feeds
import
android.content.Context
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
com.biganto.visual.roompark.data.data_provider.AlbumsContractModule
import
com.biganto.visual.roompark.data.data_provider.FeedsContractModule
import
com.biganto.visual.roompark.data.service.user_session.IUserSession
import
com.biganto.visual.roompark.data.service.user_session.UserSessionService
import
com.biganto.visual.roompark.di.dagger.AppComponent
import
com.biganto.visual.roompark.di.dagger.PerScreen
import
com.biganto.visual.roompark.domain.contract.DevProgressContract
import
com.biganto.visual.roompark.domain.contract.FeedsContract
import
dagger.Binds
import
dagger.BindsInstance
import
dagger.Component
...
...
@@ -37,9 +41,13 @@ abstract class FeedsScreenModule{
@Binds
abstract
fun
provideContext
(
activity
:
RoomParkMainActivity
):
Context
// @PerScreen
// @Binds
// abstract fun provideContract(impl: FeedsContractModule): FeedsContract
@PerScreen
@Binds
abstract
fun
provideContract
(
impl
:
FeedsContractModule
):
FeedsContract
@PerScreen
@Binds
abstract
fun
provideDevContract
(
impl
:
AlbumsContractModule
):
DevProgressContract
@PerScreen
...
...
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