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