-
Notifications
You must be signed in to change notification settings - Fork 164
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
move() method smearing on KitKat with snackbar. #28
Comments
Hi marcochin, Sure, I'll have a look at this Have you tried also to move ActionButton on KitKat without Snackbar library? |
This only happens when you SWIPE AWAY the snackbar. If you dismiss the snackbar by clicking the snackbar action button, the animation will work properly. And no I haven't tried it without the snackbar library, dunno if I can reproduce it without swiping away the snackbar. ActionButton in xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:scrollbars="vertical"/>
<com.software.shell.fab.ActionButton
android:id="@+id/floating_action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
fab:button_color="@color/fab_normal_state"
fab:button_colorPressed="@color/fab_pressed_state"
fab:image="@drawable/ic_add"
fab:image_size="30dp"
/>
</RelativeLayout> Snackbar configuration in java: SnackbarManager.show(
Snackbar.with(getActivity())
.text(R.string.snack_bar_text_item_removed)
.actionLabel(R.string.snack_bar_action_undo)
.actionListener(new ActionClickListener() {
@Override
public void onActionClicked(Snackbar snackbar) {
/* some code */
}
})
.colorResource(R.color.snackbar_bg_color)
.textColorResource(R.color.snackbar_text_color)
.actionColorResource(R.color.snackbar_action_color)
.duration(5000)
.type(SnackbarType.SINGLE_LINE)
.swipeToDismiss(true)
.eventListener(new EventListener() {
@Override
public void onShow(Snackbar snackbar) {
float snackbarHeight = DpPxConversionUtil.convertPixelsToDp(snackbar.getHeight(), getActivity());
mFloatingActionButton.moveUp(snackbarHeight);
}
@Override
public void onShowByReplace(Snackbar snackbar) {
}
@Override
public void onShown(Snackbar snackbar) {
}
@Override
public void onDismiss(Snackbar snackbar) {
float snackbarHeight = DpPxConversionUtil.convertPixelsToDp(snackbar.getHeight(), getActivity());
mFloatingActionButton.moveDown(snackbarHeight);
}
@Override
public void onDismissByReplace(Snackbar snackbar) {
}
@Override
public void onDismissed(Snackbar snackbar) {
}
})
); DpPxConversionUtil Class if you're interested: public class DpPxConversionUtil {
public static float convertDpToPixel(float dp, Context context){
return dp * context.getResources().getDisplayMetrics().density;
}
public static float convertPixelsToDp(float px, Context context){
return px / context.getResources().getDisplayMetrics().density;
}
} |
So, I found a possible place to fix within a library, which ActionButton depends on. However, KitKat emulator is a sort of hard way to test the fix, because of the rendering (actually I can't get even smooth animation on it). Will you have a possibility to check the fix on your side if I build the sample application and send you the .apk file? |
Yea, but I can also only test it on an emulator. I had a real KitKat device, but I recently updated it to lollipop.. |
…changed the standard Android logging API to slf4j logging API
Fixed in version 1.1.2 |
I've ran it on my emulator and seems to be fixed |
The FAB seems to be smearing (leaving a image trail behind) under certain conditions in KitKat when move is called.
I'm using your FAB in conjunction with nispok's Snackbar library https://github.com/nispok/snackbar,
and when the snackbar slides up, I move my FAB up by the snackbar height. However, when I SWIPE AWAY the snackbar (very important detail), the FAB comes back down, but it leaves a trail of itself.
I made my own translation animation and the smearing is gone, so it's a good chance that it's a bug in your library. I thought it should be something you should look at.
Note: I've only tested this on the emulator.
ICSand Lollipop work fine.Edit: Jellybean works fine, did not test ICS.
The text was updated successfully, but these errors were encountered: