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
}
}
......@@ -13,259 +13,13 @@
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/flat_title"
style="@style/Header_TextView.Main_Header"
<include layout="@layout/flat_plan_type_selector_view"
android:id="@+id/flatTypesCustomView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:text="Кв..."
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/planTypesTabs"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/flat_title"
app:tabMaxWidth="@dimen/tab_max_width"
app:tabMode="scrollable" />
<include
android:id="@+id/include5"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/planTypesTabs" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/textView19"
style="@style/Common_Text.Default"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="Перепланировка"
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include5" />
<WebView
android:id="@+id/flat_plan_webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView19" />
<include
android:id="@+id/include6"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/flat_plan_webview" />
<LinearLayout
android:id="@+id/sizes_switch_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include6">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/sizes_switch_header"
style="@style/Default_TextView.Header_Text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:text="Размеры" />
<include
android:id="@+id/sizes_switcher"
layout="@layout/bell_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_weight="0" />
</LinearLayout>
<include
android:id="@+id/include7"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sizes_switch_container" />
<LinearLayout
android:id="@+id/furniture_switch_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include7">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/furniture_switch_header"
style="@style/Default_TextView.Header_Text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:text="Мебель" />
<include
android:id="@+id/furniture_switcher"
layout="@layout/bell_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_weight="0" />
</LinearLayout>
<include
android:id="@+id/include8"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/furniture_switch_container" />
<LinearLayout
android:id="@+id/electricity_switch_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include8">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/electricity_switch_header"
style="@style/Default_TextView.Header_Text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:text="Электрика" />
<include
android:id="@+id/electricity_switcher"
layout="@layout/bell_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_weight="0" />
</LinearLayout>
<include
android:id="@+id/walls_divider"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/electricity_switch_container" />
<LinearLayout
android:id="@+id/walls_switch_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/walls_divider">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/walls_switch_header"
style="@style/Default_TextView.Header_Text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:text="Стены" />
<include
android:id="@+id/walls_switcher"
layout="@layout/bell_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_weight="0" />
</LinearLayout>
<include
android:id="@+id/include9"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/walls_switch_container" />
/>
<include
android:id="@+id/switch_flat_content_tab"
......@@ -278,7 +32,7 @@
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include9" />
app:layout_constraintTop_toBottomOf="@+id/flatTypesCustomView" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/flat_content_recycler_view"
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/flat_title"
style="@style/Header_TextView.Main_Header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="16dp"
android:text="Кв..."
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/planTypesTabs"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/flat_title"
app:tabMaxWidth="@dimen/tab_max_width"
app:tabMode="scrollable" />
<include
android:id="@+id/include5"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:minHeight="200dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/planTypesTabs" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/textView19"
style="@style/Common_Text.Default"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="Перепланировка"
android:textAlignment="viewStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include5" />
<WebView
android:id="@+id/flat_plan_webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView19" />
<include
android:id="@+id/include6"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/flat_plan_webview" />
<LinearLayout
android:id="@+id/sizes_switch_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include6">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/sizes_switch_header"
style="@style/Default_TextView.Header_Text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:text="Размеры" />
<include
android:id="@+id/sizes_switcher"
layout="@layout/bell_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_weight="0" />
</LinearLayout>
<include
android:id="@+id/include7"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/sizes_switch_container" />
<LinearLayout
android:id="@+id/furniture_switch_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include7">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/furniture_switch_header"
style="@style/Default_TextView.Header_Text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:text="Мебель" />
<include
android:id="@+id/furniture_switcher"
layout="@layout/bell_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_weight="0" />
</LinearLayout>
<include
android:id="@+id/include8"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/furniture_switch_container" />
<LinearLayout
android:id="@+id/electricity_switch_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include8">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/electricity_switch_header"
style="@style/Default_TextView.Header_Text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:text="Электрика" />
<include
android:id="@+id/electricity_switcher"
layout="@layout/bell_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_weight="0" />
</LinearLayout>
<include
android:id="@+id/walls_divider"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/electricity_switch_container" />
<LinearLayout
android:id="@+id/walls_switch_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/walls_divider">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/walls_switch_header"
style="@style/Default_TextView.Header_Text"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start|center_vertical"
android:layout_weight="1"
android:text="Стены" />
<include
android:id="@+id/walls_switcher"
layout="@layout/bell_switch_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|center_vertical"
android:layout_weight="0" />
</LinearLayout>
<include
android:id="@+id/include9"
layout="@layout/horizontal_divider"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_marginTop="16dp"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/walls_switch_container" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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