-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v6.1 no longer works with CoordinatorLayout, must be a FrameLayout now #23
Comments
I guess I overthought it, and I fixed it simply by using |
Thanks for the feedback @bwalsh0. Using a coordinator layout should be the default choice and should move the fab by default. Can you tell me the exact line number of code that caused the crash in stack trace (or just post the stack trace here)? I'd keep this issue open until I test and confirm it works with coordinator layout. |
Sure, it only happens right before the snackbar is about to be shown, but it gets past instantiating SnackBarProgressManager just fine. Stack seems to suggest it has to do with animations So it must be something below: SnackProgressBar progSnack = new SnackProgressBar(
SnackProgressBar.TYPE_HORIZONTAL, progMsg)
.setAllowUserInput(true)
.setIsIndeterminate(false)
.setProgressMax(100);
snackProgressBarManager.setProgress(10).show(progSnack, SnackProgressBarManager.LENGTH_INDEFINITE); My layout.xml hierarchy is as follows: - Parent/Root (LinearLayoutCompat) Here's the full trace, it's pretty long:
|
@bwalsh0, thanks for the details. I've narrowed it down to the wrong casting of parent view in A new code was added since I'm now exposing The casting is now corrected. Please give |
Works perfectly with CoordinatorLayout on that build now, thanks! Glad to hear the layout can use a margin now, I've held off from migrating to bottom navigation due to conflicts with fabs/snackbars in the past. |
Great! Might be a good time to test now. I'll publish this as new release soon. Pending another issue to be closed. I'll let you know when a new version is available. |
Hi, any chance for release with the fix? |
Prior to v6.x, I was using a CoordinatorLayout as the view for the snackbar since I have a FAB that I would like to respond to a snackbar being shown. Upon updating, I've had to use FrameLayout to avoid a crash.
I've also tried to access
snackProgressBarLayout.setViewsToMove$lib_release(View[]);
, but it has no effect when getting the FAB view.This is my error:
ClassCastException: androidx.coordinatorlayout.widget.CoordinatorLayout$LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams
Occurs here:
The error is fixed when I change the coordinatorLayout to a FrameLayout, but the FAB no longer moves along with it. I've tried making a CoordinatorLayout the parent of the FrameLayout, but the same error results. I've tried
android:animateLayoutChanges="true"
, but I don't think that has any effect on a FrameLayout.You've done a tremendous job with 6.0+, loving the new behavior to .updateTo and the public SnackProgressBarLayout, as well as Lifecycle management.
The text was updated successfully, but these errors were encountered: