When I load an image into SimpleDraweeView in fresco liberary it tries to show all image in it so images corners remain empty, How can I force it to scale image to fill whole area?
I tried most of fresco:actualImageScaleType but nothing changes at all.here is my layout
I have set scaleType to centerCrop and nothing changed
`<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp">
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/card_view"
android:layout_gravity="center"
android:layout_margin="#dimen/card_margin"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="2dp"
card_view:contentPadding="0dp"
card_view:cardPreventCornerOverlap="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1"
android:gravity="center|center_horizontal">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1"
android:focusableInTouchMode="false"
android:focusable="false"
android:baselineAligned="false">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="190dp"
android:layout_weight="0.10">
<com.facebook.drawee.view.SimpleDraweeView
android:id="#+id/img_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
fresco:placeholderImage="#drawable/backgrondlayout2"
fresco:actualImageScaleType="centerCrop" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#42000000"
android:layout_gravity="bottom|right"
tools:ignore="RtlHardcoded">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="#android:style/TextAppearance.DeviceDefault.Large"
android:text="Header"
android:transitionName="title"
android:id="#+id/txt_header"
android:layout_gravity="left|center_vertical"
android:gravity="right"
android:padding="#dimen/textPadding"
android:paddingRight="#dimen/textPadding"
tools:ignore="RtlSymmetry"
android:textColor="#color/off_white" />
</FrameLayout>
</FrameLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="90dp"
android:weightSum="1"
android:layout_weight="0.0001"
android:baselineAligned="false">
<LinearLayout
android:orientation="vertical"
android:layout_width="109dp"
android:layout_height="match_parent"
android:layout_weight="0.10">
<com.facebook.drawee.view.SimpleDraweeView
android:id="#+id/img_logo"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.90">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textAppearance="#android:style/TextAppearance.DeviceDefault.Small"
android:text="Discription"
android:id="#+id/txt_discription"
android:paddingRight="4dp"
android:gravity="right"
tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout>
</LinearLayout>
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="#android:drawable/divider_horizontal_textfield"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:paddingBottom="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="2"
android:layout_weight="0.99"
android:gravity="right|center_horizontal"
tools:ignore="RtlHardcoded"
android:baselineAligned="false">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:layout_weight="1.75"
android:gravity="center_vertical|center_horizontal">
<ImageView
android:id="#+id/img_distance_icon"
android:contentDescription=""
android:layout_height="24dp"
android:layout_width="24dp"
tools:layout_width="24dp"
android:background="#drawable/ic_directions_black_24dp" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_weight="0.35"
android:gravity="center|right">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="0.0 km"
android:id="#+id/txt_distance"
android:layout_weight="0.77"
android:gravity="right"
android:paddingRight="#dimen/textPadding"
android:textAlignment="viewStart"
android:paddingLeft="#dimen/textPadding"
android:maxLines="1" />
<TextView
android:layout_width="100dp"
android:layout_height="match_parent"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Indoor"
android:id="#+id/txt_indoor"
android:gravity="center|right"
android:textColor="#e00b0b"
android:textSize="18sp"
android:paddingRight="4dp"
android:textAlignment="viewStart"
tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout></android.support.v7.widget.CardView>
</LinearLayout>`
and this is what it shows
Can you please help me find my mistake?
thanks
Related
I am trying to create layout like below in android:
But my problem is I am unable to add textbelow the image or on the right hand side of imageview. If I wrap ImageView and textview in a LinearLayout the then the whole view shrinks. Should I be using TableLayout?
My current layout xml is like below:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_below="#id/my_recycler_view"
android:layout_margin="30dp">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical"
android:layout_weight="1"
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/vwImageAndClassroom"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
>
<ImageView
android:id="#+id/img_room"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:contentDescription="#string/coverimage_contentdescription"
android:scaleType="fitCenter"
android:src="#drawable/comm_book_icon"
/>
<TextView
android:id="#+id/tv_emp_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:textSize="12dp"
android:textStyle="bold"
android:textAllCaps="true"
android:layout_below="#id/img_room"
android:layout_marginBottom="20dp"
android:gravity="center_horizontal"
android:text="TEXT 1"
/>
</RelativeLayout>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical"
android:layout_weight="1"
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/vwImageAndClassroom2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
>
<ImageView
android:id="#+id/img_room2"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:contentDescription="#string/coverimage_contentdescription"
android:scaleType="fitCenter"
android:src="#drawable/visitor_book_icon"
/>
<TextView
android:id="#+id/tv_emp_name2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:textSize="12dp"
android:textStyle="bold"
android:textAllCaps="true"
android:layout_below="#id/img_room2"
android:layout_marginBottom="20dp"
android:gravity="center_horizontal"
android:text="TEXT 2"
/>
</RelativeLayout>
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="300dp"
android:orientation="vertical"
android:layout_weight="1"
>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/vwImageAndClassroom3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
>
<ImageView
android:id="#+id/img_room3"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:contentDescription="#string/coverimage_contentdescription"
android:scaleType="fitCenter"
android:src="#drawable/visitor_book_icon"
/>
<TextView
android:id="#+id/tv_emp_name3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:textSize="12dp"
android:textStyle="bold"
android:textAllCaps="true"
android:layout_below="#id/img_room3"
android:layout_marginBottom="20dp"
android:gravity="center_horizontal"
android:text="TEXT 3"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
Hope this will help you and you will find your solutions from this xml code. I just modify some of your code
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="#+id/image1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="#android:drawable/ic_search_category_default"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This Right side text 1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="#android:drawable/ic_search_category_default"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This Right side text 1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="#android:drawable/ic_search_category_default"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This Right side text 1"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="This is under layout text"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="This is under layout text"/>
</LinearLayout>
</LinearLayout>
Have placeholder views where text is not required.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/next_green" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/next_green" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/next_green" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="text"/>
</LinearLayout>
</LinearLayout>
I did exactly what you want
Open image
<LinearLayout 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="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="#android:drawable/btn_dialog" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView3"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="#android:drawable/btn_dialog" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<ImageView
android:id="#+id/imageView2"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="#android:drawable/btn_dialog" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="15dp"
android:text="Some text" />
<TextView
android:id="#+id/textView6"
android:layout_width="match_parent"
android:layout_height="15dp"
android:text="Some text" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/textView7"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Some text"
app:srcCompat="#android:drawable/btn_dialog" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView8"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="Some text"
app:srcCompat="#android:drawable/btn_dialog" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="#+id/textView9"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Some text"
app:srcCompat="#android:drawable/btn_dialog" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
I have already with adjustresize and adjustpan also but nothing worked for me here.
Here is my xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:background="#color/gray"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:id="#+id/relativeLayout2">
<ImageView
android:layout_width="match_parent"
android:src="#drawable/backgroiund"
android:scaleType="fitXY"
android:layout_height="match_parent" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="500dp"
android:background="#FFFFFF"
android:id="#+id/relativeLayout"
android:orientation="vertical"
android:layout_marginTop="120dp"
android:layout_centerHorizontal="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="65dp">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="120dp">
<TextView
android:layout_width="match_parent"
android:text="Srinivas"
android:id="#+id/user_name"
android:textSize="25sp"
android:gravity="center"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:text="Android Developer"
android:textSize="18sp"
android:layout_marginTop="10dp"
android:gravity="center"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:text="Tadepalligudem,West Godavari"
android:layout_marginTop="10dp"
android:gravity="center"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:background="#drawable/boarder"
android:layout_marginLeft="20dp"
android:layout_gravity="center"
android:layout_marginRight="20dp"
android:layout_height="40dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:textSize="18sp"
android:text="about"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_marginTop="10dp"
android:background="#dfdfdf"/>
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="100dp">
<TextView
android:layout_width="match_parent"
android:text="Intrests"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#A9A9A9"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="horizontal"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_gravity="center"
android:gravity="center"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="#drawable/bg1"
android:layout_weight="8.5">
<ImageView
android:id="#+id/editsearch"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="18dp"
android:layout_gravity="center"
android:foregroundGravity="center"
android:src="#drawable/search" />
<EditText
android:id="#+id/name"
android:layout_width="0dp"
android:layout_weight="9"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:backgroundTint="#00000000"
android:inputType="textCapSentences"
android:hint="Search Intrests"
android:singleLine="true"
android:layout_gravity="center"
android:background="#null"
android:padding="2dp"
android:textColorHint="#9B9B9B"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:id="#+id/buton_layout"
android:orientation="vertical"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#drawable/boarder">
<ScrollView
android:id="#+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.buzzed.utils.FlowLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/flow_container1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:gravity="center"
android:paddingBottom="10dp"
app:elementSpacing="5dp"
app:flowDirection="leftToRight"
app:lineSpacing="14dp" />
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_height="80dp"
android:layout_width="match_parent">
<Button
android:layout_width="match_parent"
android:background="#drawable/circlecorner1"
android:text="save"
android:textSize="18sp"
android:layout_marginTop="10dp"
android:id="#+id/save"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:onClick="save"
android:layout_gravity="top"
android:textColor="#color/White"
android:layout_height="40dp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:id="#+id/list_layout"
android:orientation="vertical"
android:visibility="gone"
android:layout_height="match_parent">
<ListView
android:id="#+id/listview"
android:layout_width="match_parent"
android:layout_height="match_parent"></ListView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/user_pic"
android:layout_width="140dp"
android:layout_height="140dp"
android:layout_gravity="center"
android:src="#drawable/grey_round"
android:layout_marginTop="37dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#FFFFFF"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_weight="1">
</LinearLayout>
</LinearLayout>
When I used AdjustPan nothing happened but when I tried with AdjustResize the screen is scrollable and I can move it manually but what I need is to move screen automatically when keyboard open and yes it is happening in fragment. Please help me .
I want to display some text in the middle of the screen, below header and above footer. Since this text is very long I nested it in ScrollView. I have tried a number of solutions: this, this, this, this, and a bunch more...
At first I had a problem of the two relative_layouts overlapping and text being cut of. The most accepted answer is to use layout_above and layout_below, but when I use layout_above, the text is never displayed.
This is what my xml looks like:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:orientation="vertical">
<RelativeLayout
android:id="#+id/linear_layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/gray"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<ImageView
android:id="#+id/profile_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="10dp"
android:contentDescription="#string/profile_photo"
android:src="#drawable/default_profile"
tools:ignore="RtlHardcoded" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/scrollViewAndStuff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_above="#+id/ln_layout_footer"
android:layout_below="#+id/linear_layout_header">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
tools:ignore="UselessParent">
<TextView
android:id="#+id/meetupDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="#string/text"/>-
</ScrollView>
</RelativeLayout>
<RelativeLayout
android:id="#+id/ln_layout_footer"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingTop="10dp">
<LinearLayout
android:id="#+id/ln_layout"
android:layout_width="fill_parent"
android:background="#color/gray"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<TextView
android:id="#+id/red"
android:textColor="#color/white"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/red" />
<TextView
android:id="#+id/blue"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="#color/white"
android:layout_weight="1"
android:gravity="center"
android:text="#string/blue" />
<TextView
android:id="#+id/green"
android:layout_width="match_parent"
android:textColor="#color/white"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/green" />
</LinearLayout>
</RelativeLayout>
in your ln_layout_footer
set android:layout_height="wrap_content"
Edited
<RelativeLayout 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:orientation="vertical">
<RelativeLayout
android:id="#+id/linear_layout_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/dark_gray_pressed"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="5dp"
android:weightSum="3">
<ImageView
android:id="#+id/profile_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="10dp"
android:contentDescription="#string/action_settings"
android:src="#drawable/img_splash_logo"
tools:ignore="RtlHardcoded" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/scrollViewAndStuff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/ln_layout_footer"
android:layout_below="#+id/linear_layout_header">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
tools:ignore="UselessParent">
<TextView
android:id="#+id/meetupDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="#string/txt_price" />-
</ScrollView>
</RelativeLayout>
<RelativeLayout
android:id="#+id/ln_layout_footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingTop="10dp">
<LinearLayout
android:id="#+id/ln_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#color/dark_gray"
android:orientation="horizontal"
android:paddingBottom="5dp"
android:paddingTop="5dp">
<TextView
android:id="#+id/red"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/txt_quantity"
android:textColor="#color/white" />
<TextView
android:id="#+id/blue"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/txt_material"
android:textColor="#color/white" />
<TextView
android:id="#+id/green"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="#string/msg_enter_user_name"
android:textColor="#color/white" />
</LinearLayout>
</RelativeLayout>
In you layout using two properties that why it doesn't work. So you can remove one properties here is your working code
<RelativeLayout
android:id="#+id/scrollViewAndStuff"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/linear_layout_header">
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp">
<TextView
android:textColor="#000"
android:id="#+id/meetupDescription"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:text="#string/text" />-
</ScrollView>
</RelativeLayout>
you can use this android:layout_below="#+id/linear_layout_header or this android:layout_above="#+id/ln_layout_footer, one property at a time. or simply copy and past
I have a scrollview which was scrolling fine, until I added elements inside and it stopped scrolling. I tried many things, including changing the height to fill_parent or wrap_content, but somehow I cannot find which value is blocking the scroll. Anyone can help? Here is my layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:id="#+id/bg_layout"
android:fitsSystemWindows="false"
android:background="#drawable/detail_background"
tools:context="com.kalianey.oxapp.views.fragments.ProfileFragment">
<com.kalianey.oxapp.utils.UIParallaxScroll //extends ScrollView
android:id="#+id/scroller"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:headerView="#+id/layout_top">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="1"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="0.4"
android:id="#+id/cover_container">
<com.kalianey.oxapp.utils.UICircularImage
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/image_view"
android:layout_width="125dp"
android:layout_height="125dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:layout_marginBottom="5dp"
app:line_color="#android:color/white"
app:line_color_press="#color/theme_color"
app:line_width="1dp"
app:padding="0dp" />
<TextView
android:id="#+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:paddingLeft="16dp"
android:paddingTop="10dp"
android:paddingRight="16dp"
android:text="#string/detail_title_placeholder"
android:textSize="#dimen/textsize_xlarge"
android:layout_below="#+id/image_view"
android:textColor="#android:color/white"/>
<TextView
android:id="#+id/sumary"
android:layout_below="#+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:paddingBottom="16dp"
android:text="#string/sumary_placeholder"
android:textColor="#color/white_transparent"
android:textSize="#dimen/textsize_medium_small" />
<LinearLayout
android:id="#+id/statistics"
android:layout_below="#+id/sumary"
android:background="#color/gray_transparent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"
android:orientation="vertical"
android:background="#drawable/border_right" >
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButtonFriend"
android:layout_gravity="center_horizontal"
android:src="#drawable/user"
android:background="#android:color/transparent"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:layout_weight="1"
android:background="#color/gray_transparent"
android:orientation="vertical" >
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButtonFavorite"
android:layout_gravity="center_horizontal"
android:src="#drawable/star"
android:background="#android:color/transparent"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="#+id/informations_container"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="0.6"
android:orientation="vertical"
android:background="#android:color/white"
android:layout_below="#+id/cover_container"
android:gravity="center"
android:padding="10dp">
<com.kalianey.oxapp.utils.UITabs
android:id="#+id/toggle"
android:layout_gravity="center"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="#+id/informations_container">
<RadioButton
android:id="#+id/toggle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"
android:checked="true"
android:text="#string/description_tab_1"
style="#style/UITabs" />
<RadioButton
android:id="#+id/toggle2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="5dp"
android:text="#string/description_tab_2"
android:layout_gravity="bottom"
style="#style/UITabs" />
</com.kalianey.oxapp.utils.UITabs>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/profile_photo_text"
android:text="#string/profile_photo_text"
android:layout_gravity="left"
android:layout_marginBottom="10dp"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"
android:layout_marginTop="20dp" />
<TextView
android:id="#+id/noPhotos"
android:layout_below="#+id/profile_photo_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:text="#string/noPhotos"
android:textColor="#color/gray_light"
android:textSize="#dimen/textsize_medium_small"
android:textStyle="italic"
android:height="70dp"
android:visibility="gone"/>
<android.support.v7.widget.RecyclerView
android:id="#+id/grid_view"
android:layout_width="match_parent"
android:layout_height="250dp"
app:layoutManager="StaggeredGridLayoutManager"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/profile_friend_text"
android:text="#string/profile_friend_text"
android:layout_gravity="left"
android:layout_marginTop="20dp"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"/>
<TextView
android:id="#+id/noFriends"
android:layout_below="#+id/profile_friend_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:fontFamily="sans-serif-light"
android:gravity="center"
android:text="#string/noFriends"
android:textColor="#color/gray_light"
android:textSize="#dimen/textsize_medium_small"
android:textStyle="italic"
android:minHeight="50dp"
android:visibility="gone"/>
<org.lucasr.twowayview.TwoWayView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/friends_list"
style="#style/TwoWayView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawSelectorOnTop="false"
tools:context=".MainActivity"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"/>
<se.emilsjolander.stickylistheaders.StickyListHeadersListView
android:id="#+id/questions_list"
android:layout_width="match_parent"
android:layout_height="500dp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</com.kalianey.oxapp.utils.UIParallaxScroll>
<!-- "ActionBar" -->
</RelativeLayout>
Take a look at the below xml code which will help you to to build screen with scrolling even though it contains recycler view.
<android.support.design.widget.CoordinatorLayout
android:id="#+id/container"
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.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="24dp">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
android:gravity="center_horizontal"
android:textStyle="bold"
android:text=" " />
<android.support.v7.widget.RecyclerView
android:id="#+id/rcy1"
android:layout_width="match_parent"
android:layout_height="250dp"
android:numColumns="4"
android:scrollbars="vertical"
android:adjustViewBounds="true"
android:gravity="center_horizontal"
android:horizontalSpacing="1dp"
android:padding="1dp"
android:background="#color/white"
android:stretchMode="columnWidth"
android:verticalSpacing="1dp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="#+id/rcy2"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_marginTop="10dp"
android:numColumns="3"
android:scrollbars="vertical"
android:adjustViewBounds="true"
android:gravity="center_horizontal"
android:horizontalSpacing="1dp"
android:padding="1dp"
android:background="#color/white"
android:stretchMode="columnWidth"
android:verticalSpacing="1dp"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
You can use elements that you wanted in this.Also you may change the base CoordinatorLayout to LinearLayout or RelativeLayout.Also don't forget to add the below supports in dependencies section in your build.gradle file.
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
I have problem with my Header I want include all, because I want a footer static.
I try show in :
screens 3.7 show correctly
Screen > 4.0 show incorrectly
My adapter (Only put header full with footer)
if (viewType == TYPE_HEADER) {
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.header,parent,false); //Inflating the layout
ViewHolder vhHeader = new ViewHolder(v,viewType,context); //Creating ViewHolder and passing the object of type view
return vhHeader; //returning the object created
}
My XML Header.xml :
<LinearLayout 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" tools:context="com.onpocket.alcover.Fragment_0_6"
android:orientation="vertical">
<!-- TODO: Update blank fragment layout -->
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="178dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#drawable/contenedor_img_2_1_6_3"
android:id="#+id/l1">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.3" >
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:src="#drawable/barra_lateral_img_0_1"
android:layout_marginLeft="16dp"
android:layout_marginTop="38dp"
android:id="#+id/circleView"
android:adjustViewBounds="false" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.9"
android:background="#af000000"
android:gravity="center_vertical"
android:focusableInTouchMode="false"
android:id="#+id/l3"
android:focusable="false">
<LinearLayout
android:orientation="horizontal"
android:layout_width="15dp"
android:layout_height="match_parent" />
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:text="text"
android:textSize="14sp"
android:textStyle="bold"
android:id="#+id/name"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="text"
android:id="#+id/email"
android:textColor="#ffffffff" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/scrollView2" >
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="10dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.75" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView6"
android:src="#drawable/barra_lateral_img_0_2"
android:adjustViewBounds="true" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.3" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/lateral_inicio"
android:id="#+id/textView14"
android:textColor="#010001" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/color_0_0"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="10dp">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.75" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView7"
android:src="#drawable/barra_lateral_img_0_3"
android:adjustViewBounds="true" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.3" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/lateral_idiomas"
android:id="#+id/textView15"
android:textColor="#010001" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/color_0_0"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="10dp"
android:paddingBottom="8dp" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.75" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView8"
android:src="#drawable/barra_lateral_img_0_4"
android:adjustViewBounds="true" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.3" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/lateral_contacto"
android:id="#+id/textView16"
android:textColor="#010001" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/color_0_0"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="10dp"
android:paddingBottom="8dp" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.75" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageView9"
android:src="#drawable/barra_lateral_img_0_5"
android:adjustViewBounds="true" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1.3" />
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.2"
android:gravity="center_vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="#string/lateral_notificaciones"
android:id="#+id/textView17"
android:textColor="#010001" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/color_0_0"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/color_0_0"
android:layout_marginBottom="10dp" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:id="#+id/linearLayout10" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="10dp"
android:layout_height="match_parent"></LinearLayout>
<ImageButton
android:layout_width="32dp"
android:layout_height="wrap_content"
android:id="#+id/imageButton6"
android:src="#drawable/barra_lateral_img_0_6"
android:layout_weight="1"
android:background="#null"
android:scaleType="fitCenter"
android:layout_margin="12dp"
android:tag="facebook"
android:onClick="selectItem" />
<ImageButton
android:layout_width="32dp"
android:layout_height="wrap_content"
android:id="#+id/imageButton7"
android:src="#drawable/barra_lateral_img_0_7"
android:layout_weight="1"
android:background="#null"
android:scaleType="fitCenter"
android:layout_margin="12dp"
android:tag="twitter"
android:onClick="selectItem" />
<ImageButton
android:layout_width="32dp"
android:layout_height="wrap_content"
android:id="#+id/imageButton8"
android:src="#drawable/barra_lateral_img_0_8"
android:layout_weight="1"
android:background="#null"
android:scaleType="fitCenter"
android:layout_margin="12dp"
android:tag="linkedin"
android:onClick="selectItem" />
<ImageButton
android:layout_width="32dp"
android:layout_height="wrap_content"
android:id="#+id/imageButton9"
android:src="#drawable/barra_lateral_img_0_9"
android:layout_weight="1"
android:background="#null"
android:scaleType="fitCenter"
android:layout_margin="12dp"
android:tag="blog"
android:onClick="selectItem" />
<ImageButton
android:layout_width="36dp"
android:layout_height="wrap_content"
android:id="#+id/imageButton10"
android:layout_weight="1"
android:background="#null"
android:scaleType="fitCenter"
android:layout_margin="5dp"
android:tag="youtube"
android:onClick="selectItem" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!--
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="178dp"
android:orientation="vertical"
android:weightSum="1"
android:background="#drawable/contenedor_img_2_1_6_3" android:scaleType="centerCrop">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="56dp"
android:orientation="vertical"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="true"
android:background="#color/opacity"
android:gravity="center_vertical">
<TextView
android:id="#+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:textColor="#ffffff"
android:text="Akash Bangad"
android:textSize="14sp"
android:textStyle="bold"
/>
<!– android:background="#7f000000"
android:singleLine="false"
android:paddingLeft="5dp"
android:paddingTop="5dp"
android:paddingRight="15dp"
android:paddingBottom="5dp"–>
<TextView
android:id="#+id/email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="inicio_texto_empresa"
android:textColor="#ffffffff"
android:layout_marginLeft="16dp"
/>
</LinearLayout>
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:src="#drawable/barra_lateral_img_0_1"
android:layout_marginLeft="16dp"
android:layout_marginTop="38dp"
android:id="#+id/circleView"
android:adjustViewBounds="false" />
</RelativeLayout>-->
Try to set the weight of the middle Linearlayout to 1 and its height to 0dp. So only your header and your footer have a fixed height and the scrollview will use the remaining space.
As I know, the list view support add footer view, so you can add a custom footer R.layout.drawer_footer view using listview object as below code
View footerView = LayoutInflater.from(getApplicationContext()).inflate(R.layout.drawer_footer, expandableListView, false);
TextView footer = footerView.findViewById(R.id.id_footer_wta_version_information);
expandableListView.addFooterView(footerView);
In my case, I use expandableListView the expandableListView is the same as listView. Hope this way help you