высота не показывает тень - PullRequest
0 голосов
/ 01 апреля 2020

У меня есть следующий видоискатель -

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="?android:attr/selectableItemBackground"
    android:clickable="true"
    android:focusable="true"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/main_app_start_end_margin_14dp"
        android:layout_marginTop="@dimen/main_app_top_margin_15dp"
        android:layout_marginEnd="@dimen/main_app_start_end_margin_14dp"
        android:orientation="horizontal">


        <com.makeramen.roundedimageview.RoundedImageView
            android:id="@+id/chats_list_viewholder_imageview"
            android:layout_width="55dp"
            android:layout_height="55dp"
            android:elevation="10dp"
            android:background="@color/white"
            android:src="@drawable/group_avatar"
            app:riv_corner_radius="12dp" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/main_app_start_end_margin_14dp"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/chats_list_viewholder_contact_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:fontFamily="@font/roboto_medium"
                    android:text="Chat Name"
                    android:textColor="@color/black"
                    android:textSize="16sp" />

                <Space
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1" />

                <TextView
                    android:id="@+id/chats_list_viewholder_chat_last_time_updated"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="10:20 AM" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="7dp"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/chats_list_viewholder_did_receive_and_read_image"
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:src="@drawable/verte_doublecheck_grey" />

                <TextView
                    android:id="@+id/chats_list_viewholder_last_message"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="7dp"
                    android:text="Last chat text message" />

                <Space
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1" />

                <ImageView
                    android:id="@+id/chats_list_viewholder_muted"
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:src="@drawable/chat_muted" />

                <ImageView
                    android:id="@+id/chats_list_viewholder_pinned"
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:layout_marginStart="7dp"
                    android:src="@drawable/chat_pinned" />

                <TextView
                    android:id="@+id/chats_list_viewholder_new_message_badge_counter"
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:layout_marginStart="7dp"
                    android:background="@drawable/textview_round_red"
                    android:fontFamily="@font/roboto_bold"
                    android:gravity="center"
                    android:paddingTop="1dp"
                    android:text="99"
                    android:textColor="@color/white"
                    android:textSize="12sp" />

            </LinearLayout>

        </LinearLayout>

    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="0.5dp"
        android:layout_marginStart="80dp"
        android:layout_marginTop="@dimen/main_app_top_margin_15dp"
        android:background="@color/list_divider_color" />

</LinearLayout>

* chats_list_viewholder_imageview имеет высоту, и эффект тени не работает хорошо

он реализует тень на ближнем линейном макете, а не на самом себе

Я перепробовал много вещей, добавляющих к моему макету root и макету root, содержащему обзор переработчика, и это не помогло

Я не могу понять, чего не хватает для добавления эффекта тени и видя возвышение

Почему это происходит?

...