I am trying to create view by using below code but fails*
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
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:fitsSystemWindows="true"
tools:context="com.soup.navigationfragmen.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_main" />
</android.support.design.widget.CoordinatorLayout>
I have tried to make AppBarLayout visibility transparent but it didn't worked.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
enter code here
<RelativeLayout`enter code here`
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/header_cover_image"
android:layout_width="match_parent"
android:layout_height="200dp"
android:scaleType="centerCrop"
android:src="#drawable/navigation_header_image" />
<ImageButton
android:id="#+id/user_profile_photo"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_below="#+id/header_cover_image"
android:layout_centerHorizontal="true"
android:layout_marginTop="-60dp"
android:background="#drawable/profile_circular_border_imageview"
android:elevation="5dp"
android:padding="20dp"
android:scaleType="centerCrop"
android:src="#drawable/profile" />
<RelativeLayout
android:id="#+id/profile_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/header_cover_image"
android:background="#ebca0707"
android:elevation="4dp"
android:paddingBottom="24dp">
<ImageView
android:id="#+id/add_friend"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:layout_toLeftOf="#+id/drop_down_option_menu"
android:src="#drawable/ic_action_user_add" />
<ImageView
android:id="#+id/drop_down_option_menu"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:src="#drawable/ic_action_overflow" />
<TextView
android:id="#+id/user_profile_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="76dp"
android:text="Viral Android"
android:textColor="#fff"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:id="#+id/user_profile_short_bio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/user_profile_name"
android:layout_centerHorizontal="true"
android:layout_marginTop="12dp"
android:text="Android free tutorials and example"
android:textColor="#fff"
android:textSize="14sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/profile_layout"
android:layout_marginTop="5dp"
android:orientation="vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#fff"
android:clickable="true"
android:elevation="4dp"
android:padding="20dp"
android:text="Android Profile UI Design" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_marginBottom="3dp"
android:layout_marginTop="3dp"
android:background="#fff"
android:clickable="true"
android:elevation="4dp"
android:padding="20dp"
android:text="Android Profile XMl UI Design" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#fff"
android:clickable="true"
android:elevation="4dp"
android:padding="20dp"
android:text="Android Profile UI Design" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_marginBottom="3dp"
android:layout_marginTop="3dp"
android:background="#fff"
android:clickable="true"
android:elevation="4dp"
android:padding="20dp"
android:text="Android Profile XMl UI Design" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="#fff"
android:clickable="true"
android:elevation="4dp"
android:padding="20dp"
android:text="Android Profile UI Design" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
from http://www.viralandroid.com/2016/03/android-material-design-profile-screen-xml-ui-design.html
Related
I am using Guillotine Menu https://github.com/Yalantis/GuillotineMenu-Android . Problem is while clicking on Menu items inside Guillotine Menu screen , it invokes the click of behind screen. I have tried to set root view enabled/clickable false while showing Menu but is not working.How can I achieve this?
code for Guillotine Menu xml
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/cscClr"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
style="#style/Toolbar"
app:contentInsetStart="0dp">
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginTop="#dimen/dp10"
android:layout_marginLeft="#dimen/dp10"
android:layout_centerVertical="true"
android:src="#mipmap/ic_launcher_round"
android:id="#+id/menu" />
</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:orientation="vertical">
<LinearLayout
android:id="#+id/profile_group"
android:layout_gravity="center"
android:gravity="center"
style="#style/LinearLayout.GuillotineItem"
>
<ImageView
style="#style/ImageView.GuillotineItem"
android:src="#drawable/profile" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:textColor="#color/white"
android:textSize="21sp"
android:fontFamily="#font/nexa_bold"
android:text=" Profile"/>
</LinearLayout>
<LinearLayout
android:id="#+id/track_status"
style="#style/LinearLayout.GuillotineItem">
<ImageView
style="#style/ImageView.GuillotineItem"
app:srcCompat="#drawable/track" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:textColor="#color/white"
android:textSize="21sp"
android:fontFamily="#font/nexa_bold"
android:text=" Track Status"/>
</LinearLayout>
<LinearLayout
android:id="#+id/emi_calc"
style="#style/LinearLayout.GuillotineItem">
<ImageView
style="#style/ImageView.GuillotineItem"
android:src="#drawable/calculate"
android:tint="#color/white"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:textColor="#color/white"
android:textSize="21sp"
android:fontFamily="#font/nexa_bold"
android:text=" Calculator"/>
</LinearLayout>
<LinearLayout
android:id="#+id/about_app"
style="#style/LinearLayout.GuillotineItem">
<ImageView
style="#style/ImageView.GuillotineItem"
app:srcCompat="#drawable/about" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:textColor="#color/white"
android:textSize="21sp"
android:fontFamily="#font/nexa_bold"
android:text=" About Us"/>
</LinearLayout>
<LinearLayout
android:id="#+id/rate_app"
style="#style/LinearLayout.GuillotineItem">
<ImageView
style="#style/ImageView.GuillotineItem"
app:srcCompat="#drawable/rate" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:textColor="#color/white"
android:textSize="21sp"
android:fontFamily="#font/nexa_bold"
android:text=" Rate the App"/>
</LinearLayout>
<LinearLayout
android:id="#+id/share_app"
style="#style/LinearLayout.GuillotineItem">
<ImageView
style="#style/ImageView.GuillotineItem"
app:srcCompat="#drawable/share" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:textColor="#color/white"
android:textSize="21sp"
android:fontFamily="#font/nexa_bold"
android:text=" Share the App"/>
</LinearLayout>
<LinearLayout
android:id="#+id/activity_group"
android:visibility="invisible"
style="#style/LinearLayout.GuillotineItem">
<ImageView
style="#style/ImageView.GuillotineItem"
android:src="#drawable/share" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:textColor="#color/white"
android:textSize="21sp"
android:fontFamily="#font/germania_one"
android:text="Share the App"/>
</LinearLayout>
<LinearLayout
android:id="#+id/activity_group"
android:visibility="invisible"
style="#style/LinearLayout.GuillotineItem">
<ImageView
style="#style/ImageView.GuillotineItem"
android:src="#drawable/share" />
This is mainscreen lay where I have placed Menu icon for opening Guillotine Menu
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/htab_maincontent"
android:layout_width="match_parent"
android:background="#color/white"
android:layout_height="match_parent"
>
<com.google.android.material.appbar.AppBarLayout
android:id="#+id/htab_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="#+id/htab_collapse_toolbar"
android:layout_width="match_parent"
android:layout_height="130dp"
android:background="#drawable/head"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:titleEnabled="false">
<androidx.appcompat.widget.Toolbar
android:id="#+id/htab_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
app:layout_collapseMode="parallax"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"/>
<LinearLayout
android:id="#+id/head"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/dp12"
android:layout_alignParentTop="true"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginLeft="#dimen/dp10"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
app:srcCompat="#mipmap/ic_launcher_round"
android:layout_gravity="center"
android:id="#+id/menu"
/>
<TextView
android:id="#+id/title"
android:layout_width="0dp"
android:layout_weight="80"
android:layout_marginLeft="6dp"
android:layout_height="wrap_content"
android:textSize="18sp"
android:fontFamily="#font/germania_one"
android:textColor="#color/white"
android:layout_gravity="center"
android:text=" E-Loan"/>
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
app:srcCompat="#drawable/track"
android:layout_gravity="center"
/>
<TextView
android:id="#+id/track"
android:layout_width="wrap_content"
android:layout_marginLeft="2dp"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginRight="#dimen/dp12"
android:fontFamily="#font/germania_one"
android:textColor="#color/white"
android:layout_gravity="center"
android:text="Track Status"/>
</LinearLayout>
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
android:drawableRight="#android:drawable/ic_menu_search"-->
<!--android:background="#drawable/edittext_bg"/>-->
</com.google.android.material.appbar.CollapsingToolbarLayout>
</LinearLayout>
<com.tompee.funtablayout.FunTabLayout
android:id="#+id/tablayout"
android:layout_width="match_parent"
android:layout_gravity="bottom"
android:background="#drawable/head1"
android:layout_marginTop="-16dp"
android:layout_height="60dp" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
android:id="#+id/htab_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
how do I design profile picture like in this image in android? I tried placing it in the toolbar it won't show half below the toolbar.
Here is a look at the code I am trying. I am using a linear layout at top and then again a linear layout for holding logo and text and the image is at the bottom in root linear layout. Despite setting margin-top it still there and not moving to location:
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"
tools:menu="#menu/action_menu"
android:background="#color/colorPink1"
android:elevation="0dp"
android:layout_margin="0dp"
app:collapseIcon="#drawable/logo_mini"
android:padding="0dp"
android:layout_height="wrap_content" android:minHeight="0dp">
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top"
android:orientation="vertical" android:gravity="end" android:dividerPadding="100dp">
<LinearLayout
android:orientation="vertical"
android:id="#+id/main_layout"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:padding="5dp"
android:paddingLeft="50dp"
android:gravity="center">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ImageView
android:id="#+id/center_icon"
android:layout_gravity="center"
android:src="#drawable/logo_mini"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:layout_marginTop="5dp"
/>
</LinearLayout>
<ImageView
android:layout_marginTop="5dp"
android:id="#+id/bar"
android:src="#drawable/bar"
android:background="#android:color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:text="Hi ,"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/emp_name" android:textSize="30sp"/>
<TextView
android:text="Wellcome back,"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:id="#+id/textView5"/>
<TextView android:layout_width="match_parent" android:visibility="gone" android:layout_height="wrap_content"
android:text="here ae you assigned sites"/>
</LinearLayout>
</LinearLayout>
<ImageView
android:layout_gravity="bottom|end"
android:elevation="10dp"
android:src="#drawable/user_photo"
android:layout_alignBottom="#+id/center_icon"
android:layout_width="72dp"
android:layout_height="72dp"
android:gravity='center'
android:layout_marginTop="-50dp"
/>
</android.support.v7.widget.Toolbar>
you should use CoordinatorLayout and layout_anchor ,layout_anchorGravity attributes for the ImageView to locate the image on the edge of the toolbar
<android.support.design.widget.CoordinatorLayout
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.support.v7.widget.Toolbar
android:id="#+id/toolbar"
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="wrap_content"
android:layout_margin="0dp"
android:background="#color/colorAccent"
android:elevation="0dp"
android:minHeight="0dp"
android:padding="0dp"
app:collapseIcon="#drawable/logo_mini">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:dividerPadding="100dp"
android:gravity="end"
android:orientation="vertical">
<LinearLayout
android:id="#+id/main_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:padding="5dp"
android:paddingLeft="50dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/center_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:layout_weight="0"
android:src="#drawable/logo_mini" />
</LinearLayout>
<ImageView
android:id="#+id/bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/white"
android:src="#mipmap/mic" />
<TextView
android:id="#+id/emp_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hi ,"
android:textSize="30sp" />
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Wellcome back,"
android:visibility="gone" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="here ae you assigned sites"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
<ImageView
android:id="#+id/icon"
android:layout_width="#dimen/dim150"
android:layout_height="#dimen/dim150"
android:layout_below="#+id/home_txt"
android:layout_marginTop="#dimen/dim20"
android:src="#drawable/user_photo"
app:layout_anchor="#id/toolbar"
app:layout_anchorGravity="bottom|center_horizontal" />
</android.support.design.widget.CoordinatorLayout>
you can change your layout like this,
<?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="match_parent">
<android.support.v7.widget.Toolbar 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="wrap_content"
android:layout_margin="0dp"
android:background="#color/colorAccent"
android:elevation="0dp"
android:minHeight="0dp"
android:padding="0dp"
app:collapseIcon="#drawable/logo_mini">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:dividerPadding="100dp"
android:gravity="end"
android:orientation="vertical">
<LinearLayout
android:id="#+id/main_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:padding="5dp"
android:paddingLeft="50dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="#+id/center_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:layout_weight="0"
android:src="#drawable/logo_mini" />
</LinearLayout>
<ImageView
android:id="#+id/bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:background="#android:color/white"
android:src="#mipmap/mic" />
<TextView
android:id="#+id/emp_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hi ,"
android:textSize="30sp" />
<TextView
android:id="#+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Wellcome back,"
android:visibility="gone" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="here ae you assigned sites"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
<ImageView
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_alignParentRight="true"
android:layout_marginTop="80dp"
android:elevation="10dp"
android:gravity='center'
android:src="#drawable/user_photo" />
</RelativeLayout>
Try to use Constraint Layout to make responsive UI
<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"
tools:context=".StartActivity">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:background="#color/colorPrimary">
</android.support.v7.widget.Toolbar>
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginEnd="24dp"
android:background="#color/colorAccent"
android:src="#drawable/ic_launcher_foreground"
app:layout_constraintBottom_toBottomOf="#+id/toolbar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/toolbar" /></android.support.constraint.ConstraintLayout>
Some empty space is shown after tab Layout. I have the view pager outside the app bar layout and tab layout inside the Relative Layout which is inside of collapsing toolbar. Not able to determine from where this extra space is added. Any help would be appreciated. The hierarchy of the views is Coordinator, App Bar, Collapsing Toolbar, Frame Layout, Relative Layout, Tab Layout.
Below is the code
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_bg"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBar"
android:layout_width="match_parent"
android:layout_height="500dp"
android:background="?attr/colorPrimary">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleTextAppearance="#style/TextAppearance.AppCompat.Title"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleEnabled="false">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_collapseMode="parallax">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/header_picture"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:background="#drawable/splash"
android:orientation="horizontal"
android:visibility="visible" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<TextView
android:id="#+id/tv_profile_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="60dp"
android:text="Kunal Bagla"
android:textColor="#android:color/black"
android:textSize="19dp" />
<TextView
android:id="#+id/tv_profile_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/tv_profile_name"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:text="Udaipur"
android:textColor="#android:color/black"
android:textSize="15dp" />
<TextView
android:id="#+id/tv_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:background="#drawable/black_border_rounded"
android:gravity="right"
android:paddingBottom="10dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="10dp"
android:text="Settings"
android:textColor="#android:color/black"
android:textSize="15dp"
android:visibility="visible" />
<android.support.design.widget.TabLayout
android:id="#+id/tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/tv_profile_location"
android:layout_marginTop="10dp"
app:tabIndicatorColor="#color/orange"
/>
</RelativeLayout>
</LinearLayout>
<com.facebook.drawee.view.SimpleDraweeView
android:id="#+id/drawee_avatar"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center|left"
android:layout_marginLeft="20dp"
fresco:placeholderImage="#drawable/home_bg"
fresco:placeholderImageScaleType="centerCrop"
fresco:roundAsCircle="true" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|left"
android:layout_marginLeft="110dp">
<TextView
android:id="#+id/drawee_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dp"
android:text="camera"
android:textAlignment="center"
android:textColor="#color/whiteColor"
android:textSize="12sp" />
</FrameLayout>
</FrameLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#color/orange"
app:layout_collapseMode="pin"
android:minHeight="?attr/actionBarSize"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
>
<LinearLayout
android:id="#+id/ll_sub_main_dice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/menu_icon_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:padding="5dp" />
<Button
android:id="#+id/button_app_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/tv_login_logout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="right"
android:padding="5dp" />
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</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" />
Some empty space is shown after tab Layout.
Specyfy what u meen ( is there inside of tab layout or outside the best print printscreen)
Is there only in 1 place this extra space or in all AppBarLayout
And u modify in activities those items?
I woud check first behavior those layout at solo and add 1 by 1 next items and then u probly see what's wrong and abou
Here is the solution if required by some one else. If you want your toolbar to be fixed and content to be scrolled under use collapse mode as pin for toolbar and scrollFlags as scroll|exitAlwaysCollapsed for collapsing toolbar
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_bg"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleTextAppearance="#style/TextAppearance.AppCompat.Title"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
app:titleEnabled="false">
<android.support.constraint.ConstraintLayout
android:id="#+id/parentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/image_view_product"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/splash" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="#+id/drawee_avatar"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center|left"
android:layout_marginLeft="20dp"
android:layout_marginTop="100dp"
app:layout_constraintBottom_toBottomOf="#+id/image_view_product"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/image_view_product"
fresco:placeholderImage="#drawable/home_bg"
fresco:placeholderImageScaleType="centerCrop"
fresco:roundAsCircle="true" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|left"
android:layout_marginLeft="110dp"
android:visibility="visible">
<TextView
android:id="#+id/drawee_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dp"
android:text="camera"
android:textAlignment="center"
android:textColor="#color/whiteColor"
android:textSize="12sp" />
</FrameLayout>
<TextView
android:id="#+id/tv_profile_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginStart="15dp"
android:layout_marginTop="70dp"
android:text="XYZ"
android:textColor="#android:color/black"
android:textSize="19dp"
app:layout_constraintTop_toBottomOf="#id/image_view_product" />
<TextView
android:id="#+id/tv_profile_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/tv_profile_name"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:text="Location"
android:textColor="#android:color/black"
android:textSize="15dp"
app:layout_constraintTop_toBottomOf="#+id/tv_profile_name" />
<TextView
android:id="#+id/tv_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:background="#drawable/black_border_rounded"
android:gravity="right"
android:paddingBottom="10dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="10dp"
android:text="Settings"
android:textColor="#android:color/black"
android:textSize="15dp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#id/image_view_product" />
<android.support.design.widget.TabLayout
android:id="#+id/tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="#+id/tv_profile_location"
android:layout_below="#+id/tv_profile_location"
android:layout_marginTop="10dp"
app:tabIndicatorColor="#color/orange" />
</android.support.constraint.ConstraintLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#color/orange"
android:minHeight="?attr/actionBarSize"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_collapseMode="parallax">
<LinearLayout
android:id="#+id/ll_sub_main_dice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/menu_icon_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:padding="5dp" />
<Button
android:id="#+id/button_app_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/tv_login_logout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="right"
android:padding="5dp" />
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
<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>
In my activity I am using Tablayout bellow 300dp from the top is set. in Tablayout I have 3 fragments, the problem is it's showing the fragments but my layout is not scrolling up. I tried Scrollview and NesterScrollview, but none of them worked. please see my xml code below
<?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="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v4.widget.NestedScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="260dp"
android:background="#fff">
<!-- Cover Image -->
<ImageView
android:id="#+id/bgimage"
android:layout_width="match_parent"
android:layout_height="180dp"
android:scaleType="fitXY"
android:src="#drawable/profilebg" />
<!-- Round image -->
<ImageView
android:id="#+id/shareicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:tint="#color/black"
android:layout_gravity="bottom"
android:padding="5dp"
android:background="#drawable/imageborder"
android:src="#drawable/share"/>
<android.support.v7.widget.CardView
android:layout_width="140dp"
android:layout_height="140dp"
android:elevation="12dp"
android:id="#+id/view2"
app:cardCornerRadius="100dp"
android:layout_centerHorizontal="true"
android:innerRadius="0dp"
android:shape="ring"
android:layout_gravity="center"
android:layout_marginTop="60dp"
android:thicknessRatio="1.9">
<ImageView
android:id="#+id/profilepic"
android:layout_width="130dp"
android:layout_height="130dp"
android:layout_gravity="center"/>
</android.support.v7.widget.CardView>
<ImageView
android:id="#+id/editic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:tint="#color/black"
android:layout_marginRight="40dp"
android:background="#drawable/imageborder"
android:padding="6dp"
android:src="#drawable/ic_pencil"/>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#fff">
<zesteve.com.myapplication.font.RobotoTextView
android:id="#+id/usertitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tom Cruise"
android:textSize="22dp"
android:textColor="#color/black"
android:layout_gravity="center"/>
<zesteve.com.myapplication.font.RobotoTextView
android:id="#+id/userlocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Syracuse, New York"
android:layout_gravity="center"
android:textColor="#color/black"
android:textSize="14dp"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.1dp"
android:background="#color/material_purple_500"
android:layout_marginTop="25dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_marginTop="5dp">
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="256"
android:textColor="#color/black"
android:textStyle="bold"
android:textSize="16dp" />
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="LIKES"
android:textSize="12sp"/>
</LinearLayout>
<View
android:layout_width="0.1dp"
android:layout_height="50dp"
android:background="#color/material_purple_500"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_marginTop="5dp"
>
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2,080"
android:textColor="#color/black"
android:textStyle="bold"
android:textSize="16dp" />
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="FOLLOWERS"
android:textSize="12sp"/>
</LinearLayout>
<View
android:layout_width="0.1dp"
android:layout_height="50dp"
android:background="#color/material_purple_500"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="144"
android:textColor="#color/black"
android:textStyle="bold"
android:textSize="16dp" />
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="FOLLOWING"
android:textSize="12sp"/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.1dp"
android:background="#color/material_purple_500" />
<android.support.design.widget.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="40dp"
app:tabGravity="fill"
app:tabMode="fixed"
style="#style/NavigationTab"
android:background="?attr/colorPrimary"/>
<android.support.v4.view.ViewPager
android:id="#+id/ptab_viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>
I also tried below
<?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="wrap_content"
android:orientation="vertical"
xmlns:app="http://schemas.android.com/apk/res-auto">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="260dp"
android:background="#fff">
<!-- Cover Image -->
<ImageView
android:id="#+id/bgimage"
android:layout_width="match_parent"
android:layout_height="180dp"
android:scaleType="fitXY"
android:src="#drawable/profilebg" />
<!-- Round image -->
<ImageView
android:id="#+id/shareicon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:tint="#color/black"
android:layout_gravity="bottom"
android:padding="5dp"
android:background="#drawable/imageborder"
android:src="#drawable/share"/>
<android.support.v7.widget.CardView
android:layout_width="140dp"
android:layout_height="140dp"
android:elevation="12dp"
android:id="#+id/view2"
app:cardCornerRadius="100dp"
android:layout_centerHorizontal="true"
android:innerRadius="0dp"
android:shape="ring"
android:layout_gravity="center"
android:layout_marginTop="60dp"
android:thicknessRatio="1.9">
<ImageView
android:id="#+id/profilepic"
android:layout_width="130dp"
android:layout_height="130dp"
android:layout_gravity="center"/>
</android.support.v7.widget.CardView>
<ImageView
android:id="#+id/editic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:tint="#color/black"
android:layout_marginRight="40dp"
android:background="#drawable/imageborder"
android:padding="6dp"
android:src="#drawable/ic_pencil"/>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#fff">
<zesteve.com.myapplication.font.RobotoTextView
android:id="#+id/usertitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Tom Cruise"
android:textSize="22dp"
android:textColor="#color/black"
android:layout_gravity="center"/>
<zesteve.com.myapplication.font.RobotoTextView
android:id="#+id/userlocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Syracuse, New York"
android:layout_gravity="center"
android:textColor="#color/black"
android:textSize="14dp"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.1dp"
android:background="#color/material_purple_500"
android:layout_marginTop="25dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_marginTop="5dp">
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="256"
android:textColor="#color/black"
android:textStyle="bold"
android:textSize="16dp" />
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="LIKES"
android:textSize="12sp"/>
</LinearLayout>
<View
android:layout_width="0.1dp"
android:layout_height="50dp"
android:background="#color/material_purple_500"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_marginTop="5dp"
>
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2,080"
android:textColor="#color/black"
android:textStyle="bold"
android:textSize="16dp" />
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="FOLLOWERS"
android:textSize="12sp"/>
</LinearLayout>
<View
android:layout_width="0.1dp"
android:layout_height="50dp"
android:background="#color/material_purple_500"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:gravity="center"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp">
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="144"
android:textColor="#color/black"
android:textStyle="bold"
android:textSize="16dp" />
<zesteve.com.myapplication.font.RobotoTextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:text="FOLLOWING"
android:textSize="12sp"/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.1dp"
android:background="#color/material_purple_500" />
<include layout="#layout/profile_tab_layout"/>
</LinearLayout>
</ScrollView>
</RelativeLayout>
and included layout is
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="40dp"
app:tabGravity="fill"
app:tabMode="fixed"
style="#style/NavigationTab"
android:background="?attr/colorPrimary"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/ptab_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
IMAGE
this result is second approach using include. its showing tab's and fragments also, but if we scroll top rest of the content will show.
I implemented parallax effect in my app with nested scrollview and toolbar everything goes fine. but when i install my app in lollipop version then UI is change and toolbar is not display. it properly display in other versions of android.
my code: main xml file
<android.support.design.widget.CoordinatorLayout
android:id="#+id/layout_event_details"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#android:color/white"
android:layout_above="#+id/Confirmation_relativelayout"
android:fitsSystemWindows="true" >
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true" >
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar_event_details"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:fitsSystemWindows="true"
android:minHeight="?attr/actionBarSize"
app:contentScrim="#android:color/transparent"
app:expandedTitleMarginStart="5dp"
app:expandedTitleTextAppearance="#style/TransparentText"
app:statusBarScrim="#android:color/black" >
<android.support.v4.widget.NestedScrollView
android:id="#+id/scrollView"
android:layout_width="fill_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:layout_height="wrap_content">
<LinearLayout
android:id="#+id/main_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#color/white"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="#+id/Main_Relative_layout"
android:layout_marginTop="?attr/actionBarSize"
android:layout_marginBottom="10dp"
>
<com.oi.managemygroup.util.SelectableRoundedImageView
android:id="#+id/imageView_event_image_aedl"
android:layout_width="90dp"
android:layout_height="90dp"
android:src="#drawable/ic_default_event_new"
android:contentDescription="#string/app_name"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
app:sriv_left_bottom_corner_radius="#dimen/corner_radius_for_ask_option"
app:sriv_left_top_corner_radius="#dimen/corner_radius_for_ask_option"
app:sriv_right_bottom_corner_radius="#dimen/corner_radius_for_ask_option"
app:sriv_right_top_corner_radius="#dimen/corner_radius_for_ask_option" />
<TextView
android:id="#+id/textView_event_name_aedl"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_margin="20dp"
android:layout_toRightOf="#+id/imageView_event_image_aedl"
android:text="TextView"
android:singleLine="false"
android:textColor="#android:color/black"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView_Event_participated_count_aedl"
android:layout_width="25dp"
android:layout_height="23dp"
android:text="8"
android:background="#drawable/ic_responsecount"
android:textColor="#android:color/white"
android:textSize="14sp"
android:maxLength="3"
android:gravity="center"
android:textAlignment="gravity"
android:textStyle="bold"
android:layout_alignParentRight="true"
android:layout_alignRight="#+id/textView_event_name_aedl"
android:layout_marginLeft="2dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"/>
<TextView
android:id="#+id/textView_Event_total_count_aedl"
android:layout_width="25dp"
android:layout_height="23dp"
android:text="10"
android:background="#drawable/ic_response_count_gray"
android:textColor="#android:color/white"
android:textSize="14sp"
android:maxLength="3"
android:layout_marginLeft="2dp"
android:gravity="center"
android:textAlignment="gravity"
android:textStyle="bold"
android:layout_below="#+id/textView_Event_participated_count_aedl"
android:layout_alignParentRight="true"
android:layout_alignRight="#+id/textView_event_name_aedl"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
/>
<View
android:id="#+id/view1"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_marginTop="10dp"
android:layout_below="#+id/imageView_event_image_aedl"
android:background="#E8E8E8" />
</RelativeLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<include
android:id="#+id/toolbar_event_details"
layout="#layout/toolbar_eventdetails_screen" />
<!-- </RelativeLayout> -->
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
....
....
</android.support.design.widget.CoordinatorLayout>
Tool bar xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
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="?attr/actionBarSize"
android:layout_gravity="top"
app:layout_collapseMode="pin"
android:background="#android:color/white"
android:minHeight="?attr/actionBarSize"
style="#style/AppCompatTheme.Toolbar"
app:titleTextAppearance="#style/Toolbar.TitleText"
android:windowBackground="#android:color/white">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/back_button"
android:src="#drawable/ic_back_arrow"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:padding="5dp"
/>
<TextView
android:id="#+id/textView_actionbar_heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text=""
android:textColor="#android:color/white"
android:layout_centerVertical="true"
android:ellipsize="end"
android:singleLine="true"
android:layout_toRightOf="#+id/back_button"
android:textSize="19sp"
/>
</RelativeLayout>
</android.support.v7.widget.Toolbar>
i solved this issue by updating android support library.