Hide pentagon shaped form from ripple effect

45 Views Asked by At

I have the following layout:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <androidx.camera.view.PreviewView
        android:id="@+id/viewFinder"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />


    <com.google.android.material.button.MaterialButton
        android:id="@+id/btn_image_select"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_margin="20dp"
        app:icon="@drawable/baseline_photo_24"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        style="@style/MaterialIconButtonCircledDarkTransparentStyle"
        />


    <com.google.android.material.button.MaterialButton
        android:id="@+id/btn_image_capture"
        android:layout_width="75dp"
        android:layout_height="75dp"
        android:layout_margin="20dp"
        app:strokeWidth="2dp"
        app:strokeColor="@color/white"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        style="@style/MaterialIconButtonCircledLightTransparentStyle"
        />


</androidx.constraintlayout.widget.ConstraintLayout>

With the following style:

<style name="MaterialIconButtonCircledDarkTransparentStyle">
    <item name="android:insetLeft">0dp</item>
    <item name="android:insetTop">0dp</item>
    <item name="android:insetRight">0dp</item>
    <item name="android:insetBottom">0dp</item>
    <item name="iconPadding">0dp</item>
    <item name="iconGravity">textStart</item>

    <item name="background">@color/BlackTransparent</item>
    <item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlayMaterialIconButtonCircular</item>
</style>


<style name="MaterialIconButtonCircledLightTransparentStyle" parent="MaterialIconButtonCircledDarkTransparentStyle">
    <item name="android:backgroundTint">@color/LightGrayTransparent</item>
</style>

<style name="ShapeAppearanceOverlayMaterialIconButtonCircular" parent="">
    <item name="cornerFamily">rounded</item>
    <item name="cornerSize">50%</item>
</style>

<color name="LightGrayTransparent">#80C0C0C0</color>
<color name="BlackTransparent">#6A000000</color>

Which looks like this:

example

As you can see there is a random pentagon shaped style which is visible when I have a transparent backgroundTint. Any idea how I can hide the pentagon shaped form? I tried setting the ripple color to null and other options, but none of them worked unfourtantly.

0

There are 0 best solutions below