Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

android - Animated ExpandableListView in Scrollview

I am trying to implement Animated ExpandableListview in ScrollView layout. But when I expand some category then Scroll is not working. If any method for this then Please help me. Thanks in advance!

This is my xml code:

<ScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/nav_header_container"
        android:overScrollMode="never"
        android:scrollbars="none">

        <LinearLayout
            android:id="@+id/ll_scroll"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <LinearLayout
                android:id="@+id/ll_home_category"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/layout_press_color"
                android:orientation="horizontal"
                android:padding="@dimen/standard_padding">


                <ImageView
                    android:id="@+id/item_header_image"
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:layout_centerVertical="true"
                    android:src="@drawable/ic_home" />

                <com.vrin.sga.uc.TextView_Open_Sans_Light
                    android:id="@+id/txt_category"
                    style="@style/Normal_Textview_White"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginLeft="@dimen/standard_padding"
                    android:text="Home"
                    android:textColor="@color/black" />

            </LinearLayout>

            <View
                android:id="@+id/view"
                android:layout_width="260dp"
                android:layout_height="1dp"
                android:layout_below="@+id/ll_home_category"
                android:background="@color/line_seperator" />

            <com.vrin.sga.widget.AnimatedExpandableListView
                android:id="@+id/left_drawer"
                android:layout_width="260dp"
                android:layout_height="match_parent"
                android:layout_below="@+id/view"
                android:layout_gravity="start"
                android:childDivider="@null"
                android:choiceMode="singleChoice"
                android:divider="@null"
                android:groupIndicator="@null"
                android:listSelector="@drawable/selector_category"
                android:overScrollMode="never"
                android:scrollbars="none"/>

            <View
                android:id="@+id/view_seperator"
                android:layout_width="fill_parent"
                android:layout_height="1dp"
                android:layout_below="@+id/left_drawer"
                android:layout_marginBottom="10dp"
                android:background="@color/line_seperator"
                android:orientation="horizontal" />

            <LinearLayout
                android:id="@+id/ll_categories"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="@color/light_black">

                <com.vrin.sga.uc.TextView_Open_Sans_Light
                    android:id="@+id/txtCategory"
                    style="@style/Normal_Textview_White"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="3dp"
                    android:padding="8dp"
                    android:text="@string/category"
                    android:textAllCaps="true" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/ll_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical" />
        </LinearLayout>
    </ScrollView>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

use this method hope it may helps you out..!

left_drawer.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            v.getParent().requestDisallowInterceptTouchEvent(true);
            return false;
        }
    });

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...