Android Align Fab in ConstraintLayout

The FloatingActionButton can be aligned to all corners of the parent ConstraintLayout:

FAB constraint relationXML markup
top & startapp:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
top & endapp:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
bottom & startapp:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
bottom & endapp:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

To evenly position it, use layout_margin:

android:layout_margin=”24dp”