Android layout refreshes when a picture of an ImageView is changed - android

I have a layout with a ScrollView.When I change the picture of an ImageView or Text of TextView, layout refreshes and screen goes to the top.I Think the problem is in ScrollView.
XML file:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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">
<ScrollView
android:id="#+id/sv2"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<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:background="#FFEEEEEE"
android:orientation="vertical"
android:padding="0dp"
tools:context="hamrahyper.rayanpejuhanparse.jamshidiasl.hamrahyper.Main3Activity">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFEEEEEE">
<EditText
android:id="#+id/editText3"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_alignParentTop="true"
android:layout_toEndOf="#+id/imageViewx"
android:layout_toRightOf="#+id/imageViewx"
android:background="#color/colorPrimary"
android:ems="10"
android:gravity="center"
android:hint="جستجو در همراهایپر"
android:inputType="textPersonName"
android:textColor="#android:color/background_light"
android:textColorHint="#android:color/background_light"
android:textSize="14sp"
app:layout_constraintEnd_toStartOf="#+id/imageView1"
app:layout_constraintStart_toEndOf="#+id/imageViewx"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignEnd="#+id/editText3"
android:layout_alignRight="#+id/editText3"
android:layout_alignTop="#+id/editText3"
android:background="#color/colorPrimary"
android:padding="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#mipmap/i1" />
<ImageView
android:id="#+id/imageViewx"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="#color/colorPrimary"
app:layout_constraintStart_toEndOf="#+id/imageView10"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#mipmap/icart2" />
<ViewFlipper
android:id="#+id/viewFlipper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:autoStart="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText3">
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
app:srcCompat="#mipmap/btn1" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
app:srcCompat="#mipmap/btn2" />
</ViewFlipper>
<TextView
android:id="#+id/textView16"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:gravity="right"
android:text="دسته بندی محصولات"
android:textColor="#android:color/background_dark"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/viewFlipper" />
<HorizontalScrollView
android:id="#+id/sc1"
android:layout_width="0dp"
android:layout_height="220dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView16">
<LinearLayout
android:id="#+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl1"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im1"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/im1"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="#+id/tv1"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl2"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im2"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/im2"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tv2"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl3"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im3"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/im3"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/tv3"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl4"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im4"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/im4"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tv4"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl5"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im5"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/im5"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tv5"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:elevation="5dp"
app:cardElevation="5dp">
<RelativeLayout
android:id="#+id/rl6"
android:layout_width="150dp"
android:layout_height="match_parent"
android:background="#android:color/background_light"
android:padding="5dp">
<ImageView
android:id="#+id/im6"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
app:srcCompat="#mipmap/icon1" />
<TextView
android:id="#+id/tv6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/im6"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/black"
android:textSize="14sp" />
<TextView
android:id="#+id/tx6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="#+id/tv6"
android:gravity="center_horizontal"
android:padding="5dp"
android:text="..."
android:textColor="#android:color/holo_green_dark"
android:textSize="12sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</HorizontalScrollView>
<ImageView
android:id="#+id/imageView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:adjustViewBounds="true"
android:scaleType="fitXY"
app:layout_constraintTop_toBottomOf="#+id/sc1"
app:srcCompat="#mipmap/btn5"
tools:layout_editor_absoluteX="0dp" />
<TextView
android:id="#+id/textView17"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:gravity="right"
android:text="پرفروش ترین محصولات"
android:textColor="#android:color/background_dark"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageView6" />
<TextView
android:id="#+id/textView19"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginStart="8dp"
android:layout_marginTop="2dp"
android:background="#mipmap/bdr3"
android:gravity="center"
android:paddingLeft="1dp"
android:paddingTop="1dp"
android:textColor="#android:color/background_dark"
android:textSize="10sp"
app:layout_constraintStart_toEndOf="#+id/imageView10"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/imageView10"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#color/colorPrimary"
android:paddingBottom="6dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingTop="6dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#mipmap/menuicon" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</ScrollView>
I think the problem is ScrollView, so I set a focusable property of ScrollView to false but the problem not resolved.What is wrong?

Add this line android:fillViewport="true"
<ScrollView
android:fillViewport="true">
</ScrollView>

Related

Recycler view items auto wrapping inside scrollview

I am a newbie to android. I have Recyclerview implemented inside NestedScrollView. When I press next everything works fine, but when I return to the previous item it just wraps itself.
I have tried everything possible to make it work.
Following is the code.
For the Next & previous question, on pressing respective the following code executes
QuizAttemptFragment.xml.
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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"
android:fillViewport="true"
tools:context=".view.fragments.QuizAttemptFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:descendantFocusability="beforeDescendants"
android:layout_width="match_parent"
android:id="#+id/clQuiz"
android:layout_height="match_parent">
<TextView
android:id="#+id/tvFeedBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="15dp"
android:fontFamily="#font/nunito_regular"
tools:text="Feedback"
android:gravity="center"
android:drawablePadding="4dp"
android:drawableStart="#drawable/ic_comment_black"
android:drawableTint="#color/blackColor"
android:textSize="14sp"
android:visibility="visible"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="#+id/tvAssignmentStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_marginTop="15dp"
android:fontFamily="#font/nunito_regular"
tools:text="Marked"
android:textSize="14sp"
android:textAllCaps="true"
android:visibility="invisible"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rvQuestionNum"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="47dp"
android:layout_marginEnd="16dp"
android:nestedScrollingEnabled="false"
android:orientation="horizontal"
tools:listitem="#layout/layout_num"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rvQuestionDet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:visibility="gone"
android:layout_marginEnd="16dp"
android:orientation="vertical"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ProgressBar
android:id="#+id/pbFragmentListLoading"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="56dp"
android:visibility="gone"
android:indeterminate="true"
android:indeterminateTint="#color/yellowThemeColor"
android:indeterminateTintMode="src_atop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.526"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/tvDur"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="93dp"
android:drawableStart="#drawable/ic_clock_blck"
android:drawablePadding="10dp"
android:fontFamily="#font/nunito_bold"
android:gravity="center_vertical"
android:text="DD:HH:MM"
android:textColor="#000000"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.089"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteY="98dp" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rvQuestionNew"
android:nestedScrollingEnabled="false"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:minHeight="300dp"
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toTopOf="#id/rlNav"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tvDur"
app:layout_constraintVertical_bias="0.0"
tools:listitem="#layout/user_question" />
<RelativeLayout
android:id="#+id/rlNav"
android:layout_width="match_parent"
android:layout_height="37dp"
android:layout_marginBottom="24dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent">
<TextView
android:id="#+id/tvBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:layout_alignParentStart="true"
android:drawablePadding="10dp"
android:drawableTint="#color/blackColor"
android:fontFamily="#font/nunito_regular"
android:gravity="center"
android:textAllCaps="true"
android:text="Previous"
android:textColor="#color/blackColor"
android:textSize="16sp"
android:visibility="invisible" />
<ImageButton
android:background="#android:color/transparent"
android:id="#+id/ibFlag"
android:visibility="visible"
android:layout_centerInParent="true"
android:src="#drawable/ic_flag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="#+id/tvNext"
android:layout_marginEnd="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:layout_alignParentEnd="true"
android:drawablePadding="10dp"
android:drawableTint="#color/blackColor"
android:fontFamily="#font/nunito_regular"
android:gravity="center"
android:textAllCaps="true"
android:text="Next"
android:textColor="#color/blackColor"
android:textSize="16sp"
android:visibility="visible" />
<androidx.cardview.widget.CardView
android:id="#+id/cvSubmit"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginEnd="5dp"
android:minWidth="80dp"
android:visibility="gone"
android:clickable="true"
android:padding="5dp"
android:layout_gravity="center"
android:layout_centerInParent="true"
android:layout_alignParentEnd="true"
app:cardCornerRadius="4dp">
<LinearLayout
android:id="#+id/llCard"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/tvBtnCreateAssignmentSubmit"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#584056"
android:clickable="true"
android:fontFamily="#font/nunito_regular"
android:text="Submit"
android:layout_gravity="center"
android:gravity="center"
android:textColor="#color/whiteColor"
android:textSize="16sp"
android:visibility="visible" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
layout_item.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:layout_marginBottom="5dp"
android:background="#fcfbfc"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/lblPoint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="4dp"
android:fontFamily="#font/nunito_light"
android:textColor="#color/blackColor"
android:textSize="12sp"
tools:text="10 Points" />
<RelativeLayout
android:id="#+id/rlheader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:visibility="visible"
>
<TextView
android:id="#+id/lblques"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerInParent="true"
android:layout_marginStart="1dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="4dp"
android:fontFamily="#font/nunito_light"
android:textColor="#color/blackColor"
android:textSize="14sp"
tools:text="15." />
<TextView
android:id="#+id/tvQuestion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginEnd="10dp"
android:fontFamily="#font/nunito_regular"
android:gravity="center_vertical"
android:layout_centerInParent="true"
android:layout_toStartOf="#+id/edPoint"
android:minLines="2"
tools:text="Who from the following is responsible for this question"
android:textSize="16sp"
android:scrollbars="vertical"
android:textColor="#color/blackColor" />
<TextView
android:id="#+id/tvPoint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerInParent="true"
android:layout_marginTop="10dp"
android:layout_marginEnd="4dp"
android:fontFamily="#font/nunito_light"
android:gravity="center"
android:visibility="gone"
android:minLines="1"
android:textColor="#color/blackColor"
android:textSize="16sp"
tools:text="/10" />
<EditText
android:id="#+id/edPoint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:visibility="gone"
android:layout_centerInParent="true"
android:fontFamily="#font/nunito_light"
android:gravity="center"
android:minLines="1"
android:inputType="number"
tools:text="100"
android:imeOptions="actionDone"
android:layout_toStartOf="#+id/tvPoint"
android:textSize="14sp"
android:textColor="#color/blackColor" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/rlAnswer"
android:layout_marginTop="5dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:elevation="5dp"
android:background="#drawable/shape_square"
android:layout_marginBottom="20dp"
android:minHeight="100dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:padding="10dp"
android:id="#+id/edAnswer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/nunito_regular"
android:gravity="top"
tools:text="assfadasffdsdfddfd"
android:layout_gravity="top"
android:textSize="16sp"
android:scrollbars="vertical"
android:textColor="#color/blackColor" />
</RelativeLayout>
<LinearLayout
android:id="#+id/llOptions"
android:orientation="vertical"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:clickable="false"
android:id="#+id/llOpt1"
android:orientation="horizontal"
android:layout_gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rbOpt1"
android:layout_marginEnd="#dimen/_10sdp"
android:layout_width="wrap_content"
android:clickable="false"
android:buttonTint="#color/darkGreyColor"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:clickable="false"
android:id="#+id/llOpt2"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rbOpt2"
android:layout_marginEnd="#dimen/_10sdp"
android:layout_width="wrap_content"
android:clickable="false"
android:buttonTint="#color/darkGreyColor"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="#+id/llOpt3"
android:clickable="false"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rbOpt3"
android:layout_marginEnd="#dimen/_10sdp"
android:layout_width="wrap_content"
android:clickable="false"
android:buttonTint="#color/darkGreyColor"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="#+id/llOpt4"
android:clickable="false"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="#+id/rbOpt4"
android:layout_marginEnd="#dimen/_10sdp"
android:layout_width="wrap_content"
android:clickable="false"
android:buttonTint="#color/darkGreyColor"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
<androidx.cardview.widget.CardView
app:cardCornerRadius="8dp"
android:id="#+id/cvDocPreview"
android:visibility="visible"
android:layout_marginTop="4dp"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/llCreateAssignmentParent1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/whiteColor"
android:gravity="center_vertical"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="#+id/cardImage"
app:cardElevation="0dp"
android:layout_width="#dimen/_60sdp"
android:layout_height="#dimen/_40sdp">
<ImageView
android:id="#+id/ivPreviewItem"
android:layout_width="match_parent"
android:layout_gravity="center"
android:layout_height="match_parent"
android:minHeight="60dp"
android:src="#drawable/ic_file_black"
android:background="#color/thumbnail_background"
android:adjustViewBounds="true"
android:scaleType="centerInside"/>
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_toRightOf="#+id/cardImage"
android:id="#+id/llFileUpload"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="40dp"
android:layout_marginBottom="5dp"
android:orientation="vertical">
<TextView
android:id="#+id/tvFileNameItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:letterSpacing="0.02"
android:ellipsize="end"
android:layout_marginEnd="5dp"
android:maxLines="1"
android:fontFamily="#font/nunito_bold"
android:lineSpacingExtra="0sp"
android:textColor="#000000"
android:textSize="14sp"
tools:text="Filename.ext" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/tvFileType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:letterSpacing="0.02"
android:textColor="#000000"
android:textSize="12sp"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginEnd="4dp"
android:fontFamily="#font/nunito_regular"
tools:text="File Type" />
<View
android:id="#+id/viewDivide"
android:layout_gravity="center"
android:background="#color/black_half"
android:layout_width="1dp"
android:layout_height="#dimen/_10sdp"/>
<TextView
android:id="#+id/tvFileSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:letterSpacing="0.02"
android:textColor="#000000"
android:textSize="12sp"
android:maxLines="1"
android:ellipsize="end"
android:layout_marginStart="4dp"
android:fontFamily="#font/nunito_regular"
android:text="24 mb" />
</LinearLayout>
</LinearLayout>
<ImageButton
android:padding="7dp"
android:layout_centerInParent="true"
android:layout_alignParentEnd="true"
android:visibility="visible"
android:id="#+id/ibDownloadItem"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="4dp"
android:background="#color/whiteColor"
android:tint="#color/blackColor"
android:src="#android:drawable/stat_sys_download" />
</RelativeLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
</androidx.cardview.widget.CardView>
<TextView
android:id="#+id/tvNotAttempted"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginEnd="4dp"
android:layout_gravity="center"
android:visibility="gone"
android:fontFamily="#font/nunito_light"
android:gravity="center"
android:text="Question not attempted"
android:minLines="1"
android:textColor="#color/redWarningColor"
android:textSize="16sp" />
<TextView
android:id="#+id/tvMandatory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_gravity="center"
android:visibility="gone"
android:fontFamily="#font/nunito_light"
android:gravity="center"
android:text="Mandatory Question*"
android:minLines="1"
android:textColor="#color/redWarningColor"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
Before Pressing Next
Returning to the previous item it just wraps views
Please help, I am stuck for 2 weeks

ListView showing only first element in NestedScrollView

I need to make a list in my NestedScrollView but showing only first element. I tried with android:fillViewport="true" but hothing happened. I know that ListView has scrollable incorporated in itself.
my xml :
<layout >
<data>
<variable
name="home"
type="com.nswd.successplan.ui.fragments.homeFragment.HomeViewModel" />
</data>
<androidx.core.widget.NestedScrollView
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:background="#f0f4f7"
android:fillViewport="true"
tools:context=".ui.fragments.homeFragment.HomeFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="#f0f4f7">
<TextView
android:id="#+id/dashboard_TV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:layout_marginBottom="25dp"
android:gravity="center"
android:text="Dashboard"
android:textSize="25sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/first_row_LL"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="parent" />
<LinearLayout
android:id="#+id/first_row_LL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="#+id/date_time_LL"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/dashboard_TV">
<LinearLayout
android:id="#+id/my_plan_LV"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="#0f5acf"
android:onClick="#{home::updateMyPlanOnClick}"
android:orientation="vertical"
android:padding="2dp">
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:src="#drawable/ic_assignment" />
<TextView
android:id="#+id/home_fragment_update_my_plan_TV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Update My Plan"
android:textColor="#ffffff"
android:textSize="11sp"
tools:ignore="SmallSp" />
</LinearLayout>
<LinearLayout
android:id="#+id/update_my_budget_LV"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="#4d88ff"
android:baselineAligned="false"
android:onClick="#{home::updateMyBudgetOnCLick}"
android:orientation="vertical"
android:padding="2dp">
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:src="#drawable/ic_baseline" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Update My Budget"
android:textColor="#ffffff"
android:textSize="10sp"
tools:ignore="SmallSp" />
</LinearLayout>
<LinearLayout
android:id="#+id/contact_advisor_LV"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_weight="1"
android:background="#0e4087"
android:onClick="#{home::contactAdvisorOnCLick}"
android:orientation="vertical"
android:padding="2dp">
<ImageView
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
android:src="#drawable/ic_contact_support" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Contact advisor"
android:textColor="#ffffff"
android:textSize="11sp"
tools:ignore="SmallSp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/date_time_LL"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_marginBottom="8dp"
android:background="#884dff"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="#+id/second_row_LL"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/first_row_LL">
<ImageView
android:id="#+id/date_image_IMG"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="#drawable/ic_date_range_24" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="00:00"
android:textColor="#ffffff"
android:textSize="24sp" />
<TextView
android:id="#+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:text="29.09.2020"
android:textColor="#ffffff"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/second_row_LL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="#+id/pie_chart_expenditures_TV"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/date_time_LL">
<LinearLayout
android:id="#+id/plan_last_update_LV"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="#ffffff"
android:orientation="vertical"
android:padding="2dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Plan Last Updated"
android:textColor="#color/hints_black"
android:textSize="10sp"
tools:ignore="SmallSp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="21"
android:textColor="#3297e9"
android:textSize="28sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Aug 2017"
android:textColor="#a0b4bf"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/until_retirement_LV"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="#ffffff"
android:orientation="vertical"
android:padding="2dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Until Retirement"
android:textColor="#color/hints_black"
android:textSize="10sp"
tools:ignore="SmallSp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="33"
android:textColor="#3297e9"
android:textSize="28sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Years"
android:textColor="#a0b4bf"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:id="#+id/out_of_debt_LV"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_weight="1"
android:background="#ffffff"
android:orientation="vertical"
android:padding="2dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Out of Debt Date"
android:textColor="#color/hints_black"
android:textSize="10sp"
tools:ignore="SmallSp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="20"
android:textColor="#3297e9"
android:textSize="28sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Aug 2017"
android:textColor="#a0b4bf"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="#+id/pie_chart_expenditures_TV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#ffffff"
android:gravity="center"
android:text="Monthly Expenditures"
android:textSize="25sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/pie_chart_expenditures_LL"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/second_row_LL" />
<LinearLayout
android:id="#+id/pie_chart_expenditures_LL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical"
app:layout_constraintBottom_toTopOf="#+id/list_view_pie_chart_legend"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/pie_chart_expenditures_TV">
<com.github.mikephil.charting.charts.PieChart
android:id="#+id/pie_chart_reports_home"
android:layout_width="match_parent"
android:layout_height="400dp" />
</LinearLayout>
<ListView
android:id="#+id/list_view_pie_chart_legend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/pie_chart_expenditures_LL"
tools:listitem="#layout/pie_chart_list_item" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
my item view:
<layout>
<data>
<variable
name="legend"
type="com.nswd.successplan.model.PieChartLegendModel" />
</data>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
android:padding="4dp">
<ImageView
android:id="#+id/legend_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_dot_list_item_pie_chart" />
<TextView
android:id="#+id/expenditure"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:text="Debt Payments"
android:textColor="#197ad8" />
<TextView
android:id="#+id/costs_expenditure"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="end"
android:text="7,555" />
</LinearLayout>
</layout>

ListView not scrolling in NestedScrollView (fragment)

I can't scroll in the listView in NestedScrollView (fragment)
Attempted code:
setNestedScrollingEnabled(true);
<android.support.v4.widget.NestedScrollView android:fillViewport="true" /> and <View android:nestedScrollingEnabled = "true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="50px">
<WebView
android:id="#+id/wb"
android:layout_width="match_parent"
android:layout_height="244dp"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Recherche statistique des pays "
android:textColor="#5E5E5E"
android:textSize="24dp" />
<View
android:layout_width="40dp"
android:layout_height="6dp"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:background="#drawable/bg_view">
</View>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_regular"
android:text="ÉVOLUTION DU CORONAVIRUS COVID-19 "
android:textColor="#5E5E5E"
android:textSize="18dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">
<SearchView
android:id="#+id/cher"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:orientation="horizontal">
<TextView
android:id="#+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="#font/roboto_medium"
android:text="Statistiques"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:background="#7a8b8b8b"></View>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<ProgressBar
android:id="#+id/loadin"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_weight="250" />
<ListView
android:id="#+id/ListC"
android:layout_width="match_parent"
android:layout_height="500dp"
android:layout_gravity="center"
android:divider="#ffffff"></ListView>
</LinearLayout>
<LinearLayout
android:id="#+id/lst1"
android:layout_width="match_parent"
android:layout_height="446dp"
android:layout_marginTop="14dp"
android:orientation="horizontal"/>
<LinearLayout
android:id="#+id/lin1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:visibility="gone">
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Nombre total de cas"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/tot1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_marginLeft="18dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Nouveaux cas"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/casN1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="#+id/lin2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:orientation="horizontal"
android:visibility="gone">
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Total des décès"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/dead1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_marginLeft="18dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Nouvelles morts"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/Ndead1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="#+id/lin3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal"
android:visibility="gone">
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Total récupéré"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/Totrec1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_marginLeft="18dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Cas active"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/act1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:id="#+id/lin4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal"
android:visibility="gone">
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Cas critique"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/cri1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="120dp"
android:layout_marginLeft="18dp"
android:layout_weight="1"
app:cardCornerRadius="8dp"
app:cardElevation="2dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/roboto_bold"
android:text="Nombre total de cas / 1M habitants"
android:textColor="#5E5E5E"
android:textSize="18dp" />
<TextView
android:id="#+id/tot1m1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:textColor="#FFFFFF"
android:textSize="29dp" />
<ProgressBar
android:id="#+id/l8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:indeterminate="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
I know I shouldn't use ListView in NestedScrollView, but I have no other option for now
Hope someone can help !

How to put this imageView in this place? - Android

I've got a problem with adding logo to my app.
Now it's like:
HERE IS A LOGO - CLICK (haven't got 10 reputation)
I want to have a imageview with logo (id: logo) above the box with login.
How to make it?
Layout.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:facebook="http://schemas.android.com/tools"
xmlns:fb="http://schemas.android.com/tools"
android:id="#+id/mainView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#drawable/log"
android:gravity="center"
android:orientation="vertical">
<ScrollView
android:background="#drawable/log"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true">
<RelativeLayout
android:background="#drawable/login"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_width="350dp"
android:layout_marginLeft="17dp"
android:layout_height="300dp"
android:layout_marginTop="120dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
app:srcCompat="#drawable/napis"
android:id="#+id/logosek" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/social_signin_layout"
android:layout_marginTop="10dp"
android:background="#color/md_white_1000"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="#+id/tv_or"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:text="#string/screen_login_or_label"
android:textColor="#color/md_black_1000"
android:textSize="24sp" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:textColorHint="#color/material_color_primary"
app:hintAnimationEnabled="true"
app:hintTextAppearance="#style/TextAppearance.AppCompat.Small">
<EditText
android:id="#+id/et_usernamelogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/screen_register_hint_email"
android:inputType="text"
android:singleLine="true"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<!--<EditText-->
<!--android:id="#+id/"-->
<!--style="#style/edittextstyle"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="#dimen/editlayimg_edittextheight"-->
<!--android:layout_marginTop="#dimen/five"-->
<!--android:gravity="bottom"-->
<!--android:hint="#string/login_storeid"-->
<!--android:singleLine="true"-->
<!--android:textColorHint="#color/fontcolorlight"-->
<!--android:textSize="18sp" />-->
<!--<View-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="#dimen/one"-->
<!--android:layout_marginLeft="#dimen/five"-->
<!--android:layout_marginRight="#dimen/five"-->
<!--android:background="#color/fontcolorlight" />-->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:textColorHint="#color/material_color_primary"
app:hintAnimationEnabled="true"
app:hintTextAppearance="#style/TextAppearance.AppCompat.Small">
<EditText
android:id="#+id/et_passwordlogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="text"
android:singleLine="true"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="#+id/btn_login"
style="#style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="match_parent"
android:layout_height="#dimen/btnheight"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="4dp"
android:background="#color/material_color_accent"
android:text="#string/screen_login_button_login"
android:textColor="#color/md_white_1000"
android:textSize="#dimen/btnlogin_textsize" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="4dp"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/txt_signup"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginRight="16dp"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="left"
android:paddingLeft="8dp"
android:text="#string/screen_login_button_sign_up"
android:textColor="#color/md_black_1000"
android:textSize="16sp"
android:layout_width="wrap_content" />
<TextView
android:id="#+id/tv_forgotpwd"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="8dp"
android:text="Forgot Password?"
android:textColor="#color/md_black_1000"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/lay_above"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/md_brown_100"
android:orientation="vertical"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
</LinearLayout>
<LinearLayout
android:id="#+id/social_signin_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="100dp"
android:layout_below="#+id/lay_above"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="Choose account to login"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/md_yellow_50"
android:textAlignment="center"
android:textSize="17sp" />
<com.google.android.gms.common.SignInButton
android:id="#+id/btn_sign_in"
android:layout_width="300dp"
android:layout_marginBottom="0dp"
android:layout_marginLeft="16dp"
android:layout_gravity="center_vertical|center_horizontal"
android:textSize="18sp"
android:textStyle="bold"
android:layout_marginRight="16dp"
android:padding="0dp"
android:theme="#style/Widget.AppCompat.Button"
app:theme="#style/Widget.AppCompat.Button"
android:layout_height="35dp"
android:layout_marginTop="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_marginTop="5dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="or"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/AntiqueWhite"
android:textAlignment="center"
android:textSize="18sp"
android:id="#+id/textView10" />
<com.facebook.login.widget.LoginButton
android:id="#+id/authButton"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="10dp"
android:textSize="18sp"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_width="300dp"
android:layout_height="50dp" />
<TextView
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="#string/please_login_in"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/md_yellow_50"
android:textAlignment="center"
android:textSize="15sp"
android:id="#+id/textView12" />
</LinearLayout>
<TextView
android:text="Welcome, Saiyan!"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:id="#+id/textView14"
android:textSize="36sp"
android:layout_below="#+id/lay_above"
android:layout_centerHorizontal="true"
android:textColor="#color/Yellow" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
just put the imageview before the relative layout
instead of:
<RelativeLayout
android:background="#drawable/login"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_width="350dp"
android:layout_marginLeft="17dp"
android:layout_height="300dp"
android:layout_marginTop="120dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
app:srcCompat="#drawable/napis"
android:id="#+id/logosek" />
do:
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
app:srcCompat="#drawable/napis"
android:id="#+id/logosek" />
<RelativeLayout
android:background="#drawable/login"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_width="350dp"
android:layout_marginLeft="17dp"
android:layout_height="300dp"
android:layout_marginTop="120dp">
this will put imageview in the scrollview and below it the rest of the relativelayout , all because of the linearlayout orientation which directed vertical , so every child will come below the former.
EDIT :
you also need to put the scrollview first and then put the linearlayout , this should be it :
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:facebook="http://schemas.android.com/tools"
xmlns:fb="http://schemas.android.com/tools"
android:background="#drawable/log"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true">
<LinearLayout
android:id="#+id/mainView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#drawable/log"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
app:srcCompat="#drawable/napis"
android:id="#+id/logosek" />
<RelativeLayout
android:background="#drawable/login"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_width="350dp"
android:layout_marginLeft="17dp"
android:layout_height="300dp"
android:layout_marginTop="120dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="#+id/social_signin_layout"
android:layout_marginTop="10dp"
android:background="#color/md_white_1000"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="#+id/tv_or"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:text="#string/screen_login_or_label"
android:textColor="#color/md_black_1000"
android:textSize="24sp" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:textColorHint="#color/material_color_primary"
app:hintAnimationEnabled="true"
app:hintTextAppearance="#style/TextAppearance.AppCompat.Small">
<EditText
android:id="#+id/et_usernamelogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/screen_register_hint_email"
android:inputType="text"
android:singleLine="true"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<!--<EditText-->
<!--android:id="#+id/"-->
<!--style="#style/edittextstyle"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="#dimen/editlayimg_edittextheight"-->
<!--android:layout_marginTop="#dimen/five"-->
<!--android:gravity="bottom"-->
<!--android:hint="#string/login_storeid"-->
<!--android:singleLine="true"-->
<!--android:textColorHint="#color/fontcolorlight"-->
<!--android:textSize="18sp" />-->
<!--<View-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="#dimen/one"-->
<!--android:layout_marginLeft="#dimen/five"-->
<!--android:layout_marginRight="#dimen/five"-->
<!--android:background="#color/fontcolorlight" />-->
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:textColorHint="#color/material_color_primary"
app:hintAnimationEnabled="true"
app:hintTextAppearance="#style/TextAppearance.AppCompat.Small">
<EditText
android:id="#+id/et_passwordlogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Password"
android:inputType="text"
android:singleLine="true"
android:textSize="18sp" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="#+id/btn_login"
style="#style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="match_parent"
android:layout_height="#dimen/btnheight"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="4dp"
android:background="#color/material_color_accent"
android:text="#string/screen_login_button_login"
android:textColor="#color/md_white_1000"
android:textSize="#dimen/btnlogin_textsize" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="4dp"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/txt_signup"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginRight="16dp"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="left"
android:paddingLeft="8dp"
android:text="#string/screen_login_button_sign_up"
android:textColor="#color/md_black_1000"
android:textSize="16sp"
android:layout_width="wrap_content" />
<TextView
android:id="#+id/tv_forgotpwd"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:gravity="right"
android:paddingRight="8dp"
android:text="Forgot Password?"
android:textColor="#color/md_black_1000"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="#+id/lay_above"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/md_brown_100"
android:orientation="vertical"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
</LinearLayout>
<LinearLayout
android:id="#+id/social_signin_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="100dp"
android:layout_below="#+id/lay_above"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="Choose account to login"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/md_yellow_50"
android:textAlignment="center"
android:textSize="17sp" />
<com.google.android.gms.common.SignInButton
android:id="#+id/btn_sign_in"
android:layout_width="300dp"
android:layout_marginBottom="0dp"
android:layout_marginLeft="16dp"
android:layout_gravity="center_vertical|center_horizontal"
android:textSize="18sp"
android:textStyle="bold"
android:layout_marginRight="16dp"
android:padding="0dp"
android:theme="#style/Widget.AppCompat.Button"
app:theme="#style/Widget.AppCompat.Button"
android:layout_height="35dp"
android:layout_marginTop="10dp" />
<TextView
android:layout_width="match_parent"
android:layout_marginTop="5dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="or"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/AntiqueWhite"
android:textAlignment="center"
android:textSize="18sp"
android:id="#+id/textView10" />
<com.facebook.login.widget.LoginButton
android:id="#+id/authButton"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="10dp"
android:textSize="18sp"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_width="300dp"
android:layout_height="50dp" />
<TextView
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="#string/please_login_in"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textColor="#color/md_yellow_50"
android:textAlignment="center"
android:textSize="15sp"
android:id="#+id/textView12" />
</LinearLayout>
<TextView
android:text="Welcome, Saiyan!"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:id="#+id/textView14"
android:textSize="36sp"
android:layout_below="#+id/lay_above"
android:layout_centerHorizontal="true"
android:textColor="#color/Yellow" />
</RelativeLayout>
</LinearLayout>
</ScrollView>

not scrolling at the end of fragment - android

I developed an Tabs android application in which the scroll-view is not scrolling.. I am posting the code here please check and if found any error please help.. Here I used ScrollView as root and then LinearLayout... but this is not scrolling at the end (stop at half of label name:"label_h_total")
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|top"
android:orientation="vertical"
android:background="#color/colorPrimary"
>
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:id="#+id/arrowImageView"
android:src="#drawable/logo_grey"
/>
<TextView
android:id="#+id/NameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="20dp"
android:textStyle="bold"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/dTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/positionTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/IdTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_id"
android:textSize="15dp"
android:layout_marginBottom="#dimen/activity_vertical_margin"
android:textColor="#android:color/white"
android:gravity="center_horizontal" />
<!--items-->
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image1"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:src="#drawable/takeoff_color"
android:layout_alignParentStart="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_b"
android:textSize="15dp"
android:layout_toEndOf="#id/image1"
android:textStyle="bold"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/sTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image2"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/document"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_date"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#id/image2"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/DateTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/image3"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/document_color"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_end_of"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#id/image3"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/endOfTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:gravity="start"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/ic_action_money"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_c"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/currentSalaryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#android:color/white"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView2"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/bag_color"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_h_total"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView2"
android:textColor="#color/colorPrimary" />
<TextView
android:id="#+id/salaryTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#color/colorPrimary" />
</RelativeLayout>
<RelativeLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:id="#+id/imageView3"
android:layout_marginStart="5dp"
android:layout_marginEnd="5dp"
android:layout_alignParentStart="true"
android:src="#drawable/purchase_order"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/label_g"
android:textSize="15dp"
android:textStyle="bold"
android:layout_toEndOf="#+id/imageView3"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/gTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="15dp"
android:textStyle="bold"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginStart="10dp"
android:textColor="#android:color/white" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
XML tabs:
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
<android.support.design.widget.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="#dimen/custom_tab_layout_height"
app:tabMode="fixed"
app:tabGravity="fill"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>

Categories

Resources