If you are talking about these buttons, it would be good to apply the open source provided in the link below. https://github.com/gowong/material-sheet-fab
If it's how you use it,
in build.gradle
Apply compile 'com.gordonwoong:material-sheet-fab:1.2.1'
You can make a class and implement the FAB button.
import android.support.design.widget.FloatingActionButton;
public class Fab extends FloatingActionButton implements AnimatedFab {
/**
* * Shows the FAB.
*/
@Override
public void show() {
show(0, 0);
}
/**
* * Shows the FAB and sets the FAB's translation.
*
* * @param translationX translation X value
* * @param translationY translation Y value
*/
@Override
public void show(float translationX, float translationY) {
// // NOTE: Using the parameters is only needed if you want
// // to support moving the FAB around the screen.
// // NOTE: This immediately hides the FAB. An animation can
// // be used instead - see the sample app.
setVisibility(View.VISIBLE);
}
/**
* * Hides the FAB.
*/
@Override
public void hide() {
// // NOTE: This immediately hides the FAB. An animation can
// // be used instead - see the sample app.
setVisibility(View.INVISIBLE);
}
}
© 2024 OneMinuteCode. All rights reserved.