2

I am not able to remove those dark circle background from floating action button. By default it has a circle button with above circular shade. but some how couldnt find a way to remove that shade.

enter image description here

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" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".VoipActivity"
android:id="@+id/VOIP_username">





<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="179dp"
    android:layout_height="185dp"
    android:layout_gravity="bottom|end"
    android:layout_marginBottom="8dp"
    android:layout_marginEnd="8dp"
    android:layout_marginStart="8dp"
    android:layout_marginTop="8dp"
    app:backgroundTint="@android:color/transparent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.502"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.844"
    app:rippleColor="?attr/colorBackgroundFloating"
    app:srcCompat="@drawable/preview" />[![enter image description here][1]][1]
1
  • 1
    try android:outlineProvider="none". Commented Oct 3, 2019 at 13:17

1 Answer 1

1

You can use android:outlineProvider="none".

Also, if you are using FloatingActionButton provided by the Material Components Library you can use a square fab just using the app:shapeAppearanceOverlay attribute.

Something like:

  <com.google.android.material.floatingactionbutton.FloatingActionButton 
          app:srcCompat="@android:drawable/..."
          app:shapeAppearanceOverlay="@style/SquareFabShapeOverlay"
          ../>

And in the style:

      <style name="SquareFabShapeOverlay" parent="ShapeAppearanceOverlay.MaterialComponents.FloatingActionButton">
        <item name="cornerSize">0dp</item>
      </style>

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.