Commit e119bfde authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

fix toolbar dissappear after logout

parent 3821836f
...@@ -90,7 +90,16 @@ class RoomParkMainActivity( ...@@ -90,7 +90,16 @@ class RoomParkMainActivity(
get() = headerToolbar.findViewById<MaterialTextView>(R.id.back_button_chevron) get() = headerToolbar.findViewById<MaterialTextView>(R.id.back_button_chevron)
override fun setToolbar(header:HeaderToolbarModel?,status:StatusToolbarModel?){ override fun setToolbar(header:HeaderToolbarModel?,status:StatusToolbarModel?){
appBar.setExpanded(false,false) appBar.setExpanded(false,false)
if (header == null && status == null){
hideAll()
appBar.setGone(true)
return
} else appBar.setGone(false)
showAll()
appBarScrollable(false)
Timber.d("NOTGONE")
headerToolbar.setGone(header==null) headerToolbar.setGone(header==null)
statusToolbar.setGone(status==null) statusToolbar.setGone(status==null)
header?.let { header?.let {
...@@ -104,7 +113,6 @@ class RoomParkMainActivity( ...@@ -104,7 +113,6 @@ class RoomParkMainActivity(
statusToolbar.status_icon.setGone(it.state == null) statusToolbar.status_icon.setGone(it.state == null)
statusToolbar.status_title.setGone(it.state == null) statusToolbar.status_title.setGone(it.state == null)
it.state?.let { state -> it.state?.let { state ->
Timber.d("status: $state")
statusToolbar.status_icon.isEnabled = when(state){ statusToolbar.status_icon.isEnabled = when(state){
StatusState.AVAILABLE -> true StatusState.AVAILABLE -> true
else -> false else -> false
...@@ -128,13 +136,13 @@ class RoomParkMainActivity( ...@@ -128,13 +136,13 @@ class RoomParkMainActivity(
override fun hide() { override fun hide() {
bottomNavigation.visibility = BottomNavigationView.GONE bottomNavigation.setGone(true)
bottomShadow.visibility = View.GONE bottomNavigation.setGone(true)
} }
override fun show() { override fun show() {
bottomNavigation.visibility = Toolbar.VISIBLE bottomNavigation.setGone(false)
bottomShadow.visibility = View.VISIBLE bottomNavigation.setGone(false)
} }
......
...@@ -31,7 +31,7 @@ class AuthScreenController : ...@@ -31,7 +31,7 @@ class AuthScreenController :
override fun onViewBound(v: View) { override fun onViewBound(v: View) {
toolBar.hideAll() toolBar.setToolbar()
bottomNavigation.hide() bottomNavigation.hide()
} }
......
...@@ -123,6 +123,7 @@ class BNVRouterPagerAdapter( ...@@ -123,6 +123,7 @@ class BNVRouterPagerAdapter(
} }
fun drawToolbar(position: Int){ fun drawToolbar(position: Int){
return
val toolBar = currentPrimaryRouter?.activity as ICollapsingToolBar val toolBar = currentPrimaryRouter?.activity as ICollapsingToolBar
toolBar.showAll() toolBar.showAll()
toolBar.appBar.setExpanded(false,true) toolBar.appBar.setExpanded(false,true)
......
...@@ -24,7 +24,7 @@ class SplashScreenController : ...@@ -24,7 +24,7 @@ class SplashScreenController :
override fun onViewBound(v: View) { override fun onViewBound(v: View) {
toolBar.hideAll() // toolBar.setToolbar()
bottomNavigation.hide() bottomNavigation.hide()
} }
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
app:contentInsetStart="0dp" app:contentInsetStart="0dp"
android:minHeight="0dp" android:minHeight="0dp"
app:titleEnabled="false" app:titleEnabled="false"
tools:visibility="visible"> tools:visibility="invisible">
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/top_toolbar" android:id="@+id/top_toolbar"
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
android:contentInsetEnd="0dp" android:contentInsetEnd="0dp"
android:contentInsetRight="0dp" android:contentInsetRight="0dp"
android:padding="0dp" android:padding="0dp"
android:visibility="visible" android:visibility="invisible"
android:minHeight="0dp" android:minHeight="0dp"
app:contentInsetEnd="0dp" app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="0dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:background="#00000000" android:background="#00000000"
app:tabIndicatorColor="@color/colorAccent" app:tabIndicatorColor="@color/colorAccent"
......
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