У меня есть ListView и пользовательский макет элемента, который состоит только из TextView и кнопки. Фактический ListView работает нормально, но он выглядит по-разному на разных устройствах, на которых я тестирую.
На моем устройстве Android 8.0 текст темно-серый, но на моем устройстве 6.0 текст светло-серый и едва заметен на белом фоне моей Активности. Кроме того, цвета кнопок также меняются на этом устройстве, с темным текстом на светлой кнопке в 8.0 и наоборот в 6.0.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cell_peer"
android:descendantFocusability="blocksDescendants"
android:padding="3dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<TextView
android:id="@+id/text_peer_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="TextView"
tools:text="@tools:sample/full_names" />
<Button
android:id="@+id/button_call_peer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="Call"
app:layout_constraintEnd_toEndOf="parent"
/>
</RelativeLayout>
Manifest:
<activity android:name=".activities.FriendsListActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="Call a friend"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
></activity>
Я могу достаточно легко решить проблему контраста текста, установив android:textColor="@color/color_callable_peer_name"
в TextView, но у меня вопрос: почему этот текст по умолчанию использует разные цвета на разных платформах?