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(
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 =
......
......@@ -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
......
......@@ -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)}
......
......@@ -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
......
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