Commit 4581a2fa authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

handle back buttons

parent e560e3bb
......@@ -99,6 +99,7 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
}
override fun handleBack(): Boolean {
router.popController(this)
return super.handleBack()
}
......
......@@ -18,6 +18,7 @@ import com.biganto.visual.roompark.util.extensions.toRubly
import com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressAnimationState
import com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil
import com.google.android.material.textview.MaterialTextView
import com.jakewharton.rxbinding3.view.clicks
import com.jakewharton.rxbinding3.view.scrollChangeEvents
import io.reactivex.android.schedulers.AndroidSchedulers
import timber.log.Timber
......@@ -84,6 +85,8 @@ class DealScreenController :
activity?.actionBar?.setDisplayShowTitleEnabled(false)
Timber.d(" bakc: ${toolBar.headerToolbarBack}")
toolBar.setToolbar(HeaderToolbarModel(
true
,resources?.getString(R.string.deal_back_chevron_title)
......@@ -91,6 +94,15 @@ class DealScreenController :
,null)
)
toolBar.headerToolbarBack?.let {
detachDisposable.add(
it.clicks()
.doOnNext { Timber.d("clicked: 1") }
.subscribeOn(AndroidSchedulers.mainThread())
.subscribe { handleBack() }
)
}
detachDisposable.add(
dealContainer.scrollChangeEvents()
.subscribeOn(AndroidSchedulers.mainThread())
......
......@@ -171,22 +171,21 @@ class EstateScreenController :
null, StatusToolbarModel()
)
toolBar.statusToolbar.findViewById<View>(R.id.back_cross).let {
detachDisposable.add(
it.clicks()
.subscribeOn(AndroidSchedulers.mainThread())
.subscribe { handleBack() }
)
}
detachDisposable.add(
flatScroll.scrollChangeEvents()
// .debounce (25,TimeUnit.MILLISECONDS)
.doOnNext {
Timber.d("Scrolling.. ${it.scrollY}")
Timber.d("Scrolling.. ${flatTitle.isShown}")
}
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(AndroidSchedulers.mainThread())
.subscribe {
Timber.d("clicked slf;jzalk")
activity?.runOnUiThread {
if (it.scrollY > flatTitle.measuredHeight) {
val status = estateModel?.to(
StatusToolbarModel(
StatusState.AVAILABLE
......@@ -206,12 +205,8 @@ class EstateScreenController :
StatusState.AVAILABLE, null, null
)
)
}
}
)
// planTypesTabLayout.
}
private fun bindRecycler() {
......
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