Commit 64cd117d authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

workaround

parent 991bfac7
......@@ -6,6 +6,7 @@ import com.biganto.visual.roompark.data.repository.db.IDb
import com.biganto.visual.roompark.data.repository.file.FileModule
import com.biganto.visual.roompark.domain.contract.FilesContract
import com.biganto.visual.roompark.util.extensions.folderSize
import timber.log.Timber
import java.io.File
import javax.inject.Inject
import kotlin.reflect.full.primaryConstructor
......@@ -23,11 +24,22 @@ class FilesContractModule @Inject constructor(
): FilesContract {
private inline fun <reified T:FileModule.FileDirectory> getDirectory(): T? =
T::class.primaryConstructor?.call()
private inline fun <reified T:FileModule.FileDirectory> getDirectory(): T? {
val type = T::class
Timber.d("Type is :$type")
val inst = type.primaryConstructor?.call(null,null)
Timber.d("inst is :$inst")
//val inst2 = type.constructors.first().call()
//Timber.d("inst2 is :$inst2")
return inst
}
private inline fun <reified T:FileModule.FileDirectory> getFile(): File {
val d = getDirectory<T>()?:error("Unresolved class type")
Timber.d("type: ${T::class}")
val d = getDirectory<T>()
Timber.d("d: ${d}")
if (d==null) error("Unresolved class type")
return FileModule.getDirectory(context,d)
}
......
......@@ -9,10 +9,7 @@ import com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModul
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.file.FileModule
import com.biganto.visual.roompark.domain.contract.AuthContract
import com.biganto.visual.roompark.domain.contract.DealContract
import com.biganto.visual.roompark.domain.contract.DevProgressContract
import com.biganto.visual.roompark.domain.contract.FeedsContract
import com.biganto.visual.roompark.domain.contract.*
import com.squareup.picasso.Picasso
import dagger.BindsInstance
import dagger.Component
......@@ -56,6 +53,8 @@ interface AppComponent : AndroidInjector<RoomParkApplication>{
fun estateRep(): DealContract
fun filesRep(): FilesContract
fun provideLocal():ILocalStore
......
package com.biganto.visual.roompark.di.dagger
import com.biganto.visual.roompark.data.data_provider.AlbumsContractModule
import com.biganto.visual.roompark.data.data_provider.AuthContractModule
import com.biganto.visual.roompark.data.data_provider.EstateRepository
import com.biganto.visual.roompark.data.data_provider.FeedsContractModule
import com.biganto.visual.roompark.data.data_provider.*
import com.biganto.visual.roompark.data.local.LocalStorage
import com.biganto.visual.roompark.data.repository.api.IRoomParkApi
import com.biganto.visual.roompark.data.repository.api.retrofit.RetrofitRepository
......@@ -11,10 +8,7 @@ import com.biganto.visual.roompark.data.repository.api.retrofit.di.RetrofitModul
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.RequeryRepository
import com.biganto.visual.roompark.domain.contract.AuthContract
import com.biganto.visual.roompark.domain.contract.DealContract
import com.biganto.visual.roompark.domain.contract.DevProgressContract
import com.biganto.visual.roompark.domain.contract.FeedsContract
import com.biganto.visual.roompark.domain.contract.*
import dagger.Binds
import dagger.Component
import dagger.Module
......@@ -43,6 +37,10 @@ abstract class ContractRepositoryModule {
@Binds
@Singleton
abstract fun provideEstateContract(impl: EstateRepository): DealContract
@Binds
@Singleton
abstract fun provideFilesContract(impl: FilesContractModule): FilesContract
}
......
package com.biganto.visual.roompark.domain.interactor
import android.app.Activity
import android.content.Context
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.domain.model.CachedDataModel
import com.biganto.visual.roompark.domain.model.PushSwitchModel
......@@ -18,7 +18,7 @@ import javax.inject.Inject
class SettingsInteractor @Inject constructor(
private val auth: AuthUseCase,
private val settingsUseCase: SettingsUseCase,
private val activity: Activity
private val activity: Context
){
private val plans
......
package com.biganto.visual.roompark.presentation.screen.settings
import android.app.Activity
import android.content.Context
import com.biganto.visual.roompark.conductor.BigantoBasePresenter
import com.biganto.visual.roompark.domain.interactor.SettingsInteractor
import com.biganto.visual.roompark.util.monades.ExceptionString
......@@ -17,7 +17,7 @@ import javax.inject.Inject
class SettingsScreenPresenter @Inject constructor(
private val interactor: SettingsInteractor,
private val activity: Activity
private val activity: Context
)
: BigantoBasePresenter<SettingsScreen, SettingsScreenViewState>() {
......
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