Hector
Hector

Reputation: 5356

How do you make selectableItemBackgroundBorderless visible over black background?

I am developing an Android application with numerous clickable elements positioned on the main screen.

I have used the following for each of my clickable screen UI elements

android:background="?attr/selectableItemBackgroundBorderless"

My main screen has an entirely black background which is preventing the borderless "Ripple" from being seen.

If I change my background to

android:background="@android:color/transparent"

I can clearly see the required "Ripple".

How do I make the "Ripple" visible over a black background?

My theme is defined as follows:-

<resources>

    <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@android:color/white</item>
        <item name="colorPrimaryDark">@android:color/white</item>
        <item name="colorAccent">#c9e0bb</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">false</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowIsTranslucent">true</item>

        <item name="android:textColor">@android:color/white</item>
        <item name="android:textColorHint">@android:color/white</item>
    </style>

</resources>

Upvotes: 1

Views: 504

Answers (1)

Fran&#231;ois Legrand
Fran&#231;ois Legrand

Reputation: 1223

Try this in UI element android:foreground="?attr/selectableItemBackgroundBorderless"

Upvotes: 1

Related Questions