I have added a selector to my layout which should add a white border when the layout is pressed. It works as expected but only works on Android 6.0 and older devices are not getting highlighted. I tried adding android:hardwareAccelerated="true" in the manifest, but that didn't make a difference.
Does anybody know why this doesn't work on older android versions?
Layout that gets highlighted
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:foreground="@drawable/selector">
Selector
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:drawable="@drawable/border_white_rounded" />
border
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/transparent" />
<stroke
android:width="3dp"
android:color="@color/color_white" />
<corners android:radius="3dp" />