h6ah4i / android-materialshadowninepatch

Provides 9-patch based drop shadow for view elements. Works on API level 9 or later.
Apache License 2.0
481 stars 65 forks source link

Not work in recycle view #12

Open progfiles opened 8 years ago

progfiles commented 8 years ago

I use shadow for expand layout int RecycleView

<com.andexert.expandablelayout.library.ExpandableLayout android:id="@+id/expandableLine" xmlns:expandable="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" expandable:el_headerLayout="@layout/header_museum" expandable:el_contentLayout="@layout/content_museum"

     />
pishguy commented 8 years ago

I dont have problem, this is my 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:orientation="vertical">

    <com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView
        android:id="@+id/shadow_item_container"
        style="@style/ms9_DefaultShadowStyle"
        android:layout_width="wrap_content"
        android:layout_height="80dp"
        app:ms9_shadowElevation="6dp"
        app:ms9_shadowTranslationZ="-2dp">

        <LinearLayout
            android:id="@+id/simcard_lists_root"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="5dp"
            android:layout_marginLeft="4dp"
            android:layout_marginRight="4dp"
            android:layout_marginTop="5dp"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_marginBottom="5dp"
                    android:layout_marginLeft="5dp"
                    android:layout_marginRight="5dp"
                    android:layout_marginTop="5dp"
                    android:layout_weight="1"
                    android:orientation="horizontal">

                    <LinearLayout
                        android:id="@+id/payment_view"
                        android:layout_width="100dp"
                        android:layout_height="match_parent"
                        android:layout_gravity="center"
                        android:orientation="vertical">

                        <com.pishguy.androidapplication.simcardappliaction.Widgets.FontFitTextView
                            android:id="@+id/simcard_cost"
                            android:layout_width="match_parent"
                            android:layout_height="0dp"
                            android:layout_weight="1"
                            android:background="#b868c5"
                            android:gravity="center"
                            android:singleLine="true"
                            android:textColor="#ffffff"
                            android:textSize="18sp"/>

                        <com.pishguy.androidapplication.simcardappliaction.Widgets.FontFitTextView
                            android:id="@+id/buy_simcard"
                            android:layout_width="match_parent"
                            android:layout_height="0dp"
                            android:layout_marginTop="3dp"
                            android:layout_weight="1"
                            android:background="#f74036"
                            android:gravity="center"
                            android:singleLine="true"
                            android:text="@string/by_simcard"
                            android:textColor="#ffffff"
                            android:textSize="18sp"/>
                    </LinearLayout>

                    <View
                        android:id="@+id/buy_divider"
                        android:layout_width="1dp"
                        android:layout_height="match_parent"
                        android:layout_marginLeft="5dp"
                        android:layout_marginRight="5dp"
                        android:background="@drawable/gradient_login_window_seperator"/>

                    <TextView
                        android:id="@+id/simcard_number"
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:layout_weight="0.80"
                        android:gravity="center"
                        android:textColor="#000000"
                        android:textSize="20sp"/>

                    <TextView
                        android:id="@+id/simcard_code"
                        android:layout_width="50dp"
                        android:layout_height="50dp"
                        android:layout_gravity="center"
                        android:layout_margin="5dp"
                        android:background="@drawable/shape_simcard_type"
                        android:gravity="center"
                        android:textColor="#992b6b"
                        android:textSize="30sp"/>
                </LinearLayout>

                <View
                    android:id="@+id/textView"
                    android:layout_width="match_parent"
                    android:layout_height="2dp"
                    android:background="#b868c5"/>
            </LinearLayout>

        </LinearLayout>

    </com.h6ah4i.android.materialshadowninepatch.MaterialShadowContainerView>

    <FrameLayout
        android:id="@+id/sale"
        android:layout_width="match_parent"
        android:layout_height="75dp">

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

            <TextView
                android:id="@+id/sale_name"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="right|center"
                android:paddingRight="10dp"
                android:textColor="#000000"/>

            <TextView
                android:id="@+id/this_number"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="left|center"
                android:paddingLeft="10dp"
                android:textColor="#000000"
                android:textSize="20sp"/>

        </LinearLayout>
    </FrameLayout>

</FrameLayout>