home: rework fab adaptiveness

Rework how the fab's adaptive functionality works.

Handle fab adaptiveness by using a style instead of a fully custom
view. This helps eliminate a usage of private resources.
This commit is contained in:
OxygenCobalt
2022-02-23 16:13:59 -07:00
parent 87035805d2
commit 280b582efa
8 changed files with 44 additions and 58 deletions
+5 -6
View File
@@ -40,24 +40,23 @@
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
tools:layout="@layout/fragment_home_list" />
<org.oxycblt.auxio.home.FloatingActionButtonContainer
<org.oxycblt.auxio.home.EdgeFabContainer
android:id="@+id/home_fab_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_anchor="@id/home_pager"
app:layout_anchorGravity="bottom|end">
<org.oxycblt.auxio.home.AdaptiveFloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/home_fab"
style="@style/Widget.Auxio.FloatingActionButton.Adaptive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Widget.Material3.FloatingActionButton.Primary"
android:layout_margin="@dimen/spacing_medium"
android:contentDescription="@string/desc_shuffle_all"
android:src="@drawable/ic_shuffle"
app:tint="?attr/colorOnPrimaryContainer" />
android:src="@drawable/ic_shuffle" />
</org.oxycblt.auxio.home.FloatingActionButtonContainer>
</org.oxycblt.auxio.home.EdgeFabContainer>
</org.oxycblt.auxio.ui.EdgeCoordinatorLayout>
</layout>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<layout>
<merge 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"
tools:parentTag="android.widget.FrameLayout">
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/shuffle_fab"
style="@style/Widget.Auxio.FloatingActionButton.Adaptive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/spacing_medium"
android:contentDescription="@string/desc_shuffle_all"
android:src="@drawable/ic_shuffle"
app:icon="@drawable/ic_shuffle" />
</merge>
</layout>