What I want to achieve is that the cardview is also scrolled up, when the recyclerview (In my xml it's just framelayout but I will later replace it) is scrolled. It is easier to understand with the 2 pictures below.
Not Scrolled
After Scrolling
As you can see from the second picture, the user profile cardview lingers, while I expect it to be scrolled up.
Another problem is that between toolbar and the cardview, there is an empty space line, which you can see in the first picture. I don't know how to remove that.
And the toolbar is also not showing the title, which is set programmatically. No idea why.
This is the xml file. Thanks in advance!
<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:layout_margin="0dp"
android:fitsSystemWindows="true"
app:statusBarBackground="#android:color/transparent">
<android.support.design.widget.AppBarLayout
android:id="#+id/up_app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/transparent"
android:layout_marginBottom="0dp"
android:elevation="4dp"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/up_ctoolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:collapsedTitleGravity="center"
app:contentScrim="#android:color/transparent"
app:expandedTitleGravity="center"
app:layout_behavior="#string/title_activity_scrolling"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleEnabled="true"
app:toolbarId="#+id/up_toolbar">
<ImageView
android:id="#+id/up_header"
android:layout_width="match_parent"
android:layout_height="#dimen/header_height"
android:background="#drawable/nav_background"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="#+id/up_toolbar"
android:layout_width="match_parent"
android:layout_height="#dimen/button_size"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/up_back"
android:layout_width="#dimen/button_size"
android:layout_height="#dimen/button_size"
android:background="#android:color/transparent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_back_white" />
<ImageButton
android:id="#+id/up_search"
android:layout_width="#dimen/button_size"
android:layout_height="#dimen/button_size"
android:background="#android:color/transparent"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_search_white" />
</android.support.constraint.ConstraintLayout>
</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:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="0dp"
android:layout_marginBottom="16dp"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="#+id/up_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="0dp">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/up_usericon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:clickable="true"
android:src="#android:drawable/sym_def_app_icon"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/up_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:maxLines="1"
android:text="Username"
android:textColor="#color/BlackGray"
android:textSize="19sp"
app:layout_constraintStart_toStartOf="#+id/up_usericon"
app:layout_constraintTop_toBottomOf="#+id/up_usericon" />
<TextView
android:id="#+id/up_user_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="#10000000"
app:layout_constraintStart_toStartOf="#+id/up_username"
app:layout_constraintTop_toBottomOf="#+id/up_username" />
<TextView
android:id="#+id/up_intro"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:text="Intro: "
android:textColor="#color/BlackGray"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="#+id/up_user_number"
app:layout_constraintTop_toBottomOf="#+id/up_user_number" />
<TextView
android:id="#+id/up_followers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="28dp"
android:clickable="true"
android:text="Followers: 0"
app:layout_constraintBottom_toBottomOf="#+id/up_following"
app:layout_constraintStart_toEndOf="#+id/up_following" />
<TextView
android:id="#+id/up_following"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:clickable="true"
android:text="Following: 0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="#+id/up_intro"
app:layout_constraintTop_toBottomOf="#+id/up_intro" />
<ImageButton
android:id="#+id/up_message"
android:layout_width="#dimen/button_size"
android:layout_height="#dimen/button_size_small"
android:layout_marginEnd="16dp"
android:background="#drawable/button_border_green"
app:layout_constraintEnd_toStartOf="#+id/up_follow"
app:layout_constraintTop_toTopOf="#+id/up_follow"
app:srcCompat="#drawable/ic_mail" />
<ImageButton
android:id="#+id/up_follow"
android:layout_width="#dimen/button_size"
android:layout_height="#dimen/button_size_small"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="#drawable/button_border_orange"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_follow" />
<ImageButton
android:id="#+id/up_edit"
android:layout_width="#dimen/button_size"
android:layout_height="#dimen/button_size_small"
android:layout_marginEnd="16dp"
android:background="#drawable/button_border_orange"
app:layout_constraintEnd_toStartOf="#+id/up_message"
app:layout_constraintTop_toTopOf="#+id/up_message"
app:srcCompat="#drawable/ic_edit" />
<ImageView
android:id="#+id/up_gender"
android:layout_width="#dimen/icon_size_small"
android:layout_height="#dimen/icon_size_small"
android:layout_marginStart="8dp"
app:layout_constraintBottom_toBottomOf="#+id/up_user_number"
app:layout_constraintStart_toEndOf="#+id/up_user_number"
app:layout_constraintTop_toTopOf="#+id/up_user_number"
app:srcCompat="#drawable/ic_male" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
<android.support.constraint.ConstraintLayout
android:id="#+id/posts_sort_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
<TextView
android:id="#+id/up_posts"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:gravity="center_vertical"
android:text="Posts: 0"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<Button
android:id="#+id/up_sortby_button"
style="#style/Widget.AppCompat.Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:background="#android:color/transparent"
android:drawableRight="#drawable/ic_down_blue"
android:text="#string/sort_by"
android:textAllCaps="false"
android:textColor="#color/design_default_color_primary"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
</android.support.constraint.ConstraintLayout>
<FrameLayout
android:id="#+id/up_timeline"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
Related
This is the top of my activitys XML -
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_product_page_root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:id="#+id/activity_product_page_appbarlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_scrollFlags="scroll|enterAlways">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/activity_product_page_top_product_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="#+id/activity_product_page_back_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/marketplace_14dp"
android:layout_marginEnd="#dimen/marketplace_14dp"
android:contentDescription="#string/marketplace_productvendor_page_back_button"
android:onClick="backButtonPressed"
android:src="#drawable/arrow_left"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/activity_product_page_vendor_icon_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/marketplace_14dp"
android:layout_marginEnd="#dimen/marketplace_14dp"
android:contentDescription="#string/marketplace_productvendor_page_vendor_image"
android:scaleType="centerCrop"
android:src="#mipmap/ic_launcher"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:layout_width="200dp" />
<FrameLayout
android:id="#+id/activity_product_page_shopping_cart_framelayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/marketplace_14dp"
android:layout_marginEnd="#dimen/marketplace_14dp"
android:background="#color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="#+id/activity_checkout_cart_imageView"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_margin="20dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:src="#drawable/icons_32_x_32_black_shopping_cart" />
<TextView
android:id="#+id/activity_product_page_shopping_cart_counter"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="end"
android:layout_marginTop="5dp"
android:layout_marginEnd="3dp"
android:background="#drawable/textview_round_background"
android:elevation="1dp"
android:gravity="center"
android:maxLines="1"
android:textAlignment="center"
android:textColor="#color/white"
android:textSize="10sp"
android:textStyle="bold"
android:visibility="gone"
app:autoSizeMaxTextSize="16sp"
app:autoSizeMinTextSize="10sp"
app:autoSizeStepGranularity="2sp"
app:layout_constraintStart_toEndOf="#+id/activity_checkout_cart_imageView"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="SmallSp"
tools:text="1"
tools:visibility="visible" />
</FrameLayout>
<View
android:id="#+id/activity_shopping_cart_top_view"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/marketplace_view_line_color"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
The issue I am facing now is the fact that all views inside the Constraint Layout that is inside my CollapsingToolbarLayout are not clickable.
I have checked multiple questions on this subject and none helped me - some suggested to make a custom Toolbar class that overrides onTouchEvent() to false always but when I try to use this class it does not show in the XML editor for some reason.
Other solutions I have found accross the net did not provide me with any usefull solutions.
So how can I make the nested views clickable?
Solved, I added the following line to my CollapsingToolbarLayout -
android:descendantFocusability="blocksDescendants"
I have an activity layout that consists of:
A sticky non-collapsing Toolbar on the top of the page
A NestedScrollView that contains two headers for two RecyclerViews
A ConstraintLayout to position the items inside NestedScrollView
Two RecyclerViews
The XML file is below:
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<com.google.android.material.appbar.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorWhite"
app:contentInsetEnd="0dp"
app:contentInsetStart="0dp"
app:layout_scrollFlags="enterAlways"
app:popupTheme="#style/Theme.AppCompat.Light">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/backButton"
style="#style/Icon"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_2" />
<View
android:id="#+id/view13"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:background="#drawable/bg_white_ellipse_with_border"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/backButton"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/imageView21"
style="#style/Icon"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toBottomOf="#+id/view13"
app:layout_constraintStart_toStartOf="#+id/view13"
app:layout_constraintTop_toTopOf="#+id/view13"
app:srcCompat="#drawable/ic_1" />
<EditText
android:id="#+id/searchField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:background="#color/fui_transparent"
android:ems="10"
android:hint="Type something"
android:imeOptions="actionSearch"
android:inputType="text"
android:maxLines="1"
app:layout_constraintBottom_toBottomOf="#+id/view13"
app:layout_constraintStart_toEndOf="#+id/imageView21"
app:layout_constraintTop_toTopOf="#+id/view13" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id="#+id/scrollView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="#+id/view8"
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="#color/colorLightGray"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="#+id/view9"
android:layout_width="match_parent"
android:layout_height="5dp"
android:background="#color/colorLightGray"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/rv1" />
<View
android:id="#+id/view12"
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_marginBottom="16dp"
android:background="#color/colorLightGray"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/rv2" />
<TextView
android:id="#+id/textView21"
style="#style/HeadingText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="Dishes"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view8" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rv1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView21" />
<TextView
android:id="#+id/textView8"
style="#style/HeadingText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="Restaurants"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view9" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rv2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/view12"
app:layout_constraintTop_toBottomOf="#+id/textView8" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
The toolbar is fixed at the top of the page as I wanted. Everything scrolls correctly. However, I can't scroll until the end of the NestedScrollView, i.e. the item was cut off and I cannot scroll to the last item in the second RecyclerView. How do I fix this?
For some reason, this attribute android:fillViewport="true" on CoordinatorLayout caused it to break. Removing that attribute corrects everything.
I'm having some trouble with a partly hidden RecyclerView on the small devices below 5.5" (Nexus, A3, etc...)
Once the feed's loaded, and added to the adapter items, all the children of the CoordinatorLayout moved up.
You can see the demo here
Here's the hierarchy of the view:
CoordinatorLayout
AppBarLayout
LiveCollapsingToolbarLayout
CardView
ConstraintLayout
SmoothRecyclerView
And here the main layout:
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/live_main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="#dimen/home_header_height_reduced"
android:fitsSystemWindows="true">
<com.radiofrance.radio.francebleu.android.view.toolbar.LiveCollapsingToolbarLayout
android:id="#+id/live_collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:minHeight="?attr/actionBarSize"
app:contentScrim="#color/bleu_primary"
app:expandedTitleTextAppearance="#android:color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:importantForAccessibility="noHideDescendants"
app:layout_collapseMode="parallax">
<ImageView
android:id="#+id/live_weather_cover"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop" />
<com.radiofrance.radio.francebleu.android.fonts.FontTextView
android:id="#+id/live_date"
style="#style/HomeDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="#+id/live_ephemeris"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintVertical_bias="0.6"
tools:text="#tools:sample/date/day_of_week" />
<com.radiofrance.radio.francebleu.android.fonts.FontTextView
android:id="#+id/live_ephemeris"
style="#style/HomeEphemeride"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="#+id/live_weather"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/live_date"
app:layout_constraintVertical_bias="1.0"
tools:text="St Guy" />
<com.radiofrance.radio.francebleu.android.fonts.FontTextView
android:id="#+id/live_weather"
style="#style/HomeTemperature"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="0dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/live_ephemeris"
app:layout_constraintVertical_bias="0.7"
tools:text="14°" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin">
<com.radiofrance.radio.francebleu.android.fonts.FontTextView
android:id="#+id/live_toolbar_title"
style="#style/TextHomeToolbarTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/app_name"
android:textColor="#color/white" />
</androidx.appcompat.widget.Toolbar>
</com.radiofrance.radio.francebleu.android.view.toolbar.LiveCollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.cardview.widget.CardView
android:id="#+id/live_card_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/home_live_card_horizontal_margin"
android:layout_marginEnd="#dimen/home_live_card_horizontal_margin"
app:behavior_overlapTop="48dp"
app:cardElevation="3.8dp"
app:cardPreventCornerOverlap="#bool/card_overlap"
app:cardUseCompatPadding="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/live_card_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:importantForAccessibility="yes">
<androidx.appcompat.widget.AppCompatImageView
android:id="#+id/live_card_cover"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="centerCrop"
app:layout_constraintDimensionRatio="h,16:9"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#color/translucent"
app:layout_constraintBottom_toBottomOf="#id/live_card_cover"
app:layout_constraintLeft_toLeftOf="#id/live_card_cover"
app:layout_constraintRight_toRightOf="#id/live_card_cover"
app:layout_constraintTop_toTopOf="#id/live_card_cover" />
<com.radiofrance.radio.francebleu.android.fonts.FontTextView
style="#style/TextHomeLiveStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/horizontal_margin"
android:layout_marginTop="14dp"
android:text="#string/home_live_status"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.radiofrance.radio.francebleu.android.fonts.FontTextView
android:id="#+id/live_card_player_debug"
style="#style/TextHomeLiveStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:layout_marginEnd="#dimen/horizontal_margin"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Player debug" />
<com.radiofrance.radio.francebleu.android.fonts.FontTextView
android:id="#+id/live_card_title"
style="#style/TextHomeLiveTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="#dimen/horizontal_margin"
android:ellipsize="end"
android:maxLines="3"
app:layout_constraintBottom_toBottomOf="#+id/live_card_cover"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="#id/live_card_player"
tools:text="Live de France Bleu" />
<com.radiofrance.radio.francebleu.android.view.progress.ProgressCircleImageView
android:id="#+id/live_card_player"
android:layout_width="#dimen/home_play_button_size"
android:layout_height="#dimen/home_play_button_size"
android:layout_marginEnd="#dimen/horizontal_margin"
android:layout_marginBottom="#dimen/horizontal_margin"
android:clickable="true"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="#+id/live_card_cover"
app:layout_constraintRight_toRightOf="parent"
app:pciv_background="#drawable/bg_play_dark"
app:pciv_padding="12dp"
app:pciv_progressBackground="#drawable/bg_play_progress_dark"
app:pciv_progressColor="#color/bleu_primary"
app:pciv_src="#drawable/eavd_vd_play" />
<LinearLayout
android:id="#+id/live_card_cover_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="#dimen/horizontal_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/live_card_cover">
<TextView
style="#style/HomeLiveTxt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:ellipsize="end"
android:lines="2"
android:text="#string/home_call_description" />
<com.radiofrance.radio.francebleu.android.fonts.FontTextView
android:id="#+id/live_card_call"
style="#style/TextRobotoBold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="#string/home_call_action"
android:text="#string/home_call_action"
android:textAllCaps="true"
android:textColor="#color/bleu_accent" />
</LinearLayout>
<com.radiofrance.radio.francebleu.android.view.error.GenericErrorView
android:id="#+id/live_card_error"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#color/white"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<com.radiofrance.radio.francebleu.android.view.scroll.SmoothRecyclerView
android:id="#+id/live_feed_recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:behavior_overlapTop="48dp"
android:accessibilityTraversalAfter="#id/live_card_layout"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<include layout="#layout/card_see_new_actualities" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
[Update]
It seems the problem comes from the horizontal recyclerview that is in live_feed_recyclerview as a ViewHolder
I have an EditText that is not allowing to Focus and type. The screen has CoordinatorLayout as a root/parent and NestedScrollView with ViewPager.
On the TOP there WILL be google map and at the bottom there are two tabs.
First tab has text content with EDIT TEXT (which is having the issue) and on the second tab there is a recyclerview.
With this layout unable to Focus and Type on the EditText on the First Tab.
Parent Screen XML
<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="Fragments.JobOpen">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="#dimen/job_open_map_height"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimaryDark"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:titleEnabled="false">
<!--
TODO:: You may use fragment to load map just below the ImageView.
The ImageView is a placeholder I used during the design as a reference.
-->
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="#drawable/gmap_screenshot"
app:layout_collapseMode="parallax"
android:contentDescription="#string/app_name" />
<!--
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7" />
-->
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="#+id/job_open_nested_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
android:focusableInTouchMode="true">
<android.support.design.widget.TabLayout
android:id="#+id/job_open_tab_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="#dimen/archive_card_elevation"
android:background="#color/colorLightGray"
app:layout_constraintBottom_toTopOf="#+id/job_open_viewpager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintVertical_chainStyle="packed"
app:tabSelectedTextColor="#color/colorWhite"
app:tabTextColor="#color/colorFieldHint"
tools:targetApi="lollipop">
<!--
TODO:: Remove the tab items ...
I have kept it for your reference however it is useless here..
as loading from Viewpager class..
-->
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/job_details" />
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/services_providers" />
</android.support.design.widget.TabLayout>
<android.support.v4.view.ViewPager
android:id="#+id/job_open_viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/job_open_tab_layout" />
</android.support.constraint.ConstraintLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
Tab 1 XML
<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"
android:padding="#dimen/app_space"
tools:context="Fragments.JobOpenDetails">
<TextView
android:id="#+id/job_open_id_label"
style="#style/TextLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/app_space_one_half"
android:text="#string/job_id"
app:layout_constraintBottom_toTopOf="#+id/job_open_service_label"
app:layout_constraintEnd_toEndOf="#id/job_open_elapsed_time_label"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="#+id/job_open_service_label"
style="#style/TextLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/app_space_one_half"
android:text="#string/problem"
app:layout_constraintBottom_toTopOf="#+id/job_open_elapsed_time_label"
app:layout_constraintEnd_toEndOf="#id/job_open_elapsed_time_label"
app:layout_constraintStart_toStartOf="#+id/job_open_id_label"
app:layout_constraintTop_toBottomOf="#+id/job_open_id_label" />
<TextView
android:id="#+id/job_open_elapsed_time_label"
style="#style/TextLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/app_space_one_half"
android:text="#string/elapsed_time"
app:layout_constraintBottom_toTopOf="#+id/job_open_time_label"
app:layout_constraintEnd_toStartOf="#id/job_open_content_barrier"
app:layout_constraintStart_toStartOf="#+id/job_open_id_label"
app:layout_constraintTop_toBottomOf="#+id/job_open_service_label" />
<TextView
android:id="#+id/job_open_time_label"
style="#style/TextLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/app_space_one_half"
android:text="Opened at"
app:layout_constraintBottom_toTopOf="#+id/job_open_vehicle_label"
app:layout_constraintEnd_toEndOf="#id/job_open_elapsed_time_label"
app:layout_constraintStart_toStartOf="#+id/job_open_id_label"
app:layout_constraintTop_toBottomOf="#+id/job_open_elapsed_time_label" />
<TextView
android:id="#+id/job_open_vehicle_label"
style="#style/TextLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/app_space_one_half"
android:text="#string/vehicle"
app:layout_constraintBottom_toTopOf="#+id/job_open_price_label"
app:layout_constraintEnd_toEndOf="#id/job_open_elapsed_time_label"
app:layout_constraintStart_toStartOf="#+id/job_open_id_label"
app:layout_constraintTop_toBottomOf="#+id/job_open_time_label" />
<TextView
android:id="#+id/job_open_price_label"
style="#style/TextLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/app_space_one_half"
android:text="#string/price"
app:layout_constraintBottom_toTopOf="#+id/job_open_note_label"
app:layout_constraintEnd_toEndOf="#id/job_open_elapsed_time_label"
app:layout_constraintStart_toStartOf="#+id/job_open_id_label"
app:layout_constraintTop_toBottomOf="#+id/job_open_vehicle_label" />
<TextView
android:id="#+id/job_open_note_label"
style="#style/TextLabel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="#string/notes"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#id/job_open_elapsed_time_label"
app:layout_constraintStart_toStartOf="#+id/job_open_id_label"
app:layout_constraintTop_toBottomOf="#+id/job_open_price_label" />
<!-- separator -->
<android.support.constraint.Barrier
android:id="#+id/job_open_content_barrier"
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:barrierDirection="right"
app:constraint_referenced_ids="job_open_note,job_open_time,job_open_id,job_open_vehicle,job_open_service,job_open_price,job_open_elapsed_time"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#id/job_open_id"
app:layout_constraintStart_toEndOf="#id/job_open_elapsed_time_label"
app:layout_constraintTop_toTopOf="parent" />
<!-- values -->
<TextView
android:id="#+id/job_open_id"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="345"
app:layout_constraintBaseline_toBaselineOf="#+id/job_open_id_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#id/job_open_content_barrier" />
<TextView
android:id="#+id/job_open_service"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="Flat Tire"
app:layout_constraintBaseline_toBaselineOf="#+id/job_open_service_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/job_open_id" />
<TextView
android:id="#+id/job_open_elapsed_time"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:text="5min"
app:layout_constraintBaseline_toBaselineOf="#+id/job_open_elapsed_time_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/job_open_id" />
<TextView
android:id="#+id/job_open_time"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="12:30pm on 12-31-2019"
app:layout_constraintBaseline_toBaselineOf="#+id/job_open_time_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/job_open_id" />
<TextView
android:id="#+id/job_open_vehicle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Nissan March K13 2013 Purple"
app:layout_constraintBaseline_toBaselineOf="#+id/job_open_vehicle_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/job_open_id" />
<TextView
android:id="#+id/job_open_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="$40"
app:layout_constraintBaseline_toBaselineOf="#+id/job_open_price_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/job_open_id" />
<TextView
android:id="#+id/job_open_note"
style="#style/TextContent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="I am waiting in a hotel just after highway. Please contact me as you arive on spot."
app:layout_constraintBottom_toTopOf="#id/job_open_action_barrier"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="#+id/job_open_id"
app:layout_constraintTop_toTopOf="#+id/job_open_note_label"
app:layout_constraintVertical_bias="0.0" />
<android.support.constraint.Barrier
android:id="#+id/job_open_action_barrier"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="job_open_note"
app:layout_constraintBottom_toTopOf="#+id/job_open_edit_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/job_open_note" />
<Button
android:id="#+id/job_open_edit_button"
style="#style/ButtonFlat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/app_space_one_half"
android:text="#string/edit"
app:layout_constraintStart_toStartOf="#+id/job_open_id_label"
app:layout_constraintTop_toBottomOf="#+id/job_open_action_barrier" />
<Button
android:id="#+id/job_open_cancel_button"
style="#style/ButtonPostTheme"
android:layout_marginTop="#dimen/app_space_one_half"
android:text="#string/cancel"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/job_open_action_barrier" />
<EditText
android:id="#+id/test_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/job_open_cancel_button" />
</android.support.constraint.ConstraintLayout>
Tab 2 XML
<android.support.v4.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:fillViewport="true"
tools:context="Fragments.JobOpenAppliedProviders">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/job_open_provider_sort_label"
style="#style/SortLabelText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="#dimen/app_space"
android:text="#string/sort_by"
app:layout_constraintBaseline_toBaselineOf="#+id/job_open_provider_sorty_time"
app:layout_constraintEnd_toStartOf="#+id/job_open_provider_sorty_time"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="#+id/job_open_provider_sorty_time"
style="#style/BodyMenuText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/time"
app:layout_constraintBaseline_toBaselineOf="#+id/job_open_provider_sort_distance"
app:layout_constraintEnd_toStartOf="#+id/job_open_sort_divider"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/job_open_provider_sort_label" />
<View
android:id="#+id/job_open_sort_divider"
android:layout_width="#dimen/job_open_provider_sort_divider_thickness"
android:layout_height="#dimen/job_open_provider_sort_divider_height"
android:layout_marginStart="#dimen/app_space_half"
android:layout_marginEnd="#dimen/app_space_half"
android:background="#color/colorListItemBorder"
app:layout_constraintBottom_toBottomOf="#+id/job_open_provider_sort_distance"
app:layout_constraintEnd_toStartOf="#+id/job_open_provider_sort_distance"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/job_open_provider_sorty_time"
app:layout_constraintTop_toTopOf="#+id/job_open_provider_sort_distance" />
<TextView
android:id="#+id/job_open_provider_sort_distance"
style="#style/BodyMenuText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/app_space"
android:layout_marginEnd="#dimen/app_space"
android:layout_marginBottom="#dimen/app_space_one_half"
android:text="#string/distance"
app:layout_constraintBottom_toTopOf="#id/job_open_provider_barrier"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/job_open_sort_divider"
app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.Barrier
android:id="#+id/job_open_provider_barrier"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:layout_constraintBottom_toTopOf="#id/job_open_provider_list"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/job_open_provider_sort_distance" />
<android.support.v7.widget.RecyclerView
android:id="#+id/job_open_provider_list"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/job_open_provider_barrier" />
</android.support.constraint.ConstraintLayout>
</android.support.v4.widget.NestedScrollView>
You can force the edit text to gain focus programmatically. Inside your TAB1 java class you can do the following that will force the edit text to gain focus.
EditText editText = findViewById(R.id.test_text); //initialize edit text
editText.requestFocus(); //will request focus
//will force the keyboard to show
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
The collapse functioning of the toolbar is working well but the effect is very bad and it jitters while expanding and collapsing. Below is my layout code. Even sometimes the toolbar becomes quite big. I have used a custom view instead of an image in this code. The custom view is constraint Layout. The particular code inside a fragment and the fragment consists of tab layout that has a recyclerview in it. I have used parallax effect for the custom view so I am not quite sure about it.
<android.support.design.widget.CoordinatorLayout
tools:context=".ProfileFragment"
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_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<!--this is the collapse mode-->
<android.support.design.widget.AppBarLayout
android:id="#+id/htab_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorAccent"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="1dp">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="304dp"
android:background="#color/white"
android:fitsSystemWindows="true"
app:contentScrim="#color/colorAccent"
app:expandedTitleTextAppearance="#style/TransparentText"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:title="paco">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="parallax"
android:fitsSystemWindows="true"
android:scaleType="centerCrop">
<android.support.constraint.ConstraintLayout
android:id="#+id/parentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
>
<!-- TODO: Update blank fragment layout -->
<ImageView
android:id="#+id/profileImage"
android:layout_width="87dp"
android:layout_height="87dp"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:contentDescription="Profile Image"
android:src="#drawable/capture"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/editImage"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="100dp"
android:layout_marginStart="100dp"
android:contentDescription="TODO"
app:layout_constraintStart_toEndOf="#+id/profileImage"
app:layout_constraintTop_toTopOf="#+id/profileImage"
app:srcCompat="#drawable/ic_baseline_launch_24px" />
<TextView
android:id="#+id/artistName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="7dp"
android:text="Paco Pardesi"
android:textColor="#333333"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/profileImage"
app:layout_constraintStart_toStartOf="#+id/profileImage"
app:layout_constraintTop_toBottomOf="#+id/profileImage" />
<TextView
android:id="#+id/country"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:text="India"
android:textColor="#757575"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/artistName"
app:layout_constraintStart_toStartOf="#+id/artistName"
app:layout_constraintTop_toBottomOf="#+id/artistName" />
<TextView
android:id="#+id/descriptionArtist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="2dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginStart="2dp"
android:layout_marginTop="12dp"
android:text="Artist from the paradise on earth, Kashmir. I like to create art that is about freedom and fresh thinking."
android:textColor="#323232"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/country" />
<android.support.constraint.ConstraintLayout
android:id="#+id/textviewLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="48dp"
android:layout_marginLeft="48dp"
android:layout_marginRight="48dp"
android:layout_marginStart="48dp"
android:layout_marginTop="17dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/descriptionArtist">
<TextView
android:id="#+id/uploadCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1233"
android:textColor="#bea57c"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/Uploads"
app:layout_constraintStart_toStartOf="#+id/Uploads"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/Uploads"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:layout_marginStart="32dp"
android:text="Uploads"
android:textColor="#333333"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/uploadCount" />
<TextView
android:id="#+id/createdCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="4567"
android:textColor="#bea57c"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/created"
app:layout_constraintStart_toStartOf="#+id/created"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/created"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dp"
android:layout_marginStart="32dp"
android:text="Created"
android:textColor="#333333"
android:textSize="14sp"
app:layout_constraintStart_toEndOf="#+id/Uploads"
app:layout_constraintTop_toBottomOf="#+id/createdCount" />
<TextView
android:id="#+id/likesCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="8000"
android:textColor="#bea57c"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="#+id/likes"
app:layout_constraintStart_toStartOf="#+id/likes"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/likes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:layout_marginLeft="32dp"
android:layout_marginRight="32dp"
android:layout_marginStart="32dp"
android:text="Likes"
android:textColor="#333333"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/created"
app:layout_constraintTop_toBottomOf="#+id/likesCount" />
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
android:background="#android:color/black"
android:fitsSystemWindows="true"/>
<android.support.v7.widget.Toolbar
android:id="#+id/htab_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="top"
android:layout_marginBottom="48dp"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
<android.support.design.widget.TabLayout
android:id="#+id/result_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#color/colorNormal"
app:tabBackground="#drawable/tab_selector"
app:tabIndicatorColor="#f6f6f6"
app:tabIndicatorHeight="0dp"
app:tabMode="fixed"
app:tabTextColor="#333333" />
</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"
/>
</android.support.design.widget.CoordinatorLayout>
Try adding all custom components which are currently present inside CollapsingToolbarLayout into a separate layout file. Then use
<include layout="#layout/my_custom_layout"/>.
Don't know why but works for me somehow. See if this works for you.