'I am using a scroll view that hides my toolbar while scrolling, I don't want my toolbar to hide while scrolling

I am making a register screen, that has a toolbar on top of it. When I scroll down the toolbar hides(goes up). I don't want my toolbar to scroll when I am scrolling. I don't want to use adjust resize or adjust pan because then the other parts then don't work correctly. I tried with appbar but it doesn't work. PS I hided some of my edit texts in body. Here is my design code

<layout 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">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/register_background"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:fitsSystemWindows="true"
        tools:context=".architecture.fragments.login.SignupFragment">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/flutra"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <ImageButton
                android:id="@+id/back_button_signup"
                android:layout_width="35dp"
                android:layout_height="35dp"
                android:layout_marginStart="15dp"
                android:background="@drawable/grey_ellipse_back_button_shape"
                android:src="@drawable/ic_backbutton_with_arrow" />
        </androidx.appcompat.widget.Toolbar>

        <androidx.constraintlayout.widget.Guideline
            android:id="@+id/guideline2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            app:layout_constraintGuide_percent="0.3" />

        <androidx.core.widget.NestedScrollView
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:clickable="true"
            android:fillViewport="true"
            android:fitsSystemWindows="true"
            android:focusableInTouchMode="true"
            android:orientation="vertical"
            android:overScrollMode="never"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/guideline2">

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

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/content"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:clipChildren="false"
                    android:clipToPadding="false">

                    <eightbitlab.com.blurview.BlurView
                        android:id="@+id/blurView"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginStart="-1dp"
                        android:layout_marginTop="47dp"
                        android:layout_marginEnd="-1dp"
                        android:layout_marginBottom="-20dp"
                        android:background="@drawable/background_with_radius"
                        android:paddingBottom="40dp"
                        app:blurOverlayColor="@color/overlay_color"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent">

                        <androidx.constraintlayout.widget.ConstraintLayout
                            android:id="@+id/blur_content"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"

                            android:clipChildren="false"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintEnd_toEndOf="parent"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toTopOf="parent">

                            <TextView
                                android:id="@+id/signup_tv"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="56dp"
                                android:fontFamily="@font/inter"
                                android:text="@string/sign_up"
                                android:textColor="@color/white"
                                android:textSize="21sp"
                                android:textStyle="bold"
                                app:layout_constraintEnd_toEndOf="parent"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toTopOf="@id/blur_content" />

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:clipChildren="false"
                                android:clipToPadding="false"
                                android:gravity="center"
                                android:orientation="vertical"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintEnd_toEndOf="parent"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toBottomOf="@id/signup_tv">

                                <EditText
                                    android:id="@+id/first_name_et"
                                    style="@style/EditText"
                                    android:layout_width="match_parent"
                                    android:layout_height="45dp"
                                    android:layout_marginStart="16dp"
                                    android:layout_marginTop="18dp"
                                    android:layout_marginEnd="16dp"
                                    android:background="@drawable/edittext_radius"
                                    android:hint="@string/first_name"
                                    android:maxLines="1"
                                    android:paddingStart="15dp"
                                    android:paddingEnd="15dp"
                                    android:singleLine="true"
                                    android:textColor="@color/white"
                                    android:textColorHint="@color/text_light_color" />

                                <EditText
                                    android:id="@+id/enter_email_et"
                                    style="@style/EditText"
                                    android:layout_width="match_parent"
                                    android:layout_height="45dp"
                                    android:layout_marginStart="16dp"
                                    android:layout_marginTop="16dp"
                                    android:layout_marginEnd="16dp"
                                    android:background="@drawable/edittext_radius"
                                    android:hint="@string/email"
                                    android:inputType="textEmailAddress"
                                    android:maxLines="1"
                                    android:paddingStart="15dp"
                                    android:paddingEnd="15dp"
                                    android:singleLine="true"
                                    android:textColor="@color/white"
                                    android:textColorHint="@color/text_light_color" />

                                <EditText
                                    android:id="@+id/password_edit_text"
                                    style="@style/EditText"
                                    android:layout_width="match_parent"
                                    android:layout_height="45dp"
                                    android:layout_marginStart="16dp"

                                    android:layout_marginTop="16dp"
                                    android:layout_marginEnd="16dp"
                                    android:background="@drawable/edittext_radius"
                                    android:hint="@string/password"
                                    android:inputType="textPassword"
                                    android:paddingStart="15dp"
                                    android:paddingEnd="15dp"
                                    android:textColor="@color/white"
                                    android:textColorHint="@color/text_light_color" />


                                <com.google.android.material.button.MaterialButton
                                    android:id="@+id/register_button"
                                    style="@style/AccentButton"
                                    android:layout_width="match_parent"
                                    android:layout_height="45dp"
                                    android:layout_marginStart="16dp"
                                    android:layout_marginTop="24dp"
                                    android:layout_marginEnd="16dp"
                                    android:insetLeft="0dp"
                                    android:insetTop="0dp"
                                    android:insetRight="0dp"
                                    android:insetBottom="0dp"
                                    android:text="@string/sign_up" />

                            </LinearLayout>
                        </androidx.constraintlayout.widget.ConstraintLayout>

                    </eightbitlab.com.blurview.BlurView>

                    <ImageView
                        android:layout_width="95dp"
                        android:layout_height="95dp"
                        android:src="@drawable/ic_m_logo"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                </androidx.constraintlayout.widget.ConstraintLayout>
            </RelativeLayout>
        </androidx.core.widget.NestedScrollView>
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>```


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source