Commit 1b5cd5fc authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

move flat type layout into separate view

parent 62322aa7
......@@ -18,10 +18,7 @@ import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.base.StatusState
import com.biganto.visual.roompark.base.StatusToolbarModel
import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.domain.model.EstateModel
import com.biganto.visual.roompark.domain.model.FeatureModel
import com.biganto.visual.roompark.domain.model.PlanPresetModel
import com.biganto.visual.roompark.domain.model.typeShortString
import com.biganto.visual.roompark.domain.model.*
import com.biganto.visual.roompark.presentation.screen.estate.util.FlatInfoAdapter
import com.biganto.visual.roompark.util.extensions.setGone
import com.biganto.visual.roompark.util.extensions.startUrl
......@@ -111,6 +108,9 @@ class EstateScreenController :
@Inject
override lateinit var injectedPresenter: EstateScreenPresenter
@BindView(R.id.flatTypesCustomView)
lateinit var flatTypeView: ViewGroup
@BindView(R.id.planTypesTabs)
lateinit var planTypesTabLayout: TabLayout
......@@ -260,6 +260,21 @@ class EstateScreenController :
}
startTour.setGone(viewState.estate.multitourId == null)
when(viewState.estate.type){
FlatType.FLAT -> {
flatTypeView.setGone(false)
planTypesTabLayout.setGone(false)
planWebView.setGone(false)
explicationTab.setGone(false)
}
else -> {
flatTypeView.setGone(true)
planTypesTabLayout.setGone(true)
planWebView.setGone(true)
explicationTab.setGone(true)
}
}
}
private fun render(viewState: EstateScreenViewState.ShowEstateInfo) {
......
......@@ -60,15 +60,12 @@ class HomeBottomNavigationController(@IdRes toPage: Int = R.id.tab_feeds)
}
private fun render(viewState: HomeScreenViewState.Idle) {
}
private fun render(viewState: HomeScreenViewState.SomeError) =
showError(viewState.exception)
private fun render(viewState: HomeScreenViewState.ToScreen) {
// snacky.showSnackBar("lul")
}
......@@ -79,12 +76,12 @@ class HomeBottomNavigationController(@IdRes toPage: Int = R.id.tab_feeds)
get() = "BottomNavigationImpl"
override fun onViewBound(@NonNull view: View) {
super.onViewBound(view)
override fun onViewBound(@NonNull v: View) {
super.onViewBound(v)
toolBar.setToolbar()
bottomNavigationController.show()
Timber.d(" onViewBound: ${this::class}")
controllerContainer = view.findViewById(R.id.tabContainer)
controllerContainer = v.findViewById(R.id.tabContainer)
bottomNavigationController.bottomNavigation.setOnNavigationItemSelectedListener { item ->
navigateTo(getControllerFor(item.itemId), false)
true
......@@ -123,29 +120,17 @@ class HomeBottomNavigationController(@IdRes toPage: Int = R.id.tab_feeds)
* The childRouter should handleBack,
* as this BottomNavigationController doesn't have a back step sensible to the user.
*/
Timber.d("in back stack ")
val childRouter = getChildRouter(currentlySelectedItemId)
Timber.d("in back stack # ${childRouter?.backstackSize}")
if (childRouter != null) {
Timber.d("in back stack -1")
if (childRouter.backstackSize<2) return false
Timber.d("in back stack -2 ${childRouter.backstack}")
val handleBackResult = childRouter.handleBack()
// if ()
// navigateTo(getControllerFor(R.id.tab_feeds), false)
Timber.d("in back stack __# ${getChildRouter(currentlySelectedItemId)?.backstackSize}")
Timber.d("in back stack -3 $handleBackResult")
Timber.d("backstack result $handleBackResult")
return true
} else {
Timber.e(
IllegalStateException(
......@@ -156,5 +141,4 @@ class HomeBottomNavigationController(@IdRes toPage: Int = R.id.tab_feeds)
}
return false
}
}
This diff is collapsed.
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