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