Android layout - NestedScrollView is overlapping AppBarLayout - android

I am newbie in Android and following tutorial from - https://appsnipp.com/free-android-profile-design-with-source-code/ to build a profile page. I have converted this code to Androidx compatible. But somehow NestedScrollView is overlapping AppBarLayout .. need a help to figure out how can I fix the issue.
activity_consultant_profile.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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"
android:fitsSystemWindows="true"
tools:context=".activity.ConsultantDetails"
android:background="#color/profileBackground">
<com.google.android.material.appbar.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.AppBarOverlay"
tools:ignore="MissingConstraints">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="#+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="#color/profilePrimaryDark"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:toolbarId="#+id/toolbar"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:expandedTitleTextAppearance="#style/TransparentText">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical"
android:id="#+id/linearLayout"
android:background="#drawable/profile_bk">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/profile_round" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="\#appsnippuser"
android:textSize="28dp"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="developer#appsnipp.com"
android:textSize="12dp"
android:textStyle="bold"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_gravity="bottom"
android:layout_marginTop="20dp"
android:background="#color/profileBackground">
<View
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="30dp"
android:background="#drawable/profile_bk"/>
<TextView
android:text="Back to\nHome"
style="#style/profileStyledBackButton" />
</RelativeLayout>
</LinearLayout>
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/AppTheme.PopupOverlay" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="#layout/activity_consultant_details" />
</androidx.constraintlayout.widget.ConstraintLayout>
activity_consultant_details.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#id/app_bar"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
app:behavior_overlapTop="64dp"
tools:context=".activity.ConsultantDetails"
tools:showIn="#layout/content_activity_consultant_profile">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<TextView
style="#style/headerText"
android:text="Account Info"
android:layout_marginBottom="20dp"/>
<RelativeLayout style="#style/profileDetailsLayout">
<ImageView
android:id="#+id/nameImageView"
android:src="#drawable/ic_name"
style="#style/profileDetailsImage" />
<TextView
android:id="#+id/nameTextView"
android:text="Name"
android:layout_toRightOf="#id/nameImageView"
style="#style/profileDetailsTextMain" />
<TextView
android:id="#+id/consultantName"
android:layout_toRightOf="#id/nameImageView"
style="#style/profileDetailsMiniText" />
</RelativeLayout>
<View style="#style/proifleDetailsView" />
<RelativeLayout style="#style/profileDetailsLayout">
<ImageView
android:id="#+id/mobileImageView"
android:src="#drawable/ic_mobile"
style="#style/profileDetailsImage" />
<TextView
android:text="Mobile"
android:layout_toRightOf="#id/mobileImageView"
style="#style/profileDetailsTextMain"/>
<TextView
android:text="+91-8129999999"
android:layout_toRightOf="#id/mobileImageView"
style="#style/profileDetailsMiniText" />
</RelativeLayout>
<View style="#style/proifleDetailsView" />
<RelativeLayout style="#style/profileDetailsLayout">
<ImageView
android:id="#+id/emailImageView"
android:src="#drawable/ic_email"
style="#style/profileDetailsImage" />
<TextView
android:text="Email"
android:layout_toRightOf="#id/emailImageView"
style="#style/profileDetailsTextMain" />
<TextView
android:text="developer#appsnipp.com"
android:layout_toRightOf="#id/emailImageView"
style="#style/profileDetailsMiniText" />
</RelativeLayout>
<View style="#style/proifleDetailsView" />
<RelativeLayout style="#style/profileDetailsLayout">
<ImageView
android:id="#+id/addressImageView"
android:src="#drawable/ic_address"
style="#style/profileDetailsImage" />
<TextView
android:text="Address"
android:layout_toRightOf="#id/addressImageView"
style="#style/profileDetailsTextMain" />
<TextView
android:text="Avenue 2nd Street NW SY."
android:layout_toRightOf="#id/addressImageView"
style="#style/profileDetailsMiniText" />
</RelativeLayout>
<View style="#style/proifleDetailsView" />
<RelativeLayout style="#style/profileDetailsLayout">
<ImageView
android:id="#+id/dobImageView"
android:src="#drawable/ic_dob"
style="#style/profileDetailsImage" />
<TextView
android:text="D.O.B"
android:layout_toRightOf="#id/dobImageView"
style="#style/profileDetailsTextMain" />
<TextView
android:text="12-05-1990"
android:layout_toRightOf="#id/dobImageView"
style="#style/profileDetailsMiniText" />
</RelativeLayout>
<View style="#style/proifleDetailsView" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
Output shows like this:
Expected output

Replace Constraint Layout with Coordinator Layout and it would work fine.

Related

Scroll toolbar along with fragment in a drawer layout

I want to scroll tollbar while scrolling fragment in drawer layout.
Below is my xml layouts:
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data></data>
<androidx.drawerlayout.widget.DrawerLayout
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimary"
android:elevation="0dp"
android:keepScreenOn="true"
app:elevation="0dp"
tools:context=".ui.activities.CulpabilityHome">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/llOutertwo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/_70sdp"
android:layout_marginBottom="#dimen/_70sdp"
android:background="#color/red"
android:orientation="horizontal"
android:visibility="visible" />
<LinearLayout
android:id="#+id/llOuterone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="#dimen/_10sdp"
android:layout_marginTop="#dimen/_40sdp"
android:layout_marginBottom="#dimen/_40sdp"
android:background="#color/black"
android:orientation="horizontal"
android:visibility="visible" />
<LinearLayout
android:id="#+id/llToolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/gray_bg"
android:orientation="vertical">
<include
android:id="#+id/navHeader"
layout="#layout/layout_home_toolbar" />
<View
android:layout_width="match_parent"
android:layout_height="#dimen/_1sdp"
android:background="#color/gray_bg" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/bottomNavigation"
android:layout_width="match_parent"
android:layout_height="#dimen/_40sdp"
android:layout_gravity="bottom"
android:background="#color/white"
android:gravity="center_vertical|center_horizontal"
android:orientation="horizontal">
<ImageView
android:id="#+id/home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/_5sdp"
android:layout_marginEnd="#dimen/_5sdp"
android:layout_weight="0.25"
android:padding="#dimen/_10sdp"
android:src="#mipmap/home"
tools:ignore="RtlCompat" />
<ImageView
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/_5sdp"
android:layout_weight="0.25"
android:padding="#dimen/_10sdp"
android:src="#mipmap/map"
tools:ignore="RtlCompat" />
<ImageView
android:id="#+id/myVideo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/_5sdp"
android:layout_weight="0.25"
android:padding="#dimen/_10sdp"
android:src="#drawable/ic_my_video"
tools:ignore="RtlCompat" />
<!-- <ImageView-->
<!-- android:id="#+id/chat"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="#dimen/_5sdp"-->
<!-- android:layout_marginEnd="#dimen/_5sdp"-->
<!-- android:layout_weight="0.25"-->
<!-- android:padding="#dimen/_10sdp"-->
<!-- android:src="#mipmap/chats_icon"-->
<!-- tools:ignore="RtlCompat" />-->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.25">
<ImageView
android:id="#+id/notification"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/_5sdp"
android:layout_marginEnd="#dimen/_5sdp"
android:padding="#dimen/_10sdp"
android:src="#mipmap/notification"
tools:ignore="RtlCompat" />
<TextView
android:id="#+id/txtNotificationCountBadge"
android:layout_width="#dimen/_17sdp"
android:layout_height="#dimen/_17sdp"
android:layout_gravity="top"
android:layout_marginStart="50dp"
android:layout_marginTop="3dp"
android:layout_marginEnd="-5dp"
android:background="#drawable/circle_notification_badge"
android:gravity="center"
android:text="99+"
android:textColor="#android:color/white"
android:textSize="9sp"
android:visibility="gone"
tools:visibility="visible" />
</FrameLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="#dimen/_1sdp"
android:background="#color/gray_bg" />
<FrameLayout
android:id="#+id/home_fram"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
</ScrollView>
</LinearLayout>
</FrameLayout>
<com.google.android.material.navigation.NavigationView
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#color/colorPrimary"
android:fitsSystemWindows="true"
app:elevation="0dp"
app:headerLayout="#layout/nav_header_main"
app:itemBackground="#android:color/transparent"
app:itemIconTint="#color/white"
app:itemTextColor="#color/white"
app:itemVerticalPadding="#dimen/_12sdp"
app:menu="#menu/activity_main_drawer">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical"
android:padding="#dimen/_16sdp">
<TextView
android:id="#+id/txtVersion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="#font/gt_walsheim_pro_light"
android:gravity="start"
android:text="#string/app_version"
android:textColor="#color/white"
android:textSize="#dimen/_10sdp" />
</LinearLayout>
</com.google.android.material.navigation.NavigationView>
</androidx.drawerlayout.widget.DrawerLayout>
</layout>
layout_home_toolbar.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways">
<androidx.appcompat.widget.Toolbar
android:id="#+id/mainTool"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:background="#color/white"
android:contentInsetStart="0dp"
android:contentInsetLeft="0dp"
android:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/HeaderToolLogo"
android:layout_width="#dimen/_32sdp"
android:layout_height="#dimen/_32sdp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginStart="#dimen/_10sdp"
android:src="#mipmap/culpa_header_icon"
app:civ_border_color="#color/colorPrimary"
app:civ_border_width="#dimen/_1sdp" />
<TextView
android:id="#+id/HeaderToolText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:fontFamily="#font/gt_walsheim_pro_medium"
android:text="#string/home"
android:textColor="#color/colorPrimary"
android:textSize="#dimen/_15ssp" />
<ImageView
android:id="#+id/search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="#dimen/_5sdp"
android:layout_toStartOf="#+id/chat"
android:padding="#dimen/_5sdp"
android:src="#mipmap/search_home"
app:tint="#color/colorPrimary"
tools:ignore="RtlCompat" />
<ImageView
android:id="#+id/chat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginStart="#dimen/_5sdp"
android:layout_marginEnd="#dimen/_5sdp"
android:layout_weight="0.25"
android:padding="#dimen/_5sdp"
android:src="#mipmap/chats_icon"
app:tint="#color/colorPrimary"
tools:ignore="RtlCompat" />
</RelativeLayout>
</androidx.appcompat.widget.Toolbar>
</LinearLayout>
I want to make toolbar hide while user scroll content like facebook.
I also tried to Appbarlayout but its not working so please help me to solve this issue.
Thanks in advance

How To Hide AppBar When Scrolling Down

I have an AppBar and other things in my layout. When the user scrolls down, I want AppBar(actually, the Toolbar to hide. This is what I have tried, the app bar isn't hiding all small part it just stays there. Actually I think the problem is with my header of the screen it gets collapsed and adds a small space when I scroll.
As you can see in second image some part stays it doesn't hide. I need to hide that part while scrolling.
Please provide me solution what am I doing wrong?
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white">
<com.google.android.material.appbar.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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/slideIV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/ic_dish" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/bottomButtonRL"
android:layout_gravity="bottom"
android:background="#drawable/gradient_bg" />
<View style="#style/itemBottomViewLarge" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="#dimen/_20"
android:gravity="center_vertical"
android:orientation="vertical">
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="80dp"
android:layout_height="80dp"
android:src="#drawable/fake_chef_bg"
app:civ_border_color="#color/border_grey_color"
app:civ_border_width="#dimen/_2" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/_5"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/bold_font"
android:text="#string/fatima_al_zahraa"
android:textColor="#color/white"
android:textSize="#dimen/large_text_size"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:fontFamily="#font/regular_font"
android:text="#string/presenter_of_the_cuient"
android:textColor="#color/white"
android:textSize="#dimen/app_text_size" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:id="#+id/bottomButtonRL"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="#+id/slideIV"
android:layout_marginTop="-25dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="#dimen/_0"
android:layout_weight="1" />
<View
android:layout_width="match_parent"
android:layout_height="#dimen/_0"
android:layout_weight="1"
android:background="#color/defaultColor" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="#dimen/_20"
android:paddingLeft="#dimen/_20">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/ic_share" />
<RelativeLayout
android:layout_width="220dp"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/_10"
android:layout_marginLeft="#dimen/_10"
android:background="#drawable/ic_rec1">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="#font/regular_font"
android:gravity="center"
android:layout_centerInParent="true"
android:text="#string/add_to_fav"
android:textColor="#color/white"
android:textSize="#dimen/medium_text_size" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/bottom_radius_view">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/regular_font"
android:padding="#dimen/_20"
android:text="#string/galetes_fires_au_plates_fires_au_plates_fires_au_plates_fires_au_plates_fires_au_plates"
android:textColor="#color/white"
android:textSize="#dimen/app_text_size" />
</LinearLayout>
</LinearLayout>
<androidx.appcompat.widget.Toolbar
android:visibility="gone"
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
/>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.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:paddingLeft="#dimen/_20"
android:paddingTop="#dimen/_10"
android:paddingRight="#dimen/_20">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="#font/bold_font"
android:padding="#dimen/_5"
android:text="#string/les_videos"
android:textColor="#color/medium_grey_text_color"
android:textSize="#dimen/large_text_size" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/itemFRV"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/_5" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
This is the header code:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="#dimen/header_height"
android:background="#color/white"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="#dimen/_20"
android:paddingRight="#dimen/_20">
<LinearLayout
android:id="#+id/backLL"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="left"
android:gravity="center"
android:paddingRight="#dimen/_20"
android:layout_marginBottom="#dimen/_10"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/ic_back" />
</LinearLayout>
<ImageView
android:id="#+id/logoIV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:adjustViewBounds="true"
android:paddingStart="0dp"
android:paddingTop="#dimen/_15"
android:paddingEnd="#dimen/_10"
android:layout_marginBottom="#dimen/_10"
android:src="#drawable/ic_header_logo" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageView
android:id="#+id/profileIV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:adjustViewBounds="true"
android:paddingStart="#dimen/_10"
android:paddingTop="#dimen/_15"
android:paddingEnd="0dp"
android:layout_marginBottom="#dimen/_10"
android:src="#drawable/ic_default_user" />
</LinearLayout>
</layout>
Answer to the problem is just remove
android:fitsSystemWindows="true"
Change the layout_scrollFlags
app:layout_scrollFlags="scroll|exitUntilCollapsed"
replace above line with
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"

How can I add top drawer and bottom navigation in android activity?

How to add top drawer and bottom tab navigation in whole application?
I tried to combine 2 activity in android studio and its causing design issue. Its not working
For the bottom navigation
https://developer.android.com/reference/android/support/design/widget/BottomNavigationView
For Top drawer exaplain a little what exactly you want
You can achieve this throughout your whole Project in this way.
Use this as an activity_main.xml like as your MainActivity.java class.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="#layout/app_bar_home"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:layout_width="#dimen/dp_180"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/top_lay"
android:layout_width="match_parent"
android:layout_height="#dimen/nav_header_height"
android:background="#color/colorPrimary"
android:orientation="vertical"
android:theme="#style/ThemeOverlay.AppCompat.Dark">
<RelativeLayout
android:id="#+id/userimageLay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<com.team.helperclasses.CircleImageView
android:id="#+id/userimage"
android:layout_width="#dimen/dp_100"
android:layout_height="#dimen/dp_100"
android:src="#mipmap/side_menu_profile_"
app:civ_border_color="#color/colorPrimary"
app:civ_border_overlay="true"
app:civ_border_width="1dp" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/editProfile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/top_lay"
android:paddingBottom="#dimen/dp_5"
android:paddingTop="#dimen/dp_5">
<TextView
android:id="#+id/editProfileText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/editProfileImage"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/dp_8"
android:text="#string/editProfile"
android:textColor="#color/dull_black"
android:textSize="#dimen/sp_18" />
<ImageView
android:id="#+id/editProfileImage"
android:layout_width="#dimen/dp_45"
android:layout_height="#dimen/dp_45"
android:layout_centerHorizontal="true"
android:src="#mipmap/side_menu_profile" />
</RelativeLayout>
<View
android:id="#+id/editProfiledivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#+id/editProfile"
android:background="#color/light_black" />
<RelativeLayout
android:id="#+id/sharedWall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/editProfile"
android:paddingBottom="#dimen/dp_5"
android:paddingTop="#dimen/dp_5">
<TextView
android:id="#+id/sharedWallText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/shareWallImage"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/dp_8"
android:text="#string/sharedWall"
android:textColor="#color/dull_black"
android:textSize="#dimen/sp_18" />
<ImageView
android:id="#+id/shareWallImage"
android:layout_width="#dimen/dp_45"
android:layout_height="#dimen/dp_45"
android:layout_centerHorizontal="true"
android:src="#mipmap/wall" />
</RelativeLayout>
<View
android:id="#+id/shareWallDivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#+id/sharedWall"
android:background="#color/light_black" />
<RelativeLayout
android:id="#+id/changeLang"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/shareWallDivider"
android:paddingBottom="#dimen/dp_5"
android:paddingTop="#dimen/dp_5">
<TextView
android:id="#+id/changeLangText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/changeLangImage"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/dp_8"
android:text="#string/changeLanguage"
android:textColor="#color/dull_black"
android:textSize="#dimen/sp_18" />
<ImageView
android:id="#+id/changeLangImage"
android:layout_width="#dimen/dp_45"
android:layout_height="#dimen/dp_45"
android:layout_centerHorizontal="true"
android:src="#mipmap/language" />
</RelativeLayout>
<View
android:id="#+id/changeLangdivider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#+id/changeLang"
android:background="#color/light_black" />
<RelativeLayout
android:id="#+id/logout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/changeLangdivider"
android:paddingBottom="#dimen/dp_5"
android:paddingTop="#dimen/dp_5">
<TextView
android:id="#+id/logoutText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/logoutImage"
android:layout_centerHorizontal="true"
android:layout_marginTop="#dimen/dp_8"
android:text="#string/logout"
android:textColor="#color/dull_black"
android:textSize="#dimen/sp_18" />
<ImageView
android:id="#+id/logoutImage"
android:layout_width="#dimen/dp_45"
android:layout_height="#dimen/dp_45"
android:layout_centerHorizontal="true"
android:src="#mipmap/log_out" />
</RelativeLayout>
</RelativeLayout>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
& the Layout app_bar_home.xml looks like this.
<?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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.team.activities.Home">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="ltr"
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:title="#string/app_name"
app:popupTheme="#style/AppTheme.PopupOverlay"
app:theme="#style/ToolBarStyle">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/search"
android:gravity="left"
android:text="#string/app_name"
android:textColor="#color/black"
android:textSize="#dimen/sp_22" />
<ImageView
android:id="#+id/searchHome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="#+id/notificationLay"
android:src="#mipmap/search" />
<RelativeLayout
android:id="#+id/notificationLay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="#dimen/dp_5">
<ImageView
android:id="#+id/notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="#dimen/dp_5"
android:src="#mipmap/notification" />
<ImageView
android:id="#+id/notify"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/notification"
android:padding="#dimen/dp_5"
android:src="#drawable/counter_bg" />
</RelativeLayout>
</RelativeLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_home" />
</android.support.design.widget.CoordinatorLayout>
& content_home.xml in which you can define the things as per your requirement in the application.
<?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:id="#+id/content_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.team.activities.Home"
tools:showIn="#layout/app_bar_home">
<RelativeLayout
android:id="#+id/fragment_space"
android:name="com.presence.fragments.HomeFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/bottom_lay" />
<LinearLayout
android:id="#+id/bottom_lay"
android:layout_width="match_parent"
android:layout_height="#dimen/dp_50"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:background="#color/colorPrimary"
android:layoutDirection="ltr"
android:orientation="horizontal">
<RelativeLayout
android:id="#+id/tab_create"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="#+id/image_create"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/text_create"
android:layout_centerHorizontal="true"
android:src="#mipmap/create" />
<TextView
android:id="#+id/text_create"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="#string/create"
android:textColor="#color/white"
android:textSize="#dimen/sp_10" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/tab_received"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="#+id/image_received"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/text_received"
android:layout_centerHorizontal="true"
android:src="#mipmap/recived" />
<TextView
android:id="#+id/text_received"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="#string/received"
android:textColor="#color/white"
android:textSize="#dimen/sp_10" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/tab_sent"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="#+id/image_sent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/text_sent"
android:layout_centerHorizontal="true"
android:src="#mipmap/sent" />
<TextView
android:id="#+id/text_sent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="#string/sent"
android:textColor="#color/white"
android:textSize="#dimen/sp_10" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/tab_website"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="#+id/image_website"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/text_travel"
android:layout_centerHorizontal="true"
android:src="#mipmap/web" />
<TextView
android:id="#+id/text_travel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="#string/booking"
android:textColor="#color/white"
android:textSize="#dimen/sp_10" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
Try this hope it helps you.

Changing from one view to another view onScroll

I am working a project. I have a a layout with a view at top and a Scrollview at the bottom of the view. Initially the layout will look like this.
After I scroll up the bottom layout. The view should smoothly change the the below view. And if I scroll down the view should come back to its previous layout.
As you can see there is a change in the position and size of the textviews. How can I achieve this ?
Here is the layout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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/home_parentLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:animateLayoutChanges="true"
android:background="#color/AT_charcoal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginBottom="9dp"
android:background="#drawable/topographybackgroundx">
<RelativeLayout
android:id="#+id/layout_header_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp">
<RelativeLayout
android:id="#+id/top_ExpandedHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageButton
android:id="#+id/image_invisalignLogo"
android:layout_width="108dp"
android:layout_height="26dp"
android:background="#drawable/invis_logo"
android:contentDescription="#null" />
<ImageButton
android:id="#+id/image_profile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:background="#drawable/ic_profile_wht"
android:contentDescription="#null" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/number_RelativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:id="#+id/layout_aligner_expanded_change"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp">
<TextView
android:id="#+id/image_alignerNumber"
style="#style/BigNumber"
android:layout_width="wrap_content"
android:layout_height="138dp"
android:layout_alignParentStart="true"
android:layout_below="#+id/textview_alignerTimeChange"
android:maxLength="2"
android:maxLines="1"
android:text="#string/three"
android:textSize="124sp" />
<TextView
android:id="#+id/textview_alignerChange"
style="#style/BodyWhite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="80dp"
android:layout_toEndOf="#id/image_alignerNumber"
android:letterSpacing="0.03"
android:text="#string/days_alignerchange" />
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/image_selfie_icon"
android:layout_width="96dp"
android:layout_height="96dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
app:civ_border_color="#FFFFFFFF"
app:civ_border_width="2dp" />
<TextView
android:id="#+id/textview_6alignerNumber"
style="#style/HeaderWhite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#id/image_alignerNumber"
android:layout_below="#id/image_alignerNumber"
android:layout_marginTop="2dp"
android:letterSpacing="0.03"
android:text="#string/aligner_number" />
<TextView
android:id="#+id/textview_expanalignerNumber"
style="#style/HeaderWhite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/image_alignerNumber"
android:layout_toEndOf="#id/textview_6alignerNumber"
android:text="5" />
<TextView
android:id="#+id/textview_alignerTimeChange"
style="#style/LargeHeaderWhite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="17dp"
android:letterSpacing="0.03"
android:text="#string/aligner_change"
android:visibility="gone" />
<Button
android:id="#+id/button_change"
style="#style/TextButtonWhite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/textview_alignerTimeChange"
android:layout_marginTop="15dp"
android:background="#color/AT_lushGreen"
android:gravity="center_vertical"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:text="#string/changenow"
android:visibility="gone" />
</RelativeLayout>
<View
android:id="#+id/dividerline"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_below="#id/number_RelativeLayout"
android:layout_marginTop="12dp"
android:background="#color/AT_line" />
<TextView
android:id="#+id/addPhoto_TextView"
style="#style/BtnTextBlue18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/dividerline"
android:layout_marginTop="10dp"
android:text="#string/add_photo" />
<TextView
android:id="#+id/goCalendar_TextView"
style="#style/BtnTextGold18"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_below="#id/dividerline"
android:layout_marginTop="7dp"
android:text="#string/go_calendar" />
</RelativeLayout>
</RelativeLayout>
<include
layout="#layout/homescreen_scrollview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/layout_header_profile"
android:layout_marginTop="15dp" />
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
You can use the Collapsing Toolbar Layout
Example Here and here
Edit: some piece of code
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:contentScrim="?attr/colorPrimary">
<ImageView
android:id="#+id/expandedImage"
android:layout_width="match_parent"
android:layout_height="200dp"
android:src="#drawable/beach_scene"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"
/>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin" >
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/white"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/sample_string"/>
</android.support.v4.widget.NestedScrollView>
Using a Collapse Tool Bar as João said, your code should be like this
and getting my answer as base from here
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="210dp"
android:background="#color/WHITE">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:collapsedTitleTextAppearance="#style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse"
app:expandedTitleMarginStart="72dp"
app:expandedTitleTextAppearance="#style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<Your Content>
<android.support.v7.widget.Toolbar
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="40dp"
app:layout_collapseMode="pin" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include
layout="#layout/homescreen_scrollview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#id/layout_header_profile"
android:layout_marginTop="15dp" />
On <Your Content> is the place where you should put your string.
Sorry that I can't help more. Your Cody is a little messy and really hard to understand.
Maybe if you edit leaving only the important codes will help.
But maybe this library can help you.

Scrolling to an off screen item in a recycler view with espresso

I'm doing some UI tests using Espresso with an app that was created by someone else and i'm encountering some difficulties.
I need to click on a button in a recycler view. this button is off screen. This is the layout file :
<android.support.design.widget.AppBarLayout
android:id="#+id/activity_asset_profile_appbar_layout"
android:layout_width="match_parent"
android:layout_height="256dp"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleEnabled="true">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:orientation="vertical"
app:layout_scrollFlags="scroll|enterAlways"
android:fitsSystemWindows="true"
app:layout_collapseParallaxMultiplier="0.3">
<RelativeLayout
android:id="#+id/activity_asset_profile_content_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/small_vertical_margin"
android:layout_marginLeft="#dimen/asset_profile_section_title_vertical_margin"
android:layout_marginRight="#dimen/small_horizontal_margin">
<TextView
android:id="#+id/layout_asset_profile_header_name_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/layout_asset_profile_header_serial_number_text_view"
android:layout_alignParentLeft="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:textColor="#android:color/white"
android:textSize="22sp" />
<TextView
android:id="#+id/layout_asset_profile_header_serial_number_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/layout_asset_profile_header_description_text_view"
android:layout_marginTop="3dp"
android:textColor="#android:color/white"
android:textSize="#dimen/big_text_size" />
<TextView
android:id="#+id/layout_asset_profile_header_description_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/item_list_asset_profile_header_photo_image_button"
android:layout_marginTop="5dp"
android:textColor="#android:color/white"
android:textSize="#dimen/medium_text_size" />
<ImageButton
android:id="#+id/item_list_asset_profile_header_photo_image_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginLeft="#dimen/small_horizontal_margin"
android:background="#color/colorPrimary"
android:src="#drawable/ic_camera" />
</RelativeLayout>
</FrameLayout>
<ImageView
android:id="#+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
android:src="#drawable/photo"
android:visibility="gone"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="#+id/activity_asset_profile_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/AppTheme.PopupOverlay" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/activity_asset_profile_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ProgressBar
android:id="#+id/activity_asset_profile_progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
There is also another file with that :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="#+id/item_list_asset_profile_section_title_top_divider_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="#dimen/asset_profile_content_vertical_margin" />
<View
android:layout_width="match_parent"
android:layout_height="#dimen/asset_profile_divider_height"
android:background="#color/divider_background" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="#dimen/asset_profile_section_title_vertical_margin"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin">
<RelativeLayout
android:id="#+id/item_list_asset_profile_section_title_main_rl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/asset_profile_section_title_vertical_margin">
<TextView
android:id="#+id/layout_profile_section_header_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerInParent="true"
android:text="#string/comment_section_header"
android:textColor="#color/base_text"
android:textSize="#dimen/big_text_size"
android:textStyle="bold" />
<ImageButton
android:id="#+id/item_list_asset_profile_section_title_expand_image_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="#dimen/small_horizontal_margin"
android:layout_toRightOf="#+id/layout_profile_section_header_text_view"
android:background="#drawable/selector_white_background"
android:src="#drawable/ic_disclosure_indicator" />
<ImageButton
android:id="#+id/item_list_asset_profile_section_title_add_image_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:background="#drawable/selector_white_background"
android:src="#drawable/ic_asset_profile_add" />
</RelativeLayout>
<LinearLayout
android:id="#+id/item_list_asset_profile_section_title_no_items_ll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="visible">
<TextView
android:id="#+id/item_list_asset_profile_section_title_no_items_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="No labels"
android:textColor="#color/secondary_text"
android:textSize="#dimen/big_text_size" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
As it is not my code, I don't know why there is the need for these two files, so if someone know exactly why... I would love to know.
Here's the part of code that doesn't work :
onView(allOf(withId(R.id.item_list_asset_profile_section_title_add_image_button),hasSibling(withText("Tags"))))
.perform(NestedScrollViewScrollToAction.scrollTo(),click());
I'm using NestedScrollViewScrollViewActions as seen here : https://gist.github.com/miszmaniac/12f720b7e898ece55d2464fe645e1f36
I have tried multiple things found in other topics but none of them solved my problem.
I'm new to this so please be kind and tell me what i could improve in my ask.
Thank you.

Categories

Resources