Commit 12e9333a authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

seems to work as expected

parent 726ddcfd
...@@ -77,7 +77,7 @@ class FeedsContractModule @Inject constructor( ...@@ -77,7 +77,7 @@ class FeedsContractModule @Inject constructor(
private fun fetchArticles(feedId:Int,pageSize:Int = 10, startIndex:Int = 0): Observable<ArticlesPreviewModel> = private fun fetchArticles(feedId:Int,pageSize:Int = 10, startIndex:Int = 0): Observable<ArticlesPreviewModel> =
Observable.mergeDelayError( Observable.mergeDelayError(
arrayListOf(fetchArticlessApi(feedId,pageSize,startIndex),fetchArticlesDb(feedId,pageSize,startIndex)) arrayListOf(fetchArticlessApi(feedId,pageSize,startIndex),fetchArticlesDb(feedId,pageSize,startIndex))
).take(1).map { fromEntity(feedId,it) } ).map { fromEntity(feedId,it) }
private val fetchFeedsApi = private val fetchFeedsApi =
......
...@@ -7,9 +7,6 @@ import com.biganto.visual.roompark.data.repository.api.IRoomParkApi ...@@ -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.api.retrofit.di.RetrofitModule
import com.biganto.visual.roompark.data.repository.db.IDb import com.biganto.visual.roompark.data.repository.db.IDb
import com.biganto.visual.roompark.data.repository.db.requrey.DbModule 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.BindsInstance
import dagger.Component import dagger.Component
import dagger.android.AndroidInjectionModule import dagger.android.AndroidInjectionModule
...@@ -38,16 +35,16 @@ import javax.inject.Singleton ...@@ -38,16 +35,16 @@ import javax.inject.Singleton
AndroidSupportInjectionModule::class, AndroidSupportInjectionModule::class,
// MappingProvider::class, // MappingProvider::class,
ActivityModule::class, ActivityModule::class,
ContractRepositoryModule::class, // ContractRepositoryModule::class,
AppActivityModule ::class]) AppActivityModule ::class])
interface AppComponent : AndroidInjector<RoomParkApplication>{ interface AppComponent : AndroidInjector<RoomParkApplication>{
fun authC():AuthContract // fun authC():AuthContract
//
fun feedsC():FeedsContract // fun feedsC():FeedsContract
fun feedsAlb(): DevProgressContract // fun feedsAlb(): DevProgressContract
......
...@@ -78,7 +78,7 @@ class FeedsScreenController : ...@@ -78,7 +78,7 @@ class FeedsScreenController :
.map { feedsRecyclerView.layoutManager as LinearLayoutManager } .map { feedsRecyclerView.layoutManager as LinearLayoutManager }
.map { it.findLastCompletelyVisibleItemPosition() } .map { it.findLastCompletelyVisibleItemPosition() }
.doOnNext { Timber.d("Visible items $it of ${(feedsRecyclerView.adapter?.itemCount?:0) - 3}") } .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 } .filter { it>(feedsRecyclerView.adapter?.itemCount?:0)-2 }
.map { feedsRecyclerView.adapter?.itemCount?:0 } .map { feedsRecyclerView.adapter?.itemCount?:0 }
.map { Pair(storedFeedsList[feedsTabs.selectedTabPosition],it)} .map { Pair(storedFeedsList[feedsTabs.selectedTabPosition],it)}
......
...@@ -2,10 +2,14 @@ package com.biganto.visual.roompark.presentation.screen.feeds ...@@ -2,10 +2,14 @@ package com.biganto.visual.roompark.presentation.screen.feeds
import android.content.Context import android.content.Context
import com.biganto.visual.roompark.base.RoomParkMainActivity 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.IUserSession
import com.biganto.visual.roompark.data.service.user_session.UserSessionService 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.AppComponent
import com.biganto.visual.roompark.di.dagger.PerScreen 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.Binds
import dagger.BindsInstance import dagger.BindsInstance
import dagger.Component import dagger.Component
...@@ -37,9 +41,13 @@ abstract class FeedsScreenModule{ ...@@ -37,9 +41,13 @@ abstract class FeedsScreenModule{
@Binds @Binds
abstract fun provideContext(activity: RoomParkMainActivity): Context abstract fun provideContext(activity: RoomParkMainActivity): Context
// @PerScreen @PerScreen
// @Binds @Binds
// abstract fun provideContract(impl: FeedsContractModule): FeedsContract abstract fun provideContract(impl: FeedsContractModule): FeedsContract
@PerScreen
@Binds
abstract fun provideDevContract(impl: AlbumsContractModule): DevProgressContract
@PerScreen @PerScreen
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment