Make BottomSheetHeaderBar fixed height
This commit is contained in:
@@ -216,7 +216,7 @@ class BottomSheetHeaderBar @JvmOverloads constructor(
|
||||
return true
|
||||
}
|
||||
val viewId = child.id
|
||||
return viewId == R.id.dragHandle || viewId == R.id.toolbar
|
||||
return viewId == R.id.dragHandle || viewId == R.id.toolbar || viewId == R.id.frame
|
||||
}
|
||||
|
||||
private fun convertLayoutParams(params: ViewGroup.LayoutParams?): Toolbar.LayoutParams? {
|
||||
@@ -236,8 +236,8 @@ class BottomSheetHeaderBar @JvmOverloads constructor(
|
||||
private fun getTransition(): AutoTransition {
|
||||
transition?.let { return it }
|
||||
val t = AutoTransition()
|
||||
t.duration = context.getAnimationDuration(R.integer.config_tinyAnimTime)
|
||||
// t.interpolator = AccelerateDecelerateInterpolator()
|
||||
t.duration = context.getAnimationDuration(android.R.integer.config_shortAnimTime)
|
||||
t.addTarget(binding.dragHandle)
|
||||
transition = t
|
||||
return t
|
||||
}
|
||||
|
||||
@@ -3,22 +3,30 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
tools:parentTag="com.google.android.material.appbar.AppBarLayout">
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:id="@+id/dragHandle"
|
||||
<FrameLayout
|
||||
android:id="@+id/frame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="15dp"
|
||||
android:minHeight="0dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="0dp" />
|
||||
android:layout_height="?attr/actionBarSize">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/ThemeOverlay.Kotatsu.MainToolbar"
|
||||
tools:navigationIcon="?actionModeCloseDrawable"
|
||||
tools:title="@string/options" />
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:theme="@style/ThemeOverlay.Kotatsu.MainToolbar"
|
||||
tools:navigationIcon="?actionModeCloseDrawable"
|
||||
tools:title="@string/options" />
|
||||
|
||||
<com.google.android.material.bottomsheet.BottomSheetDragHandleView
|
||||
android:id="@+id/dragHandle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="0dp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</merge>
|
||||
|
||||
Reference in New Issue
Block a user