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

fix fatals

parent 95e93ea2
......@@ -8,30 +8,18 @@ import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
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.base.BaseRoomParkActivity
import com.biganto.visual.roompark.base.RoomParkApplication
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.di.dagger.ActivityModule
import com.biganto.visual.roompark.di.dagger.AppComponent
import com.biganto.visual.roompark.di.dagger.PerScreen
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.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.roomparkvr.data.repository.db.requery.model.DownloadState
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.jakewharton.rxbinding3.view.clicks
import dagger.Binds
......@@ -104,7 +92,7 @@ class StartToursDownloadingDialogController : Controller {
view.findViewById<Button>(R.id.alert_dismiss_button)
.setOnClickListener { handleBack() }
view.findViewById<Button>(R.id.close_current_button)
view.findViewById<ImageView>(R.id.close_current_button)
.setOnClickListener { handleBack() }
detachDisposable.add(
......@@ -143,14 +131,14 @@ class StartToursDownloadingDialogController : Controller {
@Component(
modules = [StartToursDownloadingDialogScreenModule::class],
dependencies = [AppComponent::class])
interface StartToursDownloadingDialogComponent {
interface StartToursDownloadingDialogScreenComponent {
@Component.Factory
interface Factory{
fun create(
appComponent: AppComponent
,@BindsInstance activity: RoomParkMainActivity
): DownloaderScreenComponent
): StartToursDownloadingDialogScreenComponent
}
fun inject(controller: StartToursDownloadingDialogController)
......@@ -159,7 +147,8 @@ interface StartToursDownloadingDialogComponent {
@Module
abstract class StartToursDownloadingDialogScreenModule{
@PerScreen
@Binds
abstract fun provideContext(activity: RoomParkMainActivity): Context
abstract fun provideActivity(activity: RoomParkMainActivity): BaseRoomParkActivity
}
......@@ -9,7 +9,7 @@ import io.reactivex.Observable
*/
interface SettingsScreen : BigantoBaseContract<SettingsScreenViewState> {
fun downloadAllTours(): Observable<Int>
// fun downloadAllTours(): Observable<Int>
fun signOut(): Observable<Int>
fun clearCache(): Observable<Int>
fun refreshCacheInfo(): Observable<Int>
......
......@@ -55,9 +55,9 @@ class SettingsScreenController :
.map { Timber.d("Clicked clear cache button"); 1 }
.observeOn(AndroidSchedulers.mainThread())
override fun downloadAllTours(): Observable<Int> =
toursDownloaderButton.clicks().filter { false }
.map { 1 }.observeOn(AndroidSchedulers.mainThread())
// override fun downloadAllTours(): Observable<Int> =
// toursDownloaderButton.clicks().filter { false }
// .map { 1 }.observeOn(AndroidSchedulers.mainThread())
private val refreshEmitter = BehaviorRelay.create<Int>()
......
......@@ -46,10 +46,10 @@ class SettingsScreenPresenter @Inject constructor(
.map { it* TYPICAL_PLAN_SIZE }
.map { SettingsScreenViewState.OnPlanTypesPrefetch(it) }
val onDownloadTours = intent(SettingsScreen::downloadAllTours)
.flatMap { interactor.startToursDownloading()
.andThen(Observable.just(SettingsScreenViewState.Idle()))
}
// val onDownloadTours = intent(SettingsScreen::downloadAllTours)
// .flatMap { interactor.startToursDownloading()
// .andThen(Observable.just(SettingsScreenViewState.Idle()))
// }
val onSubChecked = intent(SettingsScreen::onSubscription)
.flatMap { sub ->
......@@ -129,7 +129,7 @@ class SettingsScreenPresenter @Inject constructor(
fetchSubscriptions,
fetchCache,
onSubChecked,
onDownloadTours,
// onDownloadTours,
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