ScrollView фиксированная высота прокрутки - PullRequest
0 голосов
/ 24 марта 2020

Я использую ScrollView в моем android проекте. С ScrollView я использую два ExpandableCardView . Просто под ScrollView есть две ExtendedFAB кнопки, которые я использую. Ниже приведено изображение макета.

enter image description here

Я хочу, чтобы макет работал например, когда я раскрываю Аналитика заказов или Мотивация аналитики или оба, кнопка должна двигаться вдоль дна, так как высота ограниченного контейнера увеличивается, но кнопка не должна уходить снизу, чтобы стать наполовину видимой Я хочу тот сценарий, в котором, когда две кнопки достигают нижнего конца в результате расширения ограниченного контейнера высоты из-за расширения Аналитика заказов и Мотивация аналитики , содержимое внутри Граничного контейнера должно прокручиваться в этот момент. Я не хочу, чтобы кнопки проходили через дно из-за расширения Bor контейнер dered . Мне не удалось найти решение. Вот код моего 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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".Fragment.WorkerAnalyticsFragment"
    android:background="@color/uniform_background">

    <LinearLayout
        android:id="@+id/profile_container"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="@dimen/profile_container_margin_top">

        <de.hdodenhof.circleimageview.CircleImageView
            android:id="@+id/circle_image_view_large"
            android:layout_width="@dimen/circle_image_view_large_width"
            android:layout_height="@dimen/circle_image_view_large_height"
            android:src="@drawable/example_avatar"
            android:layout_gravity="center_horizontal"/>

        <androidx.appcompat.widget.AppCompatTextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/text_view_profile_name"
            android:maxLines="1"
            android:layout_gravity="center_horizontal"
            style="@style/UniformTextAppearance"/>

    </LinearLayout>

    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <ScrollView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:overScrollMode="ifContentScrolls">

            <LinearLayout
                android:id="@+id/analytics_container"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="@dimen/analytics_container_margin"
                android:orientation="vertical"
                android:padding="@dimen/analytics_container_padding"
                android:background="@drawable/container_background">

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

                    <TextView
                        android:id="@+id/text_view_current_order_status_text"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/text_view_current_order_status_text"
                        android:textStyle="bold"
                        style="@style/UniformTextAppearance"/>

                    <com.kofigyan.stateprogressbar.StateProgressBar
                        android:id="@+id/your_state_progress_bar_id"
                        android:layout_marginTop="@dimen/step_view_margin_top"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        app:spb_maxStateNumber="four"
                        app:spb_stateDescriptionSize="@dimen/sbp_state_description_text_size"
                        app:spb_maxDescriptionLines="1"
                        app:spb_stateBackgroundColor="@color/spb_state_background_color"
                        app:spb_stateForegroundColor="@color/spb_state_foreground_color"

                app:spb_descriptionTopSpaceIncrementer="@dimen/spb_description_top_Space_incrementer"
                    app:spb_currentStateDescriptionColor="@color/spb_current_state_description_color"
                    app:spb_stateDescriptionColor="@color/spb_state_description_color"
                    app:spb_stateNumberBackgroundColor="@color/spb_state_number_background_color"/>

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/profile_analytics_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:layout_marginTop="@dimen/profile_container_margin_top">

                    <TextView
                        android:id="@+id/text_view_worker_analytics"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="@string/text_view_worker_analytics_text"
                        android:textStyle="bold"
                        style="@style/UniformTextAppearance"/>

                    <include layout="@layout/card_view_analytics_container"/>

                </LinearLayout>

            </LinearLayout>

        </ScrollView>

    </FrameLayout>

    <include layout="@layout/order_and_report_buttons" />

</LinearLayout>
...