Commit 756f4c7b authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

adjust toolbar pipeline

parent 1e9e9d41
......@@ -44,12 +44,22 @@ class DealsScreenController :
)
}
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,true)
toolBar.collapsingToolbarLayout.title = "МОИ СДЕЛКИ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
favoritesRecyclerView.isNestedScrollingEnabled = false
}
@Inject
override lateinit var injectedPresenter: DealsScreenPresenter
override fun onViewBound(v: View) {
// setToolbar()
bindRecycler()
}
......
......@@ -33,6 +33,17 @@ class FavoritesScreenController :
@BindView(R.id.favorites_cards_recycler_view)
lateinit var favoritesRecyclerView: RecyclerView
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,false)
toolBar.collapsingToolbarLayout.title = "ИЗБРАННОЕ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
favoritesRecyclerView.isNestedScrollingEnabled = false
}
private fun bindRecycler() {
favoritesRecyclerView.isNestedScrollingEnabled = true
favoritesRecyclerView.layoutManager =
......@@ -49,6 +60,7 @@ class FavoritesScreenController :
}
override fun onViewBound(v: View) {
// setToolbar()
bindRecycler()
}
......
......@@ -6,12 +6,15 @@ import android.util.SparseArray
import android.view.Menu
import android.view.View
import android.view.ViewGroup
import android.widget.Toolbar
import androidx.annotation.NonNull
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.contains
import androidx.core.view.forEach
import androidx.core.view.get
import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager.widget.ViewPager
import com.biganto.visual.roompark.base.ICollapsingToolBar
import com.biganto.visual.roompark.base.IConductorActivity
import com.bluelinelabs.conductor.Controller
import com.bluelinelabs.conductor.Router
import com.bluelinelabs.conductor.RouterTransaction
......@@ -108,6 +111,7 @@ class BNVRouterPagerAdapter(
visibleRouters.remove(position)
}
override fun setPrimaryItem(container: ViewGroup, position: Int, router: Any) {
require(router is Router) { "Non-router object in router stack!" }
......@@ -116,8 +120,54 @@ class BNVRouterPagerAdapter(
router.backstack.forEach { it.controller().setOptionsMenuHidden(false) }
currentPrimaryRouter = router
}
drawToolbar(position)
}
fun drawToolbar(position: Int){
val toolBar = currentPrimaryRouter?.activity as ICollapsingToolBar
toolBar.showAll()
toolBar.appBar.setExpanded(false,true)
toolBar.appBar.setLiftable(true)
toolBar.appBar.setLifted(true)
toolBar.appBarScrollable(false)
toolBar.collapsingToolbarLayout.title = when(position){
0 -> "dsfsdf"
1 -> "ИЗБРАННОЕ"
2 -> "МОИ СДЕЛКИ"
3 -> "СМОТРЕТЬ\nКВАРТИРУ"
4 -> "НАСТРОЙКИ"
else -> ""
}
toolBar.appBar.visibility=View.VISIBLE
val cc = (currentPrimaryRouter?.activity as IConductorActivity)
Timber.d(" posicione $position")
when(position){
0 -> {
Timber.d(" IN POSOIITION 0 ")
toolBar.appBar.visibility = Toolbar.GONE;
toolBar.topAppBar.visibility = View.GONE;
val params: CoordinatorLayout.LayoutParams = cc.conductorContainer.layoutParams as CoordinatorLayout.LayoutParams
params.behavior = null
toolBar.collapsingToolbarLayout.visibility = View.GONE
}
1 ->{}
2 ->{}
3 -> {
toolBar.appBar.setLifted(false)
toolBar.appBar.setLiftable(false)
}
4 ->{}
else -> {}
}
}
override fun isViewFromObject(view: View, router: Any): Boolean {
require(router is Router) { "Non-router object in router stack!" }
......
package com.biganto.visual.roompark.presentation.screen.home
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.viewpager.widget.ViewPager
import butterknife.BindView
import com.biganto.visual.roompark.R
......@@ -16,6 +14,7 @@ import com.biganto.visual.roompark.presentation.screen.favorites.FavoritesScreen
import com.biganto.visual.roompark.presentation.screen.feeds.FeedsScreenController
import com.biganto.visual.roompark.presentation.screen.settings.SettingsScreenController
import com.biganto.visual.roompark.presentation.screen.to_flat.FindFlatScreenController
import com.google.android.material.bottomnavigation.BottomNavigationView
import javax.inject.Inject
/**
......@@ -29,7 +28,8 @@ class HomeController :
, HomeScreen {
override fun onViewBound(v: View) {
tb.showAll()
bottomNavigation.bottomNavigation.visibility = BottomNavigationView.VISIBLE
viewpager.offscreenPageLimit = 0
pageAdapter = BNVRouterPagerAdapter(this,bottomNavigation.bottomNavigation,viewpager,
mapOf(
Pair(R.id.tab_feeds,{FeedsScreenController()})
......@@ -45,6 +45,7 @@ class HomeController :
getComponent()
}
@BindView(R.id.home_router_host)
lateinit var viewpager: ViewPager
......
......@@ -3,6 +3,7 @@ package com.biganto.visual.roompark.presentation.screen.settings
import android.annotation.SuppressLint
import android.view.View
import android.widget.ImageView
import androidx.core.widget.NestedScrollView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
......@@ -34,6 +35,10 @@ class SettingsScreenController :
@Inject
override lateinit var injectedPresenter: SettingsScreenPresenter
@BindView(R.id.nestedScrollContainer)
lateinit var scrollContainer:NestedScrollView
@BindView(R.id.pushRecyclerView)
lateinit var pushRecycler:RecyclerView
......@@ -53,9 +58,20 @@ class SettingsScreenController :
lateinit var flatDownloaderButton:ImageView
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,true)
toolBar.collapsingToolbarLayout.title = "НАСТРОЙКИ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.nestedScrollContainer
toolBar.appBar.setLiftable(true)
toolBar.appBar.setLifted(true)
toolBar.appBarScrollable(false)
pushRecycler.isNestedScrollingEnabled = false
cachedRecycler.isNestedScrollingEnabled = false
}
override fun onViewBound(v: View) {
// setToolbar()
pushRecycler.isNestedScrollingEnabled = true
pushRecycler.layoutManager =
LinearLayoutManager(activity, RecyclerView.VERTICAL, false)
......@@ -67,6 +83,8 @@ class SettingsScreenController :
LinearLayoutManager(activity, RecyclerView.VERTICAL, false)
cachedRecycler.adapter = CahcedListAdapter()
cachedRecycler.itemAnimator = null
}
override fun render(viewState: SettingsScreenViewState) {
......
......@@ -46,6 +46,17 @@ class FindFlatScreenController :
getComponent()
}
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,true)
toolBar.collapsingToolbarLayout.title = "СМОТРЕТЬ\nКВАРТИРУ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBar.setLifted(true)
toolBar.appBarScrollable(false)
}
@BindView(R.id.flat_estate_tabs)
lateinit var flatTabs: TabLayout
......@@ -68,6 +79,7 @@ class FindFlatScreenController :
)
override fun onViewBound(v: View) {
// setToolbar()
estateTabs.forEach {estate ->
val tab = flatTabs.newTab()
.setCustomView(R.layout.to_flat_tab_view)
......
......@@ -23,8 +23,8 @@
android:background="@color/colorCommonBackground"
android:clipToPadding="true"
android:theme="@style/ThemeOverlay.AppCompat.Light"
app:elevation="0dp"
app:expanded="false"
app:liftOnScroll="true"
app:layout_behavior=".util.view_utils.app_bar.DragControlAppBarLayoutBehaviour"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -41,14 +41,13 @@
app:expandedTitleMargin="16dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<androidx.appcompat.widget.Toolbar
android:id="@+id/top_toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:visibility="invisible"
app:layout_collapseMode="pin"
app:titleTextAppearance="@style/Header_TextView.Main_Header"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:showAsAction="always"
tools:visibility="invisible">
......
......@@ -6,5 +6,6 @@
<androidx.viewpager.widget.ViewPager
android:id="@+id/home_router_host"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView
android:id="@+id/nestedScrollContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
......
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