Skip to content

Commit c72b6b6

Browse files
committed
Better mini fabs on upper cards
1 parent 04ecf0c commit c72b6b6

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

app/src/main/res/layout/fragment_favorites.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,6 @@
66
android:layout_height="match_parent"
77
app:layoutDescription="@xml/fragment_favorites_scene">
88

9-
<com.google.android.material.floatingactionbutton.FloatingActionButton
10-
android:id="@+id/favoritesMiniFab"
11-
style="?attr/floatingActionButtonSmallStyle"
12-
android:layout_width="wrap_content"
13-
android:layout_height="wrap_content"
14-
android:alpha="@dimen/mini_fab_opacity"
15-
android:contentDescription="@string/cancel"
16-
android:hapticFeedbackEnabled="false"
17-
app:backgroundTint="?attr/colorOnSurface"
18-
app:elevation="@dimen/bottom_navbar_elevation"
19-
app:layout_constraintBottom_toTopOf="@id/favoritesCard"
20-
app:layout_constraintEnd_toEndOf="parent"
21-
app:layout_constraintStart_toStartOf="parent"
22-
app:layout_constraintTop_toTopOf="@id/favoritesCard"
23-
app:rippleColor="?attr/colorPrimary"
24-
app:srcCompat="@drawable/ic_arrow_up_24dp"
25-
app:tint="?attr/colorPrimary" />
26-
279
<com.google.android.material.card.MaterialCardView
2810
android:id="@+id/favoritesCard"
2911
android:layout_width="0dp"
@@ -462,4 +444,22 @@
462444
app:layout_constraintStart_toStartOf="parent"
463445
app:layout_constraintTop_toBottomOf="@id/favoritesCard" />
464446

447+
<Button
448+
android:id="@+id/favoritesMiniFab"
449+
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined"
450+
android:layout_width="wrap_content"
451+
android:layout_height="wrap_content"
452+
android:hapticFeedbackEnabled="false"
453+
app:backgroundTint="?attr/colorSurface"
454+
app:elevation="@dimen/bottom_navbar_elevation"
455+
app:icon="@drawable/ic_arrow_up_24dp"
456+
app:iconTint="?attr/colorPrimary"
457+
app:layout_constraintBottom_toTopOf="@id/favoritesCard"
458+
app:layout_constraintEnd_toEndOf="parent"
459+
app:layout_constraintStart_toStartOf="parent"
460+
app:layout_constraintTop_toTopOf="@id/favoritesCard"
461+
app:rippleColor="?attr/colorSecondary"
462+
app:strokeColor="?attr/colorOutline"
463+
app:strokeWidth="@dimen/card_stroke" />
464+
465465
</androidx.constraintlayout.motion.widget.MotionLayout>

app/src/main/res/layout/fragment_home.xml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,6 @@
1313
android:layout_width="match_parent"
1414
android:layout_height="match_parent" />
1515

16-
<com.google.android.material.floatingactionbutton.FloatingActionButton
17-
android:id="@+id/homeMiniFab"
18-
style="?attr/floatingActionButtonSmallStyle"
19-
android:layout_width="wrap_content"
20-
android:layout_height="wrap_content"
21-
android:alpha="@dimen/mini_fab_opacity"
22-
android:contentDescription="@string/cancel"
23-
android:hapticFeedbackEnabled="false"
24-
android:padding="@dimen/between_row_padding"
25-
app:backgroundTint="?attr/colorOnSurface"
26-
app:elevation="@dimen/bottom_navbar_elevation"
27-
app:layout_constraintBottom_toTopOf="@id/homeCard"
28-
app:layout_constraintEnd_toEndOf="parent"
29-
app:layout_constraintStart_toStartOf="parent"
30-
app:layout_constraintTop_toTopOf="@id/homeCard"
31-
app:rippleColor="?attr/colorPrimary"
32-
app:srcCompat="@drawable/ic_arrow_up_24dp"
33-
app:tint="?attr/colorPrimary" />
34-
3516
<com.google.android.material.card.MaterialCardView
3617
android:id="@+id/homeCard"
3718
android:layout_width="0dp"
@@ -294,4 +275,23 @@
294275
app:layout_constraintStart_toStartOf="parent"
295276
app:layout_constraintTop_toBottomOf="@id/homeCard" />
296277

278+
<Button
279+
android:id="@+id/homeMiniFab"
280+
style="@style/Widget.Material3Expressive.Button.IconButton.Outlined"
281+
android:layout_width="wrap_content"
282+
android:layout_height="wrap_content"
283+
android:hapticFeedbackEnabled="false"
284+
app:backgroundTint="?attr/colorSurface"
285+
app:elevation="@dimen/bottom_navbar_elevation"
286+
app:icon="@drawable/ic_arrow_up_24dp"
287+
app:iconTint="?attr/colorPrimary"
288+
app:layout_constraintBottom_toTopOf="@id/homeCard"
289+
app:layout_constraintEnd_toEndOf="parent"
290+
app:layout_constraintStart_toStartOf="parent"
291+
app:layout_constraintTop_toTopOf="@id/homeCard"
292+
app:rippleColor="?attr/colorSecondary"
293+
app:strokeColor="?attr/colorOutline"
294+
app:strokeWidth="@dimen/card_stroke" />
295+
296+
297297
</androidx.constraintlayout.motion.widget.MotionLayout>

0 commit comments

Comments
 (0)