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

workaround warp_content appbar

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