У меня возникли некоторые проблемы с моим стилем макета, на самом деле в Android 5.1.1 он работает нормально, и когда я нажимаю на RelativeLayout, текст на нем меняет цвет, так что кажется, что он выбран, и его приятно видеть.
В то время как в Android 7.0, когда RelativeLayout находится на OnClick или OnFocus, он приобретает ужасный оранжевый цвет, поэтому я хотел бы, чтобы он выглядел как в Android 5.1.1 ...
Вот мой код xml из этого представления
<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:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
tools:context=".MainActivity"
android:layout_marginBottom="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="UselessLeaf,UselessParent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
tools:ignore="InefficientWeight,ObsoleteLayoutParam,UselessLeaf"
android:baselineAligned="false">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/rellay_cassa"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_weight="0.65"
android:background="@color/blueLight"
android:clickable="true"
android:foreground="?attr/selectableItemBackground"
android:focusable="true"
tools:ignore="NestedWeights,ObsoleteLayoutParam">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
tools:ignore="UselessParent">
<ImageView
android:id="@+id/imgCassa"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true"
android:padding="8dp"
android:scaleType="centerInside"
android:src="@drawable/ic_cassa"
android:tint="@color/colorWhite"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imgCassa"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="CASSA"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/rellay_tasti"
android:layout_weight="0.55"
android:clickable="true"
android:background="@color/blueDark"
android:foreground="?attr/selectableItemBackground"
android:focusable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
tools:ignore="UselessParent">
<ImageView
android:id="@+id/imgTasti"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true"
android:padding="8dp"
android:scaleType="centerInside"
android:src="@drawable/ic_tasti"
android:tint="@color/colorWhite"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imgTasti"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="AGGIUNGI TASTI"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="0dp"
android:layout_weight="1"
android:baselineAligned="false"
tools:ignore="ObsoleteLayoutParam">
<RelativeLayout
android:id="@+id/rellay_articoli"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.55"
android:background="@color/blueDark"
android:clickable="true"
android:foreground="?attr/selectableItemBackground"
android:focusable="true"
tools:ignore="InefficientWeight,NestedWeights">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
tools:ignore="ObsoleteLayoutParam,UselessParent">
<ImageView
android:id="@+id/imgArticoli"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true"
android:padding="8dp"
android:scaleType="centerInside"
android:src="@drawable/ic_articoli"
android:tint="@color/colorWhite"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imgArticoli"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="AGGIUNGI ARTICOLI"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rellay_clienti"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/blueLight"
android:layout_weight="0.55"
android:clickable="true"
android:foreground="?attr/selectableItemBackground"
android:focusable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
tools:ignore="UselessParent">
<ImageView
android:id="@+id/imgClienti"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true"
android:padding="8dp"
android:scaleType="centerInside"
android:src="@drawable/ic_clienti"
android:tint="@color/colorWhite"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imgClienti"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="AGGIUNGI CLIENTI"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="0dp"
android:layout_weight="1"
tools:ignore="ObsoleteLayoutParam"
android:baselineAligned="false">
<RelativeLayout
android:id="@+id/rellay_settings"
android:layout_width="347dp"
android:layout_height="match_parent"
android:layout_weight="0.65"
android:background="@color/blueLight"
android:clickable="true"
android:foreground="?attr/selectableItemBackground"
tools:ignore="InefficientWeight,NestedWeights,UselessParent"
android:focusable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<ImageView
android:id="@+id/imgSettings"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true"
android:padding="8dp"
android:scaleType="centerInside"
android:src="@drawable/ic_settings"
android:tint="@color/colorWhite"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imgSettings"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="IMPOSTAZIONI"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="@+id/rellay_exit"
android:layout_width="331dp"
android:layout_height="match_parent"
android:layout_weight="0.55"
android:background="@color/red"
android:clickable="true"
android:foreground="?attr/selectableItemBackground"
android:focusable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
tools:ignore="UselessParent">
<ImageView
android:id="@+id/imgExit"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true"
android:padding="8dp"
android:scaleType="centerInside"
android:src="@drawable/ic_exit"
android:tint="@color/colorWhite"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imgExit"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="USCITA"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</RelativeLayout>