Commit 2bf2aafc authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

update toolbar and bottom bar hide/disappear throush all screens

parent 0af0d011
......@@ -99,7 +99,6 @@ class RoomParkMainActivity(
} else appBar.setGone(false)
showAll()
appBarScrollable(false)
Timber.d("NOTGONE")
headerToolbar.setGone(header==null)
statusToolbar.setGone(status==null)
header?.let {
......
......@@ -11,6 +11,7 @@ import androidx.annotation.LayoutRes
import androidx.annotation.StringRes
import butterknife.ButterKnife
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.IBottomNavigation
import com.biganto.visual.roompark.base.ICollapsingToolBar
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.mosby.mvi.BigantoMviController
......@@ -46,6 +47,7 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
protected abstract fun getLayoutId(): Int
lateinit var toolBar: ICollapsingToolBar
lateinit var bottomNavigation: IBottomNavigation
lateinit var snackbar: ISnackBarProvider
override fun onAttach(view: View) {
......@@ -74,9 +76,9 @@ abstract class BigantoBaseController<VS : BigantoBaseViewState,V: BigantoBaseCon
// instantiate the view
ButterKnife.bind(this, view)
(activity as RoomParkMainActivity).let{
snackbar = ActivityModule.provideSnackBar(it)
toolBar = it
bottomNavigation = it
snackbar.bindRootView(toolBar.coordinatorLayout)
}
onViewBound(view)
......
......@@ -11,7 +11,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import butterknife.BindView
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.IBottomNavigation
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
......@@ -132,8 +131,6 @@ class AlbumsScreenController :
// @Inject
// lateinit var ac: RoomParkMainActivity
@Inject
lateinit var bottomNavigation: IBottomNavigation
override fun render(viewState: AlbumsScreenViewState) {
when(viewState){
......
......@@ -12,7 +12,6 @@ import androidx.core.text.HtmlCompat
import butterknife.BindView
import butterknife.OnClick
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.HeaderToolbarModel
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
......@@ -88,6 +87,7 @@ class ArticleScreenController :
override fun onViewBound(v: View) {
toolBar.setToolbar()
bottomNavigation.hide()
bindRecycler()
}
......
......@@ -3,7 +3,6 @@ package com.biganto.visual.roompark.presentation.screen.auth
import android.view.View
import butterknife.BindView
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.IBottomNavigation
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
......@@ -75,9 +74,6 @@ class AuthScreenController :
)
}
@Inject
lateinit var bottomNavigation: IBottomNavigation
@Inject
override lateinit var injectedPresenter: AuthScreenPresenter
......
......@@ -75,18 +75,6 @@ class DealScreenController :
@BindView(R.id.deal_to_pay_value_text_view) lateinit var dealSumToPay: MaterialTextView
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,false)
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
Timber.d("content insets : ${toolBar.topAppBar.contentInsetEnd}")
activity?.actionBar?.setDisplayShowTitleEnabled(false)
Timber.d(" bakc: ${toolBar.headerToolbarBack}")
toolBar.setToolbar(HeaderToolbarModel(
true
,resources?.getString(R.string.deal_back_chevron_title)
......@@ -103,6 +91,7 @@ class DealScreenController :
)
}
detachDisposable.add(
dealContainer.scrollChangeEvents()
.subscribeOn(AndroidSchedulers.mainThread())
......@@ -141,6 +130,7 @@ class DealScreenController :
}
override fun onViewBound(v: View) {
bottomNavigation.hide()
setToolbar()
bindRecycler()
}
......
......@@ -50,12 +50,6 @@ class DealsScreenController :
}
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,false)
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
dealsRecyclerView.isNestedScrollingEnabled = false
toolBar.setToolbar(
......@@ -71,6 +65,7 @@ class DealsScreenController :
override fun onViewBound(v: View) {
bottomNavigation.show()
setToolbar()
bindRecycler()
detachDisposable.addAll(
......
......@@ -161,17 +161,7 @@ class EstateScreenController :
private fun setToolbar(){
toolBar.showAll()
// toolBar.appBar.setExpanded(false,false)
toolBar.topAppBar.title = "ИЗБРАННОЕ"
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
toolBar.setToolbar(
null, StatusToolbarModel()
)
toolBar.setToolbar(null, StatusToolbarModel())
toolBar.statusToolbar.findViewById<View>(R.id.back_cross).let {
detachDisposable.add(
it.clicks()
......@@ -179,7 +169,6 @@ class EstateScreenController :
.subscribe { handleBack() }
)
}
detachDisposable.add(
flatScroll.scrollChangeEvents()
// .debounce (25,TimeUnit.MILLISECONDS)
......@@ -219,6 +208,7 @@ class EstateScreenController :
}
override fun onViewBound(v: View) {
bottomNavigation.hide()
setToolbar()
bindRecycler()
}
......
......@@ -40,11 +40,6 @@ class FavoritesScreenController :
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,false)
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBarScrollable(false)
favoritesRecyclerView.isNestedScrollingEnabled = false
toolBar.setToolbar(
......@@ -70,6 +65,7 @@ class FavoritesScreenController :
}
override fun onViewBound(v: View) {
bottomNavigation.show()
setToolbar()
bindRecycler()
detachDisposable.addAll(
......
......@@ -46,7 +46,7 @@ class ArticlesScreenController :
private fun setToolbar() {
// articlesRecyclerView.isNestedScrollingEnabled = false
articlesRecyclerView.isNestedScrollingEnabled = false
toolBar.setToolbar(
HeaderToolbarModel(
......@@ -71,17 +71,22 @@ class ArticlesScreenController :
if (articlesRecyclerView.itemDecorationCount == 0)
articlesRecyclerView.addItemDecoration(
CeilsDecoration(1
, resources?.getDimensionPixelSize(R.dimen.ceil_grid_padding))
CeilsDecoration(
1
, resources?.getDimensionPixelSize(R.dimen.ceil_grid_padding)
)
)
(articlesRecyclerView.adapter as ArticlesAdapter)
.onItemClicked.subscribe {
router.pushController(RouterTransaction.with(ArticleScreenController(it.articleId)))
}
detachDisposable.add(
(articlesRecyclerView.adapter as ArticlesAdapter)
.onItemClicked.subscribe {
router.pushController(RouterTransaction.with(ArticleScreenController(it.articleId)))
}
)
}
override fun onViewBound(v: View) {
bottomNavigation.hide()
setToolbar()
bindRecycler()
}
......
......@@ -139,8 +139,7 @@ class FeedsScreenController :
.map { storedFeedsList[it.position] }
override fun onViewBound(v: View) {
// toolBar.hideAll()
bottomNavigation.show()
toolBar.setToolbar()
bindRecycler()
......
package com.biganto.visual.roompark.presentation.screen.home
import android.content.ContentValues.TAG
import android.util.Log
import android.view.View
import androidx.viewpager.widget.ViewPager
import butterknife.BindView
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.IBottomNavigation
import com.biganto.visual.roompark.base.ICollapsingToolBar
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
......@@ -50,37 +46,19 @@ class HomeController :
getComponent()
}
@BindView(R.id.home_router_host)
lateinit var viewpager: ViewPager
@Inject
lateinit var tb: ICollapsingToolBar
@Inject
lateinit var bottomNavigation: IBottomNavigation
@Inject
override lateinit var injectedPresenter: HomeScreenPresenter
lateinit var pageAdapter : BNVRouterPagerAdapter
// @Inject
// lateinit var snacky:ISnackBarProvider
private lateinit var pageAdapter : BNVRouterPagerAdapter
fun getComponent() = DaggerHomeScreenComponent
.factory()
.create(RoomParkApplication.component,activity as RoomParkMainActivity)
.inject(this)
// @Inject
// lateinit var ac: RoomParkMainActivity
override fun render(viewState: HomeScreenViewState) {
when(viewState){
is HomeScreenViewState.Idle -> render(viewState)
......@@ -89,13 +67,9 @@ class HomeController :
}
private fun render(viewState: HomeScreenViewState.Idle){
}
private fun render(viewState: HomeScreenViewState.ToScreen){
// snacky.showSnackBar("lul")
}
......@@ -112,14 +86,12 @@ class HomeController :
if (backStackResult
&& backStackSizeCondition
)
return backStackResult
} else {
Log.e(TAG, "handleBack called with getChildRouter(currentlySelectedItemId) == null.",
IllegalStateException(
"handleBack called with getChildRouter(currentlySelectedItemId) == null."))
Timber.e(IllegalStateException(
"handleBack called with getChildRouter(currentlySelectedItemId) == null.")
,"handleBack called with getChildRouter(currentlySelectedItemId) == null.")
}
return false
}
......
......@@ -3,7 +3,9 @@ package com.biganto.visual.roompark.presentation.screen.home.home_routing
import android.os.Bundle
import android.util.Log
import android.util.SparseArray
import android.view.*
import android.view.Menu
import android.view.MenuItem
import android.view.View
import androidx.annotation.IdRes
import androidx.annotation.NonNull
import com.biganto.visual.roompark.conductor.BigantoBaseController
......@@ -65,17 +67,8 @@ abstract class BottomNavigationController :
constructor(args: Bundle) : super(args)
@NonNull
protected fun inflateView(@NonNull inflater: LayoutInflater, @NonNull container: ViewGroup): View {
return inflater.inflate(getLayoutId(), container, false)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View {
val view = inflateView(inflater,container)
override fun onViewBound(v: View) {
retainViewMode=RetainViewMode.RELEASE_DETACH
Timber.d(" onCreateView: ${this::class}")
onViewBound(view)
return view
}
@IdRes
......
......@@ -48,9 +48,6 @@ class HomeBottomNavigationController(@IdRes toPage: Int = R.id.tab_feeds)
@Inject
lateinit var tb: ICollapsingToolBar
@Inject
lateinit var bottomNavigation: IBottomNavigation
@Inject
override lateinit var injectedPresenter: HomeScreenPresenter
......
......@@ -6,7 +6,6 @@ import androidx.core.os.bundleOf
import androidx.viewpager2.widget.ViewPager2
import butterknife.BindView
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.IBottomNavigation
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
......@@ -72,12 +71,6 @@ class PhotoScreenController :
,args.getInt(SELECTED_PHOTO_KEY))
.inject(this)
// @Inject
// lateinit var ac: RoomParkMainActivity
@Inject
lateinit var bottomNavigation: IBottomNavigation
override fun render(viewState: PhotoScreenViewState) {
Timber.d("render: $viewState")
when(viewState){
......
......@@ -74,12 +74,7 @@ class SettingsScreenController :
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,true)
toolBar.appBar.liftOnScrollTargetViewId = R.id.nestedScrollContainer
toolBar.appBar.setLiftable(true)
toolBar.appBar.setLifted(true)
toolBar.appBarScrollable(false)
pushRecycler.isNestedScrollingEnabled = false
cachedRecycler.isNestedScrollingEnabled = false
......@@ -90,8 +85,7 @@ class SettingsScreenController :
)
}
override fun onViewBound(v: View) {
setToolbar()
private fun bindRecycler(){
pushRecycler.isNestedScrollingEnabled = true
pushRecycler.layoutManager =
LinearLayoutManager(activity, RecyclerView.VERTICAL, false)
......@@ -103,8 +97,12 @@ class SettingsScreenController :
LinearLayoutManager(activity, RecyclerView.VERTICAL, false)
cachedRecycler.adapter = CahcedListAdapter()
cachedRecycler.itemAnimator = null
}
override fun onViewBound(v: View) {
bottomNavigation.show()
setToolbar()
bindRecycler()
}
override fun render(viewState: SettingsScreenViewState) {
......
......@@ -2,7 +2,6 @@ package com.biganto.visual.roompark.presentation.screen.splash
import android.view.View
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.IBottomNavigation
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
......@@ -24,7 +23,7 @@ class SplashScreenController :
override fun onViewBound(v: View) {
// toolBar.setToolbar()
toolBar.setToolbar()
bottomNavigation.hide()
}
......@@ -46,12 +45,6 @@ class SplashScreenController :
.create(RoomParkApplication.component,activity as RoomParkMainActivity)
.inject(this)
// @Inject
// lateinit var ac: RoomParkMainActivity
@Inject
lateinit var bottomNavigation: IBottomNavigation
override fun render(viewState: SplashScreenViewState) {
when(viewState){
is SplashScreenViewState.Idle -> render(viewState)
......
......@@ -61,13 +61,6 @@ class FindFlatScreenController :
}
private fun setToolbar(){
toolBar.showAll()
toolBar.appBar.setExpanded(false,true)
toolBar.appBar.liftOnScrollTargetViewId = R.id.favorites_cards_recycler_view
toolBar.appBar.setLiftable(true)
toolBar.appBar.setLifted(true)
toolBar.appBarScrollable(false)
toolBar.setToolbar(
HeaderToolbarModel(
false,null
......@@ -98,6 +91,7 @@ class FindFlatScreenController :
)
override fun onViewBound(v: View) {
bottomNavigation.show()
setToolbar()
estateTabs.forEach {estate ->
val tab = flatTabs.newTab()
......
......@@ -6,7 +6,6 @@ import android.view.View
import androidx.core.os.bundleOf
import butterknife.BindView
import com.biganto.visual.roompark.R
import com.biganto.visual.roompark.base.IBottomNavigation
import com.biganto.visual.roompark.base.RoomParkApplication
import com.biganto.visual.roompark.base.RoomParkMainActivity
import com.biganto.visual.roompark.conductor.BigantoBaseController
......@@ -51,7 +50,7 @@ class WebCamScreenController :
override fun onViewBound(v: View) {
toolBar.hideAll()
toolBar.setToolbar()
bottomNavigation.hide()
}
......@@ -62,12 +61,6 @@ class WebCamScreenController :
@Inject
override lateinit var injectedPresenter: WebCamScreenPresenter
// @Inject
// lateinit var snacky:ISnackBarProvider
lateinit var rpActivity: RoomParkMainActivity
fun getComponent() = DaggerWebCamScreenComponent
.factory()
.create(RoomParkApplication.component
......@@ -75,12 +68,6 @@ class WebCamScreenController :
,args.getInt(SELECTED_CAM_INDEX_KEY))
.inject(this)
// @Inject
// lateinit var ac: RoomParkMainActivity
@Inject
lateinit var bottomNavigation: IBottomNavigation
override fun render(viewState: WebCamScreenViewState) {
when(viewState){
is WebCamScreenViewState.Idle -> render(viewState)
......
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