You are talking about a floating action button. Bottom line: there is no "FAB" widget (at least for now), it is a custom layout that needs to be implemented.
If you really want to fully implement the Material Design app, I recommend that you take a look at the Google 2014 I / O app . They have an example FAB layout here .
Here is the code to create it. It was from this gist that I got from this post .
public class FloatingActionButton extends View { Context context; Paint mButtonPaint; Paint mDrawablePaint; Bitmap mBitmap; boolean mHidden = false; public FloatingActionButton(Context context) { super(context); this.context = context; init(Color.WHITE); } public void init(int color) { setWillNotDraw(false); setLayerType(View.LAYER_TYPE_SOFTWARE, null); mButtonPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mButtonPaint.setColor(color); mButtonPaint.setStyle(Paint.Style.FILL); mButtonPaint.setShadowLayer(10.0f, 0.0f, 3.5f, Color.argb(100, 0, 0, 0)); mDrawablePaint = new Paint(Paint.ANTI_ALIAS_FLAG); invalidate(); } @Override protected void onDraw(Canvas canvas) { setClickable(true); canvas.drawCircle(getWidth() / 2, getHeight() / 2, (float) (getWidth() / 2.6), mButtonPaint); canvas.drawBitmap(mBitmap, (getWidth() - mBitmap.getWidth()) / 2, (getHeight() - mBitmap.getHeight()) / 2, mDrawablePaint); } @Override public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_UP) { setAlpha(1.0f); } else if (event.getAction() == MotionEvent.ACTION_DOWN) { setAlpha(0.6f); } return super.onTouchEvent(event); } public void setColor(int color) { init(color); } public void setDrawable(Drawable drawable) { mBitmap = ((BitmapDrawable) drawable).getBitmap(); invalidate(); } public void hide() { if (!mHidden) { ObjectAnimator scaleX = ObjectAnimator.ofFloat(this, "scaleX", 1, 0); ObjectAnimator scaleY = ObjectAnimator.ofFloat(this, "scaleY", 1, 0); AnimatorSet animSetXY = new AnimatorSet(); animSetXY.playTogether(scaleX, scaleY); animSetXY.setInterpolator(new AccelerateInterpolator()); animSetXY.setDuration(100); animSetXY.start(); mHidden = true; } } public void show() { if (mHidden) { ObjectAnimator scaleX = ObjectAnimator.ofFloat(this, "scaleX", 0, 1); ObjectAnimator scaleY = ObjectAnimator.ofFloat(this, "scaleY", 0, 1); AnimatorSet animSetXY = new AnimatorSet(); animSetXY.playTogether(scaleX, scaleY); animSetXY.setInterpolator(new OvershootInterpolator()); animSetXY.setDuration(200); animSetXY.start(); mHidden = false; } } public boolean isHidden() { return mHidden; } public static class Builder { private FrameLayout.LayoutParams params; private final Activity activity; int gravity = Gravity.BOTTOM | Gravity.RIGHT;
Then you would add like this:
FloatingActionButton mFab = new FloatingActionButton.Builder(this) .withColor(getResources().getColor(R.color.accent_color)) .withDrawable(getResources().getDrawable(R.drawable.fab_icon)) .withSize(72) .withMargins(0, 0, 16, 16) .create();