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