I've made a Raspberry Pi 3 run my application on Android Things, but a lot of graphic elements are not properly displayed. I've a RecyclerView with a list of items whose layout include a CardView. The CardView is not correctly displayed, and it's replaced by a simple rectangle.
On ordinary Android devices everything works.
That is really strange, because Android Things is based on Android 7.0. Has anyone been able to display everything properly?
This is my item layout:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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="wrap_content"
android:background="@color/transparent">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:layout_marginTop="4dp"
android:background="@color/transparent"
app:cardBackgroundColor="@color/background_list"
app:cardCornerRadius="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/background_list"
android:orientation="vertical">
<FrameLayout
android:id="@+id/framelayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<LinearLayout
android:id="@+id/text_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/text_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageButton
android:id="@+id/more_actions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:layout_marginRight="5dp"
android:layout_weight="0"
android:background="@color/ap_transparent"
android:tint="@color/soft_grey"
android:visibility="visible"
app:srcCompat="@drawable/ic_more_vert_black_24dp" />
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left|center"
android:layout_marginRight="@dimen/text_margin"
android:layout_weight="1"
android:fontFamily="sans-serif-medium"
android:text="Test"
android:textAppearance="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" />
</LinearLayout>
<TextView
android:id="@+id/detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/text_margin"
android:layout_marginTop="5dp"
android:fontFamily="sans-serif"
android:text="Description test Description test Description test Description test Description test"
android:textAppearance="?attr/textAppearanceListItem"
android:textColor="@color/grey"
android:textSize="14sp"
android:visibility="visible" />
<TextView
android:id="@+id/last_sync"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/text_margin"
android:layout_marginTop="8dp"
android:fontFamily="sans-serif"
android:text="Last sync"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="italic"
android:visibility="visible" />
</LinearLayout>
<TextView
android:id="@+id/main_sensor_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0"
android:text="25°C"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
android:visibility="visible" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</FrameLayout>