This simple piece of code won't work as intended with proguard enabled:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/show"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginTop="40dp"
android:text="Show snackbar" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_margin="16dp"
android:src="@drawable/ic_save_white_24dp"
app:layout_anchorGravity="bottom|right|end" />
</android.support.design.widget.CoordinatorLayout>
Desired behavior is having FloatingActionButton
pushed over SnackBar
when it is shown, but it doesn't happen until I disable proguard.
No tutorial also covers this as the new projects has proguard disabled by default ;)
Does anybody know the proguard configuration for Design Support Library?
Try this:
# support design
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }
Google has fixed this bug with embedded ProGuard configuration in the AAR. Just update the design library dependency to 23+ in build.gradle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With