This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ValueAnimator.ofFloat(materialShapeDrawable.interpolation, finishState).apply { | |
| addUpdateListener { materialShapeDrawable.interpolation = it.animatedValue as Float } | |
| doOnEnd { fab.show() } | |
| start() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| tools:context=".MainActivity"> | |
| <com.vadmax.fabbottomnavigationview.FabBottomNavigationView | |
| android:id="@+id/bottomNavigationView" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| tools:context=".MainActivity"> | |
| <com.vadmax.fabbottomnavigationview.FabBottomNavigationView | |
| android:id="@+id/bottomNavigationView" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val materialShapeDrawable = MaterialShapeDrawable(shapePathModel).apply { | |
| setTint(ContextCompat.getColor(context, R.color.bottom_bar)) | |
| shadowElevation = 4 | |
| shadowRadius = 16 | |
| isShadowEnabled = true | |
| paintStyle = Paint.Style.FILL_AND_STROKE | |
| } | |
| background = materialShapeDrawable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val shapePathModel = ShapePathModel().apply { | |
| topEdge = topCurvedEdgeTreatment | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val topCurvedEdgeTreatment =TopCurvedEdgeTreatment(fabCradleMargin, fabCradleRoundedCornerRadius, cradleVerticalOffset).apply { | |
| fabDiameter = fabSize | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.google.android.material.shape.EdgeTreatment | |
| import com.google.android.material.shape.ShapePath | |
| class TopCurvedEdgeTreatment( | |
| var fabCradleMargin: Float, | |
| var fabCradleRoundedCornerRadius: Float, | |
| var cradleVerticalOffset: Float | |
| ) : EdgeTreatment() { | |
| var fabDiameter: Float = 0F |