1

I don't know why there is a ripple effect even in the resting state of my FAB(FloatingActionButton). This is how it looks: Inappropriate FAB

This is my implementation in xml:

<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:src="@drawable/white_plus"
    android:id="@+id/plusIcon"
    android:padding="0dp"
    app:pressedTranslationZ="12dp"
    app:elevation="6dp"
    app:paddingEnd="0dp"
    app:paddingStart="0dp"
    android:clickable="true"/>
Sid
  • 1,270
  • 2
  • 15
  • 30

2 Answers2

1

This problem was coming because I had set the colorAccent to #af18cccc and, hence, it was not completely opaque. After changing the colorAccent to #ff18cccc, it was working perfectly. For bringing the transparency effect, I called setAlpha(0.8) from the java code. Now, it works like a charm! :)

Sid
  • 1,270
  • 2
  • 15
  • 30
1

In addition to Sid's answer, you can also call

android:alpha = "0.8" 

directly in XML.

LW001
  • 2,452
  • 6
  • 27
  • 36