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

workaround warp_content appbar

parent 4581a2fa
...@@ -6,7 +6,6 @@ import android.view.ViewGroup ...@@ -6,7 +6,6 @@ import android.view.ViewGroup
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import androidx.coordinatorlayout.widget.CoordinatorLayout import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.isGone
import butterknife.BindView import butterknife.BindView
import butterknife.ButterKnife import butterknife.ButterKnife
import com.biganto.visual.roompark.BuildConfig import com.biganto.visual.roompark.BuildConfig
...@@ -26,6 +25,7 @@ import kotlinx.android.synthetic.main.activity_main.* ...@@ -26,6 +25,7 @@ import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.status_layout_toolbar.view.* import kotlinx.android.synthetic.main.status_layout_toolbar.view.*
import timber.log.Timber import timber.log.Timber
class RoomParkMainActivity( class RoomParkMainActivity(
) : BaseRoomParkActivity() ) : BaseRoomParkActivity()
,ICollapsingToolBar ,ICollapsingToolBar
...@@ -114,16 +114,36 @@ class RoomParkMainActivity( ...@@ -114,16 +114,36 @@ class RoomParkMainActivity(
statusToolbar.mean_title.setGone(it.meanTitle == null) statusToolbar.mean_title.setGone(it.meanTitle == null)
it.meanTitle?.let { title -> statusToolbar.mean_title.text = title} it.meanTitle?.let { title -> statusToolbar.mean_title.text = title}
} }
headerToolbar.measure(0,View.MeasureSpec.UNSPECIFIED)
statusToolbar.measure(0,View.MeasureSpec.UNSPECIFIED)
tbContainer.measure(0,View.MeasureSpec.UNSPECIFIED)
val _d = resources.displayMetrics.density
headerToolbar.requestLayout() headerToolbar.requestLayout()
statusToolbar.requestLayout() statusToolbar.requestLayout()
tbContainer.requestLayout()
Timber.d(" heights _d: ${_d}")
val params = topAppBar.layoutParams as AppBarLayout.LayoutParams Timber.d(" heights h: ${headerToolbar.height}")
val toolbarHeight = Timber.d(" heights s: ${statusToolbar.height}")
if (!headerToolbar.isGone) headerToolbar.height else 0 + Timber.d(" heights tb: ${tbContainer.height}")
if (!statusToolbar.isGone) statusToolbar.height else 0
params.height = toolbarHeight // val params_l= tbContainer.layoutParams as LinearLayout.LayoutParams
topAppBar.layoutParams = params // params_l.height = _h
// val params = topAppBar.layoutParams as AppBarLayout.LayoutParams
// val toolbarHeight = (tbContainer.measuredHeight/_d).toInt()
// if (!headerToolbar.isGone) headerToolbar.height else 0 +
// if (!statusToolbar.isGone) statusToolbar.height else 0
// params.height = tbContainer.height
// topAppBar.layoutParams = params
topAppBar.requestLayout() topAppBar.requestLayout()
appBar.requestLayout()
} }
......
...@@ -86,7 +86,7 @@ class SettingsScreenController : ...@@ -86,7 +86,7 @@ class SettingsScreenController :
toolBar.setToolbar( toolBar.setToolbar(
HeaderToolbarModel( HeaderToolbarModel(
false,null false,null
,resources?.getString(R.string.settings),null) ,resources?.getString(R.string.flats),null)
) )
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
android:id="@+id/app_bar" android:id="@+id/app_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/colorCommonBackground" android:background="@color/colorGray"
android:clipToPadding="true" android:clipToPadding="true"
android:padding="0dp" android:padding="0dp"
android:theme="@style/ThemeOverlay.AppCompat.Light" android:theme="@style/ThemeOverlay.AppCompat.Light"
...@@ -39,11 +39,13 @@ ...@@ -39,11 +39,13 @@
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetRight="0dp" app:contentInsetRight="0dp"
app:contentInsetStart="0dp" app:contentInsetStart="0dp"
android:minHeight="24dp"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
tools:visibility="visible"> tools:visibility="visible">
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:background="@color/colorAttention"
android:id="@+id/top_toolbar" android:id="@+id/top_toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -52,9 +54,9 @@ ...@@ -52,9 +54,9 @@
android:contentInsetLeft="0dp" android:contentInsetLeft="0dp"
android:contentInsetEnd="0dp" android:contentInsetEnd="0dp"
android:contentInsetRight="0dp" android:contentInsetRight="0dp"
android:minHeight="24dp"
android:padding="0dp" android:padding="0dp"
android:visibility="visible" android:visibility="visible"
android:minHeight="24dp"
app:contentInsetEnd="0dp" app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetRight="0dp" app:contentInsetRight="0dp"
...@@ -66,9 +68,8 @@ ...@@ -66,9 +68,8 @@
app:titleTextAppearance="@style/Header_TextView.Main_Header"> app:titleTextAppearance="@style/Header_TextView.Main_Header">
<LinearLayout <LinearLayout
android:minHeight="24dp"
android:background="@color/colorAccentSecondary"
android:id="@+id/custom_toolbar_container" android:id="@+id/custom_toolbar_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
android:id="@+id/switch_toolbar_container" android:id="@+id/switch_toolbar_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/colorError"
android:fitsSystemWindows="true"> android:fitsSystemWindows="true">
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
...@@ -29,10 +30,10 @@ ...@@ -29,10 +30,10 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:ellipsize="end" android:ellipsize="none"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
android:gravity="start|center_vertical" android:gravity="start|center_vertical"
android:text="НОВОСТИ\nИРКУТСКА" android:text="ЗАГОЛОВОК"
android:textAlignment="gravity" android:textAlignment="gravity"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/include13" app:layout_constraintEnd_toStartOf="@+id/include13"
......
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