Manabu-GT / ExpandableTextView

Android's TextView that can expand/collapse like the Google Play's app description
Apache License 2.0
4.08k stars 791 forks source link

In RelativeLayout ,one view below of ExpandableTextView cause dislocation #49

Open fanmingyi opened 7 years ago

fanmingyi commented 7 years ago

a

My English is not good,Hope you help thank you very much

fanmingyi commented 7 years ago
<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"

    xmlns:expandableTextView="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="5dp"
    tools:context="carton.fmy.com.yuanmanhua.fragment.CatalogueFragment">

    <android.support.v7.widget.CardView
        android:id="@+id/card_vwiew"
        android:layout_width="170dp"
        android:layout_height="210dp"
        android:layout_gravity="center_horizontal"
        android:layout_margin="10dp"
        app:cardCornerRadius="10dp"
        app:cardElevation="15dp">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <ImageView
                android:id="@+id/iv_show"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_centerInParent="true"
                android:paddingTop="10dp"
                android:scaleType="fitCenter" />

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                android:background="#fff">

                <TextView

                    android:id="@+id/tv_show"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:maxEms="14"
                    android:maxLines="1"
                    android:text="动漫标题" />
            </FrameLayout>

        </RelativeLayout>

    </android.support.v7.widget.CardView>

    <TextView
        android:id="@+id/tv_author"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:layout_marginTop="20dp"
        android:layout_toRightOf="@id/card_vwiew"
        android:text="作者:XXXX"
        android:textSize="@dimen/catalogue_text_size" />

    <TextView
        android:id="@+id/tv_status"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/tv_author"
        android:layout_marginLeft="15dp"
        android:layout_marginTop="15dp"
        android:layout_toRightOf="@id/card_vwiew"
        android:text="状态:"
        android:textSize="@dimen/catalogue_text_size" />

    <TextView
        android:id="@+id/tv_status2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/tv_author"
        android:layout_marginTop="15dp"
        android:layout_toRightOf="@id/tv_status"
        android:text="连载中"
        android:textSize="@dimen/catalogue_text_size" />

    <TextView
        android:id="@+id/tv_classify1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/tv_status"
        android:layout_marginLeft="15dp"
        android:layout_marginTop="15dp"
        android:layout_toRightOf="@id/card_vwiew"
        android:text="分类:"
        android:textSize="@dimen/catalogue_text_size" />

    <TextView
        android:id="@+id/tv_classify2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/tv_status"
        android:layout_marginTop="15dp"
        android:layout_toRightOf="@id/tv_status"
        android:text="爱情/宅系/轻小说"
        android:textSize="@dimen/catalogue_text_size" />

    <TextView
        android:id="@+id/tv_ranking"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/tv_classify2"
        android:layout_marginLeft="15dp"
        android:layout_marginTop="15dp"
        android:layout_toRightOf="@id/card_vwiew"
        android:text="排名:"
        android:textSize="@dimen/catalogue_text_size" />

    <TextView
        android:id="@+id/tv_ranking2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/tv_classify2"
        android:layout_marginTop="15dp"
        android:layout_toRightOf="@id/tv_status"
        android:text="123456"
        android:textSize="@dimen/catalogue_text_size" />

    <!--顶部书名 和图片结束-->

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_below="@id/card_vwiew"
        android:layout_marginTop="5dp"
        android:background="#6000" />

    <!--开始简介-->
    <TextView

        android:id="@+id/introduction"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/card_vwiew"
        android:layout_marginTop="10dp"
        android:text="简介:"
        android:textSize="20sp" />

    <!-- sample xml -->
    <com.ms.square.android.expandabletextview.ExpandableTextView

        android:id="@+id/expand_text_view"
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:layout_below="@id/introduction"
        expandableTextView:maxCollapsedLines="2"
        expandableTextView:animDuration="200">
        <TextView
            android:id="@id/expandable_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:textSize="16sp"
            android:textColor="#666666" />
        <ImageButton
            android:id="@id/expand_collapse"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:padding="16dp"
            android:layout_gravity="right|bottom"
            android:background="@android:color/transparent"/>
    </com.ms.square.android.expandabletextview.ExpandableTextView>

    <!--<com.ms.square.android.expandabletextview.ExpandableTextView-->
  <!--android:id="@+id/info"-->
        <!--android:layout_width="match_parent"-->
        <!--android:layout_height="wrap_content"-->
        <!--android:layout_below="@id/introduction"-->
        <!--app:maxCollapsedLines="2"-->
        <!--&gt;-->
        <!--<TextView-->
            <!--android:id="@id/expandable_text"-->
            <!--android:layout_width="match_parent"-->
            <!--android:layout_height="wrap_content"-->
            <!--android:layout_marginLeft="10dp"-->
            <!--android:layout_marginRight="10dp"-->
            <!--android:fontFamily="sans-serif-light"-->
            <!--android:textSize="16sp"-->
            <!--android:textColor="#666666" />-->

        <!--<ImageButton-->
            <!--android:id="@id/expand_collapse"-->
            <!--android:layout_width="wrap_content"-->
            <!--android:layout_height="wrap_content"-->
            <!--android:layout_margin="5dp"-->
            <!--android:layout_gravity="right|bottom"-->
            <!--android:background="@android:color/transparent"/>-->
    <!--</com.ms.square.android.expandabletextview.ExpandableTextView>-->

    <View
        android:id="@+id/view_line"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_below="@id/expand_text_view"
        android:layout_marginTop="5dp"
        android:background="#6000" />

    <FrameLayout
        android:id="@+id/mulu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/view_line"
        android:layout_marginTop="10dp">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="目录:"
            android:textSize="20sp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="right|center_vertical"
            android:text="点击目录,或上下滑动选择即可阅读"
            android:textSize="10sp" />
    </FrameLayout>

    <View
        android:id="@+id/view_linemulu"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_below="@id/mulu"
        android:layout_marginTop="5dp"
        android:background="#6000" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/view_linemulu"
        android:layout_marginTop="5dp" />

</RelativeLayout>
fanmingyi commented 7 years ago

Very happy to meet you in this platform, I am from China, was a 16 years old children, please forgive me such a childish question

Dovar66 commented 7 years ago

16岁不小了吖