This repository was archived by the owner on Sep 3, 2023. It is now read-only.
BottomSheet bugfixes (crash, animation)#2077
Open
MFlisar wants to merge 2 commits into
Open
Conversation
* 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
=> 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:
TODO after merge (seems like you do not merge anything anymore, but still here are the steps to undo my "special" changes)
https://github.com/MFlisar/material-dialogs/blob/b8f8203513466b1c30dc8046ef5e61a3e61495b5/gradle/android_library_config.gradle#L6-L9
https://github.com/MFlisar/material-dialogs/blob/b8f8203513466b1c30dc8046ef5e61a3e61495b5/gradle/android_common_config.gradle#L6
Note
If someone else wants to use it already, it's already published on jitpack and can be used like following: