Commit d9a1127f authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

fix fatals

parent 95e93ea2
...@@ -8,30 +8,18 @@ import android.view.ViewGroup ...@@ -8,30 +8,18 @@ import android.view.ViewGroup
import android.widget.Button import android.widget.Button
import android.widget.ImageView import android.widget.ImageView
import androidx.annotation.LayoutRes import androidx.annotation.LayoutRes
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.biganto.visual.roompark.R import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.BaseRoomParkActivity
import com.biganto.visual.roompark.base.RoomParkApplication import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.dialogs.change_handler.DialogChangeHandler
import com.biganto.visual.roompark.data.repository.file.FileModule import com.biganto.visual.roompark.data.repository.file.FileModule
import com.biganto.visual.roompark.di.dagger.ActivityModule import com.biganto.visual.roompark.di.dagger.ActivityModule
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.interactor.SettingsInteractor import com.biganto.visual.roompark.domain.interactor.SettingsInteractor
import com.biganto.visual.roompark.domain.model.TourModel
import com.biganto.visual.roompark.domain.model.bytesToSize import com.biganto.visual.roompark.domain.model.bytesToSize
import com.biganto.visual.roompark.presentation.screen.settings.util.CommonRecyclerAdapter
import com.biganto.visual.roompark.presentation.screen.settings.util.CommonViewHolder
import com.biganto.visual.roompark.util.extensions.setGone
import com.biganto.visual.roompark.util.view_utils.snackbar.ISnackBarProvider import com.biganto.visual.roompark.util.view_utils.snackbar.ISnackBarProvider
import com.biganto.visual.roomparkvr.data.repository.db.requery.model.DownloadState
import com.bluelinelabs.conductor.Controller import com.bluelinelabs.conductor.Controller
import com.bluelinelabs.conductor.RouterTransaction
import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.google.android.material.textview.MaterialTextView import com.google.android.material.textview.MaterialTextView
import com.jakewharton.rxbinding3.view.clicks import com.jakewharton.rxbinding3.view.clicks
import dagger.Binds import dagger.Binds
...@@ -104,7 +92,7 @@ class StartToursDownloadingDialogController : Controller { ...@@ -104,7 +92,7 @@ class StartToursDownloadingDialogController : Controller {
view.findViewById<Button>(R.id.alert_dismiss_button) view.findViewById<Button>(R.id.alert_dismiss_button)
.setOnClickListener { handleBack() } .setOnClickListener { handleBack() }
view.findViewById<Button>(R.id.close_current_button) view.findViewById<ImageView>(R.id.close_current_button)
.setOnClickListener { handleBack() } .setOnClickListener { handleBack() }
detachDisposable.add( detachDisposable.add(
...@@ -143,14 +131,14 @@ class StartToursDownloadingDialogController : Controller { ...@@ -143,14 +131,14 @@ class StartToursDownloadingDialogController : Controller {
@Component( @Component(
modules = [StartToursDownloadingDialogScreenModule::class], modules = [StartToursDownloadingDialogScreenModule::class],
dependencies = [AppComponent::class]) dependencies = [AppComponent::class])
interface StartToursDownloadingDialogComponent { interface StartToursDownloadingDialogScreenComponent {
@Component.Factory @Component.Factory
interface Factory{ interface Factory{
fun create( fun create(
appComponent: AppComponent appComponent: AppComponent
,@BindsInstance activity: RoomParkMainActivity ,@BindsInstance activity: RoomParkMainActivity
): DownloaderScreenComponent ): StartToursDownloadingDialogScreenComponent
} }
fun inject(controller: StartToursDownloadingDialogController) fun inject(controller: StartToursDownloadingDialogController)
...@@ -159,7 +147,8 @@ interface StartToursDownloadingDialogComponent { ...@@ -159,7 +147,8 @@ interface StartToursDownloadingDialogComponent {
@Module @Module
abstract class StartToursDownloadingDialogScreenModule{ abstract class StartToursDownloadingDialogScreenModule{
@PerScreen @PerScreen
@Binds @Binds
abstract fun provideContext(activity: RoomParkMainActivity): Context abstract fun provideActivity(activity: RoomParkMainActivity): BaseRoomParkActivity
} }
...@@ -9,7 +9,7 @@ import io.reactivex.Observable ...@@ -9,7 +9,7 @@ import io.reactivex.Observable
*/ */
interface SettingsScreen : BigantoBaseContract<SettingsScreenViewState> { interface SettingsScreen : BigantoBaseContract<SettingsScreenViewState> {
fun downloadAllTours(): Observable<Int> // fun downloadAllTours(): Observable<Int>
fun signOut(): Observable<Int> fun signOut(): Observable<Int>
fun clearCache(): Observable<Int> fun clearCache(): Observable<Int>
fun refreshCacheInfo(): Observable<Int> fun refreshCacheInfo(): Observable<Int>
......
...@@ -55,9 +55,9 @@ class SettingsScreenController : ...@@ -55,9 +55,9 @@ class SettingsScreenController :
.map { Timber.d("Clicked clear cache button"); 1 } .map { Timber.d("Clicked clear cache button"); 1 }
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
override fun downloadAllTours(): Observable<Int> = // override fun downloadAllTours(): Observable<Int> =
toursDownloaderButton.clicks().filter { false } // toursDownloaderButton.clicks().filter { false }
.map { 1 }.observeOn(AndroidSchedulers.mainThread()) // .map { 1 }.observeOn(AndroidSchedulers.mainThread())
private val refreshEmitter = BehaviorRelay.create<Int>() private val refreshEmitter = BehaviorRelay.create<Int>()
......
...@@ -46,10 +46,10 @@ class SettingsScreenPresenter @Inject constructor( ...@@ -46,10 +46,10 @@ class SettingsScreenPresenter @Inject constructor(
.map { it* TYPICAL_PLAN_SIZE } .map { it* TYPICAL_PLAN_SIZE }
.map { SettingsScreenViewState.OnPlanTypesPrefetch(it) } .map { SettingsScreenViewState.OnPlanTypesPrefetch(it) }
val onDownloadTours = intent(SettingsScreen::downloadAllTours) // val onDownloadTours = intent(SettingsScreen::downloadAllTours)
.flatMap { interactor.startToursDownloading() // .flatMap { interactor.startToursDownloading()
.andThen(Observable.just(SettingsScreenViewState.Idle())) // .andThen(Observable.just(SettingsScreenViewState.Idle()))
} // }
val onSubChecked = intent(SettingsScreen::onSubscription) val onSubChecked = intent(SettingsScreen::onSubscription)
.flatMap { sub -> .flatMap { sub ->
...@@ -129,7 +129,7 @@ class SettingsScreenPresenter @Inject constructor( ...@@ -129,7 +129,7 @@ class SettingsScreenPresenter @Inject constructor(
fetchSubscriptions, fetchSubscriptions,
fetchCache, fetchCache,
onSubChecked, onSubChecked,
onDownloadTours, // onDownloadTours,
fetchToursSize fetchToursSize
) )
) )
......
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