Commit 3cf70f8e authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

find da wae: toolbar height allow to be dynamically changed via...

find da wae: toolbar height allow to be dynamically changed via AppBarlayout.LayoutParams && requestLayout()
parent 4bd41430
...@@ -13,13 +13,12 @@ import com.biganto.visual.roompark.conductor.BigantoBaseController ...@@ -13,13 +13,12 @@ import com.biganto.visual.roompark.conductor.BigantoBaseController
import com.biganto.visual.roompark.util.extensions.toRubly import com.biganto.visual.roompark.util.extensions.toRubly
import com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressAnimationState import com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressAnimationState
import com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil import com.biganto.visual.roompark.util.view_utils.status_progress_view.StatusProgressCeil
import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.textview.MaterialTextView import com.google.android.material.textview.MaterialTextView
import timber.log.Timber import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
/** /**
* Created by Vladislav Bogdashkin on 30.09.2019. * Created by Vladislav Bogdashkin on 30.09.2019.
*/ */
...@@ -77,13 +76,23 @@ class DealScreenController : ...@@ -77,13 +76,23 @@ class DealScreenController :
activity?.actionBar?.setDisplayShowTitleEnabled(false) activity?.actionBar?.setDisplayShowTitleEnabled(false)
toolBar.statusToolbar.visibility=View.GONE toolBar.statusToolbar.visibility=View.GONE
toolBar.headerToolbar.visibility=View.VISIBLE toolBar.headerToolbar.visibility=View.VISIBLE
toolBar.statusToolbar.visibility=View.VISIBLE toolBar.headerToolbar.findViewById<MaterialTextView>(R.id.toolbar_title).text = "Кв. 1231\n42342"
toolBar.headerToolbar.visibility=View.GONE val params = toolBar.topAppBar.layoutParams as AppBarLayout.LayoutParams
toolBar.headerToolbar.findViewById<MaterialTextView>(R.id.toolbar_title).text = "Azzzzaa" resources?.displayMetrics?.density?.let{
params.height = toolBar.headerToolbar.height
Timber.d("density: $it")
// params.height = (24f*it).toInt()
Timber.d("density: ${params.height}")
}?: error("resources not available!")
toolBar.topAppBar.layoutParams = params
toolBar.topAppBar.requestLayout()
toolBar.topAppBar.invalidate() toolBar.topAppBar.invalidate()
} }
private fun bindRecycler() { private fun bindRecycler() {
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
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="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/colorAccentSecondary"
android:fitsSystemWindows="true"> android:fitsSystemWindows="true">
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
...@@ -15,22 +14,22 @@ ...@@ -15,22 +14,22 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:drawableStart="@drawable/ic_chevron_left" android:drawableStart="@drawable/ic_chevron_left"
android:fitsSystemWindows="true"
android:gravity="start|center_vertical" android:gravity="start|center_vertical"
android:text="МОИ \nСДЕЛКИ" android:text="МОИ \nСДЕЛКИ"
android:textAlignment="gravity" android:textAlignment="gravity"
app:drawableTint="@color/colorAccent" app:drawableTint="@color/colorAccent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
android:fitsSystemWindows="true"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:fitsSystemWindows="true"
android:id="@+id/toolbar_title" android:id="@+id/toolbar_title"
style="@style/Header_TextView.Main_Header" style="@style/Header_TextView.Main_Header"
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:fitsSystemWindows="true"
android:gravity="start|center_vertical" android:gravity="start|center_vertical"
android:text="НОВОСТИ" android:text="НОВОСТИ"
android:textAlignment="gravity" android:textAlignment="gravity"
...@@ -47,12 +46,12 @@ ...@@ -47,12 +46,12 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:fitsSystemWindows="true"
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0" app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="@+id/toolbar_title" app:layout_constraintStart_toEndOf="@+id/toolbar_title"
android:fitsSystemWindows="true"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="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