-
Notifications
You must be signed in to change notification settings - Fork 237
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
Up FloatButton when it shows the message #113
Comments
Hi, there's an |
Hi wmora, I am having the same issue, due to a floating action button. Unfortunately simply raising and lowering the FAB in the Here is my code. The FAB is a child of private class SnackbarListener implements EventListener {
@Override
public void onShow(Snackbar snackbar) {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT
);
params.setMargins(0, 0, 0, snackbar.getHeight());
rlContent.setLayoutParams(params);
}
@Override
public void onShowByReplace(Snackbar snackbar) {
}
@Override
public void onShown(Snackbar snackbar) {
}
@Override
public void onDismiss(Snackbar snackbar) {
}
@Override
public void onDismissByReplace(Snackbar snackbar) {
}
@Override
public void onDismissed(Snackbar snackbar) {
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT
);
rlContent.setLayoutParams(params);
}
} This would work in normal cases. But if a second snackbar is shown before the previous one is dismissed, when the first snackbar disappears, Currently my workaround is to maintain a snackbar counter in the activity. The counter is increased by one whenever a snackbar is shown, and in But to me my solution is not so elegant. Is there a better way to deal with FABs? |
I figured it out... Just reset the margin to 0 in |
Still, the movement of the FAB is not as smooth as the demo in http://www.google.com/design/spec/components/snackbars-toasts.html#snackbars-toasts-usage |
Hi zhangns, for make it a bit smoother i use this: hope this helps |
@gedu Thanks! Works perfectly. |
@gedu your solution works. At first I was attempting to add an |
Congratulations on your fantastic library.
I have the following situation.
I have a layout where it has a RecyclerView and FloatButton.
Can you explain your blibioteca, the message appears over my FloatButton and correct it would raise the FloatButton.
Know how I can fix this?
thank you.
The text was updated successfully, but these errors were encountered: