BottomAppBar navigation items are not clickable because of NestedScrollView - android

My app bar is located below my scroll view and therefore the items are not clickable
My scroll view should stop just above my BottomAppBar
how to do that ?
And how to make the BottomAppBar always visible
Useless text for my post to pass, very restrictive this rule
The story of a cat who wanted to eat the dog's bowl.
I hope there is enough unnecessary text
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:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<com.google.android.material.bottomappbar.BottomAppBar
android:id="#+id/bottomAppBar"
style="#style/Widget.MaterialComponents.BottomAppBar.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:menu="#menu/menu_show_bottom"
app:navigationIcon="#drawable/ic_action_home_blank" />
<include
android:id="#+id/contentScroll"
layout="#layout/content_scrolling" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/btnAddClean"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_anchor="#id/bottomAppBar"
app:layout_anchorGravity="bottom|end"
app:srcCompat="#drawable/ic_action_clean" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Content scrolled
<?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"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:showIn="#layout/fragment_avaloir_show">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/rueTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="#style/TextAppearance.MaterialComponents.Headline5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Rue des jolis bois " />
<ImageView
android:id="#+id/avaloirImageView"
android:layout_width="263dp"
android:layout_height="350dp"
android:contentDescription="#string/content_description"
android:src="#drawable/aval2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/rueTextView" />
<TextView
android:id="#+id/coordinatesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/avaloirImageView"
tools:text="50.235621, 5.23658" />
<com.google.android.gms.maps.MapView
android:id="#+id/mapView"
android:layout_width="match_parent"
android:layout_height="350dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/coordinatesTextView" />
<TextView
android:id="#+id/titreDatesNettoyageTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:text="#string/title_dates_nettoyage"
android:textAppearance="#style/TextAppearance.MaterialComponents.Headline5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/mapView" />
<View
android:id="#+id/dividerView"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="16dp"
android:background="#color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="#+id/titreDatesNettoyageTextView" />
<TextView
android:id="#+id/datesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/dividerView"
tools:text="10 avril 2019" />
<TextView
android:id="#+id/titreCommentairesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:text="#string/title_commentaires"
android:textAppearance="#style/TextAppearance.MaterialComponents.Headline5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/datesTextView" />
<View
android:id="#+id/commentDividerView"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="16dp"
android:background="#color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="#+id/titreCommentairesTextView" />
<TextView
android:id="#+id/commentairesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/commentDividerView"
tools:text="Il est cassé il faut le remplacer" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>

finally I added a linearLayout
<?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">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
android:id="#+id/contentScroll"
layout="#layout/content_scrolling" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.bottomappbar.BottomAppBar
android:id="#+id/bottomAppBar"
style="#style/Widget.MaterialComponents.BottomAppBar.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:menu="#menu/menu_show_bottom"
app:navigationIcon="#drawable/ic_action_home_blank" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/btnAddClean"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_anchor="#id/bottomAppBar"
app:srcCompat="#drawable/ic_action_clean" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<?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="wrap_content">
<TextView
android:id="#+id/rueTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="#style/TextAppearance.MaterialComponents.Headline5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Rue des jolis bois " />
<ImageView
android:id="#+id/avaloirImageView"
android:layout_width="263dp"
android:layout_height="350dp"
android:contentDescription="#string/content_description"
android:src="#drawable/aval2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/rueTextView" />
<TextView
android:id="#+id/coordinatesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/avaloirImageView"
tools:text="50.235621, 5.23658" />
<com.google.android.gms.maps.MapView
android:id="#+id/mapView"
android:layout_width="match_parent"
android:layout_height="350dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/coordinatesTextView" />
<TextView
android:id="#+id/titreDatesNettoyageTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:text="#string/title_dates_nettoyage"
android:textAppearance="#style/TextAppearance.MaterialComponents.Headline5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/mapView" />
<View
android:id="#+id/dividerView"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="16dp"
android:background="#color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="#+id/titreDatesNettoyageTextView" />
<TextView
android:id="#+id/datesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/dividerView"
tools:text="10 avril 2019" />
<TextView
android:id="#+id/titreCommentairesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:text="#string/title_commentaires"
android:textAppearance="#style/TextAppearance.MaterialComponents.Headline5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/datesTextView" />
<View
android:id="#+id/commentDividerView"
android:layout_width="match_parent"
android:layout_height="2dp"
android:layout_marginTop="16dp"
android:background="#color/colorPrimaryDark"
app:layout_constraintBottom_toBottomOf="#+id/titreCommentairesTextView" />
<TextView
android:id="#+id/commentairesTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/commentDividerView"
tools:text="Il est cassé il faut le remplacer" />
</androidx.constraintlayout.widget.ConstraintLayout>

Related

View is overlapped by another view in NestedScrollView with ConstrainLayout

I have the following layout:
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/content_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/margin_32"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.cardview.widget.CardView
android:id="#+id/online_card_cv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="#dimen/margin_16"
android:layout_marginTop="#dimen/margin_25"
android:background="#color/white"
app:cardCornerRadius="#dimen/margin_8">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="#dimen/margin_8">
<androidx.appcompat.widget.AppCompatRadioButton
android:id="#+id/online_card_rb"
android:layout_width="#dimen/margin_22"
android:layout_height="#dimen/margin_22"
android:layout_marginStart="#dimen/margin_16"
app:layout_constraintBottom_toBottomOf="#id/online_card_ll"
app:layout_constraintEnd_toStartOf="#id/online_card_ll"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#id/online_card_ll" />
<LinearLayout
android:id="#+id/online_card_ll"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/margin_16"
android:background="#color/white"
android:gravity="start"
android:orientation="vertical"
android:paddingVertical="#dimen/padding_16"
app:layout_constraintEnd_toStartOf="#id/cards_iv"
app:layout_constraintStart_toEndOf="#id/online_card_rb"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/online_card_tv"
style="#style/OnlineCardTitleTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/online_card_title"
app:lineHeight="#dimen/default_text_size_28" />
<androidx.appcompat.widget.AppCompatTextView
style="#style/OnlineCardSubTitleTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/online_card_now" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="#+id/cards_iv"
android:layout_width="#dimen/margin_80"
android:layout_height="#dimen/margin_20"
android:layout_marginEnd="#dimen/margin_16"
android:src="#drawable/ic_visa_master"
app:layout_constraintBottom_toBottomOf="#id/online_card_ll"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="#id/online_card_ll" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/online_card_expanded_info_cl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="#id/online_card_ll">
<View
android:id="#+id/online_card_divider"
style="#style/ViewDividerStyle"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="#dimen/margin_16"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/cards_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="#id/online_card_divider" />
<View
android:id="#+id/cards_list_divider"
style="#style/ViewDividerStyle"
android:layout_width="match_parent"
android:layout_height="1dp"
app:layout_constraintTop_toBottomOf="#id/cards_list" />
<TextView
android:id="#+id/read_more_tv"
style="#style/OnlineCardReadMoreTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/margin_16"
android:layout_marginTop="#dimen/margin_16"
android:layout_marginBottom="#dimen/margin_8"
android:text="#string/read_more"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/cards_list_divider" />
<LinearLayout
android:id="#+id/additional_info_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/margin_21"
android:layout_marginTop="#dimen/margin_16"
android:layout_marginEnd="#dimen/margin_10"
android:layout_marginBottom="#dimen/margin_8"
android:orientation="vertical"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/cards_list_divider">
<TextView
android:id="#+id/online_card_less_info_tv"
style="#style/OnlineCardReadMoreTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/online_card_less_info" />
<TextView
android:id="#+id/check_card_type_title_tv"
style="#style/OnlineCardBottomTitleTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_4"
android:text="#string/online_check_card" />
<TextView
android:id="#+id/check_card_type_info_tv"
style="#style/OnlineCardBottomDescriptionTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/margin_8"
android:layout_marginTop="#dimen/margin_4"
android:text="#string/online_check_card_info" />
<TextView
android:id="#+id/online_card_data_title_tv"
style="#style/OnlineCardBottomTitleTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_4"
android:text="#string/online_card_data" />
<TextView
android:id="#+id/online_card_data_info_tv"
style="#style/OnlineCardBottomDescriptionTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/margin_8"
android:layout_marginTop="#dimen/margin_4"
android:text="#string/online_card_data_info" />
<TextView
android:id="#+id/online_card_confirmation_title_tv"
style="#style/OnlineCardBottomTitleTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_4"
android:text="#string/online_card_confirmation" />
<TextView
android:id="#+id/online_card_confirmation_info_tv"
style="#style/OnlineCardBottomDescriptionTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/margin_8"
android:layout_marginTop="#dimen/margin_4"
android:text="#string/online_card_confirmation_info" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/bank_account_cv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="#dimen/margin_16"
android:layout_marginTop="25dp"
android:background="#color/white"
app:cardCornerRadius="#dimen/margin_8">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginVertical="#dimen/margin_24">
<androidx.appcompat.widget.AppCompatRadioButton
android:id="#+id/bank_account_rb"
android:layout_width="#dimen/margin_22"
android:layout_height="#dimen/margin_22"
android:layout_marginStart="#dimen/margin_16"
app:layout_constraintBottom_toBottomOf="#id/bank_account_tv"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#id/bank_account_tv" />
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/bank_account_tv"
style="#style/OnlineCardTitleTextStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/margin_14"
android:text="#string/title_on_bank"
android:textAlignment="textStart"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#id/bank_account_rb"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="#+id/bank_account_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="#dimen/margin_16"
android:alpha="0.5"
android:background="#000001"
app:layout_constraintTop_toBottomOf="#id/bank_account_tv" />
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/iban_hint_tv"
style="#style/OnlineCardEditTextHintTextStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/margin_16"
android:layout_marginTop="15dp"
android:text="#string/step7_iban_hint"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/bank_account_divider" />
<androidx.appcompat.widget.AppCompatEditText
android:id="#+id/step1_phone"
android:layout_width="match_parent"
android:layout_height="#dimen/height_edittext"
android:layout_marginHorizontal="#dimen/margin_16"
android:layout_marginTop="#dimen/margin_2"
android:background="#drawable/rounded_edittext_with_border"
android:maxLines="1"
app:layout_constraintTop_toBottomOf="#id/iban_hint_tv" />
<androidx.constraintlayout.widget.Group
android:id="#+id/group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="step1_phone, iban_hint_tv, bank_account_divider" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</LinearLayout>
<androidx.appcompat.widget.AppCompatButton
android:id="#+id/step7_next_btn"
android:layout_width="#dimen/width_button_next"
android:layout_height="#dimen/height_button_next"
android:layout_marginBottom="#dimen/margin_10"
android:background="#drawable/rounded_button_next"
android:text="#string/next"
android:textColor="#color/button_text_green"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
When the part of the view has gone visibility, my screen looks like this:
As you can see, button is placed in the bottom and it's not overlapped by any other views. But when card is expanded, it looks like this:
As you can see, now button overlaps another card, and I need to place button under the card. So, how can I prevent existing behavior and place the button under all cards in the bottom? Thanks in advance, I will appreciate any help!
See below for an updated answer.
Old
I don't see the purpose of ConstraintLayout. You can remove that and place the button as last item in LinearLayout. The XML would then be like:
NestedScrollingView
LinearLayout
CardView ...
CardView ...
AppCompatButton
You can also use ConstraintLayout instead of LinearLayout, but I don't see the need for both.
This introduces a problem: the button is not at the bottom, when the content does not fill out the screen. For an easy fix, you can use ConstraintLayout with appropriate constraints.
New
I suggest you to use a ConstraintLayout. With it, you can achieve a flat layout hierarchy. You can use chains and vertical bias as such:
Chain the first card to the top of your parent
Chain the button to the bottom of your parent
Chain the second card to the bottom of the first card and to the top of the button. Apply a vertical bias of 0.0.
The result:
And the simple code for the example:
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#dddddd"
android:fillViewport="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:id="#+id/card1"
android:layout_width="0dp"
android:layout_height="200dp"
android:layout_margin="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="First card" />
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/card2"
android:layout_width="0dp"
android:layout_height="800dp"
android:layout_margin="16dp"
app:cardCornerRadius="8dp"
app:cardElevation="8dp"
app:layout_constraintBottom_toTopOf="#id/button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/card1"
app:layout_constraintVertical_bias="0.0">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Second card" />
</androidx.cardview.widget.CardView>
<androidx.appcompat.widget.AppCompatButton
android:id="#+id/button"
android:layout_width="0dp"
android:layout_height="64dp"
android:layout_marginBottom="16dp"
android:background="#ffffff"
android:text="Button text"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintWidth_percent="0.5" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>

Weird behavior of a RecyclerView within CoordinatorLayout

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

GridLayout columns disappearing on smaller screen devices

I'm having some issues with my GridLayout contained within a ConstraintLayout. On larger screen devices (Pixel 2/3 XL for example) the GridLayout looks fine with content for all three columns showing up as expected.
On smaller screen devices only the first column is visible while the others just seem to disappear completely. What am I missing here?
<?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:id="#+id/login_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorWhite"
android:animateLayoutChanges="true"
tools:context=".myactivity.MyActivity">
<androidx.gridlayout.widget.GridLayout
android:id="#+id/activity_gridlayout_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
app:columnCount="3"
app:layout_constraintTop_toBottomOf="#id/top_layout"
app:rowCount="1">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/md_keylines_medium"
android:layout_marginTop="#dimen/md_keylines"
android:layout_marginEnd="#dimen/md_keylines"
android:layout_marginBottom="#dimen/md_keylines"
android:orientation="vertical"
app:layout_columnWeight="1">
<ImageView
android:id="#+id/activity_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_climate" />
<TextView
android:id="#+id/activity_state_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/colorWhite" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/md_keylines"
android:orientation="vertical"
app:layout_columnWeight="1">
<com.google.android.material.chip.Chip
android:id="#+id/activity_temp"
style="#style/Widget.MaterialComponents.Chip.Action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="22.0"
app:chipIcon="#drawable/ic_minus"
app:chipIconSize="22dp"
app:closeIcon="#drawable/ic_add"
app:closeIconEnabled="true"
app:closeIconSize="22dp"
app:closeIconTint="#color/colorAccent" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="#dimen/md_keylines"
android:orientation="vertical"
app:layout_columnWeight="1">
<com.google.android.material.chip.Chip
android:id="#+id/activity_toggle"
style="#style/Widget.MaterialComponents.Chip.Action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/start"
android:textColor="#color/colorWhite"
app:chipBackgroundColor="#color/colorAccent"
app:chipIcon="#drawable/ic_power"
app:chipIconTint="#color/colorWhite" />
</LinearLayout>
</androidx.gridlayout.widget.GridLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Just make layout width 0dp where you are using column weight and check:
Like:
<?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:id="#+id/login_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorWhite"
android:animateLayoutChanges="true"
tools:context=".myactivity.MyActivity">
<androidx.gridlayout.widget.GridLayout
android:id="#+id/activity_gridlayout_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
app:columnCount="3"
app:layout_constraintTop_toBottomOf="#id/top_layout"
app:rowCount="1">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/md_keylines_medium"
android:layout_marginTop="#dimen/md_keylines"
android:layout_marginEnd="#dimen/md_keylines"
android:layout_marginBottom="#dimen/md_keylines"
android:orientation="vertical"
app:layout_columnWeight="1">
<ImageView
android:id="#+id/activity_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/ic_climate" />
<TextView
android:id="#+id/activity_state_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/colorWhite" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="#dimen/md_keylines"
android:orientation="vertical"
app:layout_columnWeight="1">
<com.google.android.material.chip.Chip
android:id="#+id/activity_temp"
style="#style/Widget.MaterialComponents.Chip.Action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="22.0"
app:chipIcon="#drawable/ic_minus"
app:chipIconSize="22dp"
app:closeIcon="#drawable/ic_add"
app:closeIconEnabled="true"
app:closeIconSize="22dp"
app:closeIconTint="#color/colorAccent" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="#dimen/md_keylines"
android:orientation="vertical"
app:layout_columnWeight="1">
<com.google.android.material.chip.Chip
android:id="#+id/activity_toggle"
style="#style/Widget.MaterialComponents.Chip.Action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/start"
android:textColor="#color/colorWhite"
app:chipBackgroundColor="#color/colorAccent"
app:chipIcon="#drawable/ic_power"
app:chipIconTint="#color/colorWhite" />
</LinearLayout>
</androidx.gridlayout.widget.GridLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Hope it helps.
Design View should be like this
<com.google.android.material.card.MaterialCardView
android:id="#+id/tab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="#{(v)->callback.onTabClick(v)}"
app:touchListener="#{mContext}">
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center">
<ImageView
android:id="#+id/iv_card_icon"
android:layout_width="#dimen/grid_menu_image"
android:layout_height="#dimen/grid_menu_image"
android:layout_centerInParent="true"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
app:imageResource="#{tabIcon}"
android:scaleType="center"
app:layout_constraintBottom_toTopOf="#+id/tv_guide_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="spread"
tools:src="#drawable/guide_icon" />
<!--android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"-->
<com.hp.pregnancy.customviews.new_50.RobotoMediumTextView
android:id="#+id/tv_guide_title"
style="#style/TextAppearance.MaterialComponents.Subtitle1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="16dp"
android:ellipsize="end"
android:gravity="center"
android:maxLines="2"
android:text="#{tabTitle}"
android:textAlignment="center"
android:textColor="#color/menu_color"
android:textFontWeight="500"
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/iv_card_icon"
tools:text="#string/guideTitle" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
For Grid Include like this
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/relativeLayout3"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="#+id/include2"
layout="#layout/toolbar"
android:layout_width="0dp"
android:layout_height="?attr/actionBarSize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="gone"/>
<include
android:id="#+id/tab1"
layout="#layout/card"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="#dimen/small_margin"
android:layout_marginTop="#dimen/small_margin"
android:layout_marginEnd="#dimen/xsmall_margin"
android:layout_marginBottom="#dimen/xsmall_margin"
app:callback="#{callback}"
app:layout_constraintBottom_toTopOf="#+id/tab3"
app:layout_constraintEnd_toStartOf="#+id/guideline7"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/include2"
/>
<include
android:id="#+id/tab2"
layout="#layout/card"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="#dimen/xsmall_margin"
android:layout_marginEnd="#dimen/small_margin"
android:layout_marginLeft="#dimen/xsmall_margin"
android:layout_marginRight="#dimen/small_margin"
android:layout_marginStart="#dimen/xsmall_margin"
android:layout_marginTop="#dimen/small_margin"
app:layout_constraintBottom_toTopOf="#+id/tab4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="#+id/guideline7"
app:layout_constraintTop_toBottomOf="#+id/include2"
/> <!--guideLayout-->
<include
android:id="#+id/tab3"
layout="#layout/card"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="#dimen/xsmall_margin"
android:layout_marginEnd="#dimen/xsmall_margin"
android:layout_marginLeft="#dimen/small_margin"
android:layout_marginRight="#dimen/xsmall_margin"
android:layout_marginStart="#dimen/small_margin"
android:layout_marginTop="#dimen/xsmall_margin"
app:layout_constraintBottom_toTopOf="#+id/tab5"
app:layout_constraintEnd_toStartOf="#+id/guideline7"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tab1"
/>
<include
android:id="#+id/tab4"
layout="#layout/card"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="#dimen/xsmall_margin"
android:layout_marginEnd="#dimen/small_margin"
android:layout_marginLeft="#dimen/xsmall_margin"
android:layout_marginRight="#dimen/small_margin"
android:layout_marginStart="#dimen/xsmall_margin"
android:layout_marginTop="#dimen/xsmall_margin"
app:layout_constraintBottom_toTopOf="#+id/tab6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="#+id/guideline7"
app:layout_constraintTop_toBottomOf="#+id/tab2"
/>
<include
android:id="#+id/tab5"
layout="#layout/card"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="#dimen/xsmall_margin"
android:layout_marginEnd="#dimen/xsmall_margin"
android:layout_marginLeft="#dimen/small_margin"
android:layout_marginRight="#dimen/xsmall_margin"
android:layout_marginStart="#dimen/small_margin"
android:layout_marginTop="#dimen/xsmall_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/guideline7"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tab3"
/>
<include
android:id="#+id/tab6"
layout="#layout/card"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="#dimen/xsmall_margin"
android:layout_marginEnd="#dimen/small_margin"
android:layout_marginLeft="#dimen/xsmall_margin"
android:layout_marginRight="#dimen/small_margin"
android:layout_marginStart="#dimen/xsmall_margin"
android:layout_marginTop="#dimen/xsmall_margin"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="#+id/guideline7"
app:layout_constraintTop_toBottomOf="#+id/tab4"
/>
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
</androidx.constraintlayout.widget.ConstraintLayout>
If you are testing for smaller screen add scrollview and constraintlayout in activity or fragment layout and then add include.

EditText not focusing in CoordinatorLayout with NestedScrollView

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);

NestedScrollView inside CoordinatorLayout scrolling problem

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>

Categories

Resources