单击选项滚动ListView到footerview内的特定布局

时间:2017-04-05 10:10:48

标签: android listview android-fragments scrollview

我有一个Fragment我在其中有一个ListView并且在底部有一个粘贴按钮。 Listview有一个固定的页眉和页脚。在页脚视图中,当我选择一个选项时,将显示一个表单。在那个到期日Textview就是那个点击一个自定义日历展开和折叠。我想滚动Listview直到那个日历底部结束,但问题是我设置了 android:windowSoftInputMode =“adjustPan”,这样当我的软键盘输入时我的按键不会出现打开。因此,我无法滚动Scrollview页脚视图表单,无法滚动到日历的底部。

任何人都可以帮助我吗?提前谢谢。

片段xml

    <?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:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/application_background">
    <ListView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:id="@+id/card_list"
        android:fadingEdgeLength="0dp"
        android:scrollbars="none"
        android:headerDividersEnabled="false"
        android:footerDividersEnabled="false"
        android:transcriptMode="alwaysScroll" />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:orientation="horizontal"
        android:id="@+id/ll_footer"
        android:gravity="center"
        android:background="@color/colorIndicatorFill">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Pay 250"
            android:textColor="@color/white"
            android:id="@+id/txt_pay"
            android:gravity="center"
            android:textSize="@dimen/fontsize_txtview_18" />
    </LinearLayout>
</LinearLayout>

Footerview xml

<?xml version="1.0" encoding="utf-8"?>
<ScrollView 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:fillViewport="true"
    android:isScrollContainer="false"
    android:id="@+id/scrollView">
    <LinearLayout 
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/ll_footer_card"
        android:padding="10dp">
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:orientation="horizontal"
            android:id="@+id/rl_or">
            <TextView
                android:id="@+id/txt_or"
                android:textSize="@dimen/fontsize_txtview_16"
                android:singleLine="true"
                android:text="@string/or"
                android:gravity="center"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:textColor="@color/colorActiveIndicator"/>
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/size_1"
                android:layout_centerVertical="true"
                android:paddingLeft="@dimen/size_10"
                android:layout_toLeftOf="@id/txt_or"
                android:background="@color/gray_light" />
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/size_1"
                android:layout_centerVertical="true"
                android:paddingRight="@dimen/size_10"
                android:layout_toRightOf="@id/txt_or"
                android:background="@color/gray_light" />
        </RelativeLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:id="@+id/ll_choose_other_card">
            <TextView
                android:layout_width="0dp"
                android:layout_weight="0.9"
                android:layout_height="wrap_content"
                android:text="@string/choose_other_card"
                android:id="@+id/txt_add_new_card"
                android:textSize="@dimen/fontsize_txtview_16"
                android:textColor="@color/colorActiveIndicator"/>
            <RadioButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/radio_add_new_crad"
                style="@style/RadioButton" />
        </LinearLayout>
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:id="@+id/ll_card_detail_form">
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/size_10"/>
            <LinearLayout
                android:layout_width="wrap_content"
                android:gravity="center"
                android:layout_gravity="center"
                android:id="@+id/ll_scan_card"
                android:layout_height="wrap_content"
                android:background="@drawable/round_corner_light_green">
                <ImageView
                    android:layout_width="40dp"
                    android:layout_height="40dp"
                    android:src="@drawable/cards"
                    android:id="@+id/iv_card"
                    android:scaleType="centerInside"/>
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/scan_card"
                    android:textSize="@dimen/fontsize_txtview_16"
                    android:textColor="@color/color_white"
                    android:id="@+id/txt_scan_card"/>
            </LinearLayout>
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/size_10"/>
            <View
                android:layout_width="@dimen/size_300"
                android:layout_gravity="center"
                style="@style/DividerBottomLine"/>
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/size_10"/>
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/edt_card_number"
                android:hint="@string/hint_card_number"
                android:singleLine="true"
                android:digits=" 1234567890"
                android:inputType="number"
                android:maxLength="23"
                android:textColor="@color/text_color"
                android:textColorHint="@color/hint_color"
                android:textSize="@dimen/fontsize_edttext"
                android:background="@drawable/edt_background" />
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/size_10"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/edt_expiry"
                android:hint="@string/hint_expiry"
                android:singleLine="true"
                android:inputType="none"
                android:imeOptions="actionNext"
                android:textColor="@color/text_color"
                android:textColorHint="@color/hint_color"
                android:textSize="@dimen/fontsize_edttext"
                android:background="@drawable/edt_background" />
            <net.cachapa.expandablelayout.ExpandableLayout
                android:id="@+id/expandable_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:el_duration="500"
                app:el_expanded="false">
                <LinearLayout  android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:gravity="center"
                    android:id="@+id/ll_datePicker"
                    android:animateLayoutChanges="true"
                    android:orientation="vertical">
                    <LinearLayout
                        android:id="@+id/main_layout"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@color/application_background"
                        android:orientation="vertical" >
                        <LinearLayout
                            android:id="@+id/layout_choose"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:gravity="center"
                            android:orientation="horizontal" >
                            <kankan.wheel.widget.WheelView
                                android:id="@+id/wheel_month"
                                android:layout_width="0dp"
                                android:layout_weight="0.5"
                                android:background="@color/white"
                                android:layout_height="wrap_content" />
                            <kankan.wheel.widget.WheelView
                                android:id="@+id/wheel_year"
                                android:layout_width="0dp"
                                android:layout_weight="0.5"
                                android:background="@color/white"
                                android:layout_height="wrap_content" />
                        </LinearLayout>
                        <widget.RippleView
                            android:id="@+id/ripple_confirm"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:gravity="center"
                            app:rv_centered="true"
                            app:rv_color="@color/white"
                            app:rv_type="simpleRipple" >
                            <TextView
                                android:id="@+id/txt_confirm"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="center"
                                android:background="@drawable/round_corner_light_green"
                                android:text="@string/btn_Done"
                                android:textColor="@color/color_white"
                                android:textSize="@dimen/fontsize_txtview_18" />
                        </widget.RippleView>
                    </LinearLayout>

                </LinearLayout>
            </net.cachapa.expandablelayout.ExpandableLayout>
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/size_10"/>
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/edt_cvv"
                android:hint="@string/hint_cvv"
                android:singleLine="true"
                android:imeOptions="actionNext"
                android:inputType="number"
                android:maxLength="4"
                android:textColor="@color/text_color"
                android:textColorHint="@color/hint_color"
                android:textSize="@dimen/fontsize_edttext"
                android:background="@drawable/edt_background" />
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/size_10"/>
            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/edt_name_on_card"
                android:hint="@string/hint_name_on_card"
                android:singleLine="true"
                android:maxLength="100"
                android:textColor="@color/text_color"
                android:textColorHint="@color/hint_color"
                android:textSize="@dimen/fontsize_edttext"
                android:imeOptions="actionDone"
                android:background="@drawable/edt_background" />
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/size_10"/>
            <CheckBox
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/chk_save_card"
                android:textColor="@color/text_color"
                style="@style/Checkbox"
                android:textSize="@dimen/fontsize_edttext"
                android:text="@string/save_card" />
            <View
                android:layout_width="match_parent"
                android:layout_height="@dimen/size_10"/>
        </LinearLayout>
    </LinearLayout>
</ScrollView>

0 个答案:

没有答案
相关问题