Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

BottomSheet bugfixes (crash, animation) #2077

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MFlisar
Copy link
Contributor

@MFlisar MFlisar commented Aug 31, 2021

Feel free to only merge the bottom sheet changes and the dismiss change.

This does fix following issue:
https://github.com/afollestad/material-dialogs/issues/2076

Changes

  • Updated MaterialDialog dismiss function to make sure it's only called if the activity is not being finished (only if it is attached to an activity and only on android API >= 17)
  • Updated BottomSheet to allow to enable/disable animation and to allow to define an initial state (half expanded, full expanded)
    => animation must be disabled inside a DialogFragment because this fragment will call onShow after screen rotation and also after screen off/on => this leads to collapsed sheets sometimes and to repeated animations on every screen on/off
    => if animation is disabled, everything works perfectly fine inside a DialogFragment as well now

Additionally I would have also done following:

  • updated gradle to 7.2
  • made the project jitpack compatible again after update to gradle 7 (forks can be retrieved easily via jitpack now)
  • made the project compatible to include it as local fork
    • added a "namespace" to all modules (prefix md)
    • made gradle definitions relative to project instead of root project

TODO after merge (seems like you do not merge anything anymore, but still here are the steps to undo my "special" changes)

Note

If someone else wants to use it already, it's already published on jitpack and can be used like following:

implementation "com.github.MFlisar.material-dialogs:core:3.3.0-1"
....

* updated gradle to 7.2
* made the project jitpack compatible (forks can be retrieved easily via jitpack now)
* added a "namespace" to projects so that a local fork can be easily used inside an own project (prefix md)
* made gradle definitions relative to project instead of root project (again to make it possible to use a local fork inside an own project)

Functional

* Updated MaterialDialog dismiss function to make sure it's only called if the activity is not being finished (only if it is attached to an activity and only on android API >= 17)
* Updated BottomSheet to allow to enable/disable animation and to allow to define an initial state (half expanded, full expanded)
    => animation must be disabled inside a DialogFragment because this fragment will call onShow after screen rotation and also after screen off/on => this leads to collapsed sheets sometimes and to repeated animations on every screen on/off
    => if animation is disabled, everything works perfectly fine inside a DialogFragment as well now
@MFlisar MFlisar changed the title BottomSheet bugfixes BottomSheet bugfixes (crash, animation) Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant