Closed androideveloper closed 9 years ago
Can you please provide some code for style that disables animation? Because I haven't found solution in #61 and have tried many ways, but animation still shows.
what you need to do is customize your bottomsheet style and set
Please check sample "Style" for how to style bottomsheet.
What you mean by saying that? What do I need to set @null??
<style name="BottomSheet.StyleDialog" parent="BottomSheet.Dialog">
<item name="android:backgroundDimAmount">0.5</item>
<item name="android:windowAnimationStyle">@null</item>
<item name="android:textColorPrimary">#DDffffff</item>
<item name="android:textColorSecondary">#8Affffff</item>
<item name="android:textColorHint">#42ffffff</item>
<item name="bs_dialogBackground">@color/abc_search_url_text_normal</item>
<item name="bs_dividerColor">@color/abc_search_url_text_pressed</item>
<item name="bs_numColumns">4</item>
<item name="bs_listStyle">@style/BottomSheet.StyleList</item>
</style>
or
In your case,
<style name="BottomSheet.StyleDialog" parent="BottomSheet.Dialog">
<item name="android:backgroundDimAmount">0.5</item>
<item name="android:windowAnimationStyle">@null</item>
<item name="android:textColorPrimary">#DDffffff</item>
<item name="android:textColorSecondary">#8Affffff</item>
<item name="android:textColorHint">#42ffffff</item>
<item name="bs_dialogBackground">@color/abc_search_url_text_normal</item>
<item name="bs_dividerColor">@color/abc_search_url_text_pressed</item>
<item name="bs_numColumns">4</item>
<item name="bs_listStyle">@style/BottomSheet.StyleList</item> <--------
</style>
You need to have your own listStyle, like
<style name="BottomSheet.StyleList" parent="BottomSheet.List.Dark" >
<item name="android:listSelector">@drawable/list_selector</item>
<item name="android:layoutAnimation">@null</item> <---- this is the key
</style>
and use BottomSheet.StyleDialog as your bottomsheet style
Thanks a lot! Finally! List style is the key!
To everyone who wants to disable only list animation and bottom sheet will be like in dropbox or somewhere else:
<style name="BottomSheet.StyleDialog" parent="BottomSheet.Dialog">
<item name="android:backgroundDimAmount">0.5</item>
<item name="android:windowAnimationStyle">@style/BottomSheet.Animation</item>
<item name="bs_listStyle">@style/BottomSheet.StyleList</item>
</style>
<style name="BottomSheet.StyleList" parent="BottomSheet.List">
<item name="android:layoutAnimation">@null</item>
</style>
And then use this style for creating bottom sheet: new BottomSheet.Builder(this, R.style.BottomSheet_StyleDialog)
I want bottom sheet to be like in Dropbox