When accessing the page using a Bluetooth keyboard, the Android Tablayout along with its content does not get focused.
But when I am using gesture control it is getting the focus and also can access the contents of the TabItem but when accessing with the external keyboard I am not able to get the focus.
Till now, I tried providing the android:nextFocusRight, android:nextFocusForward but there is no luck that the focus is getting navigated to the desired position.
Below is the XML file
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<SurfaceView
android:id="#+id/surfaceView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:id="#+id/graphicOverlayContainer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/cl_qr_gallery"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginTop="10dp"
android:contentDescription="#string/cl_qr_gallery"
android:nextFocusRight="#id/ll_camera_switch_container"
android:nextFocusDown="#id/ll_camera_switch_container"
android:nextFocusForward="#id/ll_camera_switch_container"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="#+id/iv_qr_gallery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_qr_gallery" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/cl_help"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginTop="10dp"
android:contentDescription="#string/cl_help"
android:nextFocusLeft="#id/tabItemBasic"
android:nextFocusRight="#id/cl_cancel"
android:nextFocusDown="#id/cl_cancel"
android:nextFocusForward="#id/cl_cancel"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="#+id/iv_help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_information" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="#+id/ll_camera_switch_container"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:focusable="true"
android:gravity="center_vertical|center_horizontal"
android:nextFocusLeft="#id/cl_qr_gallery"
android:nextFocusRight="#id/cl_help"
android:nextFocusDown="#id/cl_help"
android:nextFocusForward="#id/cl_help"
app:layout_constraintBottom_toBottomOf="#id/cl_help"
app:layout_constraintEnd_toStartOf="#id/cl_help"
app:layout_constraintStart_toEndOf="#id/cl_qr_gallery"
app:layout_constraintTop_toTopOf="parent">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="5dp"
android:focusable="true"
app:cardCornerRadius="30dp"
app:cardElevation="5dp"
app:strokeColor="#android:color/transparent"
app:strokeWidth="0dp">
<com.google.android.material.tabs.TabLayout
android:id="#+id/tl_barcode_camera_switch"
android:layout_width="match_parent"
android:layout_height="32dp"
android:backgroundTint="#android:color/white"
app:tabBackground="#drawable/tab_selector"
app:tabGravity="fill"
app:tabIndicatorColor="#android:color/transparent"
app:tabIndicatorHeight="0dp"
app:tabMaxWidth="0dp"
app:tabMode="fixed"
app:tabRippleColor="#android:color/transparent"
app:tabSelectedTextColor="#android:color/white"
app:tabTextAppearance="#style/QRCodeSwitchTabLayout"
app:tabTextColor="#color/gray1">
<com.google.android.material.tabs.TabItem
android:id="#+id/tabItemAdvanced"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="Advanced View"
android:focusable="true"
android:importantForAccessibility="yes"
android:nextFocusLeft="#id/cl_qr_gallery"
android:nextFocusRight="#id/tabItemBasic"
android:nextFocusForward="#id/tabItemBasic"
android:text="#string/advanced" />
<com.google.android.material.tabs.TabItem
android:id="#+id/tabItemBasic"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="Basic View"
android:focusable="true"
android:importantForAccessibility="yes"
android:nextFocusLeft="#id/tabItemAdvanced"
android:nextFocusRight="#id/cl_help"
android:nextFocusForward="#id/cl_help"
android:text="#string/basic" />
</com.google.android.material.tabs.TabLayout>
</androidx.cardview.widget.CardView>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/cl_cancel"
android:layout_width="0dp"
android:layout_height="60dp"
android:contentDescription="Cancel Button"
android:importantForAccessibility="yes"
android:nextFocusUp="#id/cl_qr_gallery"
android:nextFocusForward="#id/cl_qr_gallery"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<androidx.appcompat.widget.AppCompatButton
android:id="#+id/btn_cancel"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="30dp"
android:background="#drawable/bg_qr_code"
android:focusable="false"
android:fontFamily="#font/roboto_medium"
android:importantForAccessibility="no"
android:stateListAnimator="#null"
android:text="#string/cancel"
android:textAllCaps="false"
android:textColor="#android:color/white"
android:textSize="16sp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.AppCompatTextView
android:id="#+id/tv_barcode_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#android:color/darker_gray"
android:ellipsize="end"
android:fadingEdge="horizontal|vertical"
android:fontFamily="#font/roboto"
android:gravity="center_vertical|center_horizontal"
android:maxWidth="400dp"
android:maxLines="3"
android:padding="5dp"
android:textColor="#color/cardview_light_background"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Related
I'm trying to implement a proper snackbar that doesn't overlap other views, to do that I added to the activity a Coordinator Layout and inside I placed a constraint layout with the views I want to be pushed up. In the constraint layout I set the attribute app:layout_dodgeInsetEdges="bottom" but when the snackbar appears it pushes the views upwards but it is a little glitchy, here is the video:
video
The video is of an emulator but the same thing happens on real phones.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".login.LoginActivity">
<ImageView
android:id="#+id/login_logo"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_marginStart="80dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="80dp"
android:contentDescription="#string/logo"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/google_logo" />
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="#+id/loginCoordinatorLayout"
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/login_outwire_logo">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/innerConstraintlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_dodgeInsetEdges="bottom">
<LinearLayout
android:id="#+id/create_account_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginBottom="16dp"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/facebook_sign_button">
<TextView
android:id="#+id/dont_have_account_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:text="#string/don_t_have_an_account"
android:textSize="#dimen/subTextSize" />
<TextView
android:id="#+id/create_account_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:text="#string/create_account"
android:textColor="#color/clickable_subtext_blue"
android:textSize="#dimen/subTextSize" />
</LinearLayout>
<EditText
android:id="#+id/login_user_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:autofillHints="Username, Email"
android:ems="14"
android:hint="#string/email_username"
android:inputType="text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="TextFields" />
<EditText
android:id="#+id/login_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autofillHints="Password"
android:ems="14"
android:hint="#string/password"
android:inputType="textPassword"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/login_user_email" />
<com.app.custom.views.SignInButton
android:id="#+id/sign_in_button"
android:layout_width="#dimen/sign_button_width"
android:layout_height="#dimen/sign_button_height"
android:layout_marginTop="48dp"
android:background="#drawable/sign_in_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/login_password"
app:text="#string/sign_in"
app:text_color="?attr/colorOnPrimary"
app:text_size="#dimen/sign_button_text" />
<TextView
android:id="#+id/forgot_password_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:clickable="true"
android:elevation="2dp"
android:focusable="true"
android:text="#string/forgot_your_password"
android:textColor="#color/clickable_subtext_blue"
android:textSize="#dimen/subTextSize"
app:layout_constraintEnd_toEndOf="#+id/login_password"
app:layout_constraintTop_toBottomOf="#+id/login_password" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/or_sign_in_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alpha="0.6"
android:orientation="horizontal"
app:layout_constraintBottom_toTopOf="#+id/google_sign_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/sign_in_button">
<View
android:id="#+id/separator"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="#color/separator_grey"
android:contentDescription="#string/sign_in_options_separator"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/or_sign_in_with_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/or_sign_in_with_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/or_sign_in_with"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="#+id/separator2"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="#color/separator_grey"
android:contentDescription="#string/sign_in_options_separator"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/or_sign_in_with_text"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.app.custom.views.SignInButton
android:id="#+id/google_sign_button"
android:layout_width="#dimen/sign_button_width"
android:layout_height="#dimen/sign_button_height"
android:layout_marginTop="64dp"
android:backgroundTint="?attr/colorSecondary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/sign_in_button"
app:src_logo="#drawable/google_logo"
app:text="#string/google"
app:text_color="?attr/colorOnSecondary" />
<com.app.custom.views.SignInButton
android:id="#+id/facebook_sign_button"
android:layout_width="#dimen/sign_button_width"
android:layout_height="#dimen/sign_button_height"
android:layout_marginTop="8dp"
android:backgroundTint="#color/facebook_blue"
android:clickable="true"
android:focusable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/google_sign_button"
app:src_logo="#drawable/fb_logo"
app:text="#string/facebook"
app:text_size="#dimen/sign_button_text"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
I'm showing a snackbar inside a BottomSheetDialogFragment and I was expecting the normal behavior of it.
<?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.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:id="#+id/bottomSheetRootView"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/interestSheetTitleViewGroup"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="#drawable/bottom_sheet_backgroud_transition"
android:elevation="2dp"
android:outlineProvider="bounds"
app:layout_constraintBottom_toTopOf="#+id/expandedInterestView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="#+id/interestSheetTitleView"
style="#style/EstadaoTextView.HeadLineMedium"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:textColor="#color/colorAccent"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Title" />
<ImageView
android:id="#+id/closeView"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_margin="#dimen/space_24"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="#drawable/ic_close"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0"
app:tint="#a7a7a7" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.core.widget.NestedScrollView
android:id="#+id/categoryScrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="#color/nested_bottom_sheet_background"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toTopOf="#+id/categoryInfoViewGroup"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/interestSheetTitleViewGroup">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/bottom_sheet_background">
<TextView
android:id="#+id/titleView"
style="#style/EstadaoTextView.Bold"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/space_15"
android:paddingHorizontal="#dimen/space_18"
android:text="#string/for_you_categories_view_title"
android:textColor="#color/categories_text"
android:textSize="#dimen/font_18"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/messageView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/messageView"
style="#style/EstadaoTextView.Regular"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/space_15"
android:paddingHorizontal="#dimen/space_18"
android:text="#string/for_you_categories_view_message"
android:textColor="#color/interest_message"
android:textSize="#dimen/font_14"
app:layout_constraintBottom_toTopOf="#+id/expandedFilterView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/titleView" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/expandedFilterView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/space_20"
android:background="#color/categories_background"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/messageView" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/categoryInfoViewGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/categories_background"
android:elevation="#dimen/space_4"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/categoryCountViewGroup"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginHorizontal="#dimen/space_12"
android:layout_marginVertical="#dimen/space_10"
android:background="#drawable/gray_round_border"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/proceedView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="#+id/categorySelectedCount"
style="#style/EstadaoTextView.Bold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="#dimen/space_8"
android:paddingStart="20dp"
android:paddingEnd="0dp"
android:text="0"
android:textColor="#color/categories_text"
android:textSize="#dimen/font_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/totalCategorySelected"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/totalCategorySelected"
style="#style/EstadaoTextView.Regular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingVertical="#dimen/space_8"
android:paddingStart="0dp"
android:paddingEnd="20dp"
android:text="/15"
android:textColor="#a7a7a7"
android:textSize="#dimen/font_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="#+id/categorySelectedCount"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="#+id/proceedView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginVertical="#dimen/space_10"
android:layout_marginEnd="#dimen/space_12"
android:background="#drawable/bg_button_enable"
android:drawableEnd="#drawable/ic_check_white"
android:drawablePadding="2dip"
android:enabled="false"
android:gravity="center"
android:paddingStart="30dp"
android:paddingEnd="26dp"
android:singleLine="true"
android:text="pronto"
android:textColor="#color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/categoryCountViewGroup"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
This is how I expected to display the snackbar.
This is how Snackbar is being displayed.
I tested in another fragments but it's the same way. In another projects snackbar is being displayed normally.
Anyone facing the same problem?
Please try to replace the parent Theme of your Activity from :
parent="Theme.AppCompat.DayNight.NoActionBar"
to
parent="Theme.MaterialComponents.DayNight.NoActionBar"
I have facing an issue, where my login screen is not scrolling and views are overlapping with button when keyboard shows up.
below is the code for Login layout, can somebody help me why views are getting overlapped
i pasted the login layout file here, Linearlayout at the bottom of the layout file is overlapping with Linearlayout defined justabove it , when Keyboard is opened. and the view is not scrolling.
<data>
<!-- databinding data here -->
</data>
<androidx.core.widget.NestedScrollView
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="wrap_content"
android:background="">
<androidx.constraintlayout.widget.Guideline
android:id="#+id/top_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.25" />
<ImageView
android:id="#+id/img_logo_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="#+id/top_guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/txt_title_m_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
app:layout_constraintTop_toBottomOf="#+id/top_guideline" />
<TextView
android:id="#+id/txt_signin_proceed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txt_title_m_id" />
<RelativeLayout
android:id="#+id/rl_olk_sign"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txt_signin_proceed">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="#+id/txt_olk_sign"
android:src="#drawable/ic_olk" />
<TextView
android:id="#+id/txt_olk_sign"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="10dp"/>
</RelativeLayout>
<TextView
android:id="#+id/txt_no_olk_credentials"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="62dp"
android:layout_marginTop="30dp"
android:layout_marginEnd="62dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/rl_olk_sign" />
<TextView
android:id="#+id/txt_term_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="62dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="62dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txt_no_olk_credentials"/>
<TextView
android:id="#+id/tv_signin_username_pwd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="10dp"
android:layout_marginTop="#dimen/_10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/txt_term_login"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:lineHeight="21sp"
android:padding="#dimen/_5dp"/>
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/cl_input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="#+id/txt_signin_proceed">
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/input_layout_user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatEditText
android:id="#+id/et_input_user_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/input_layout_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/input_layout_user_name">
<androidx.appcompat.widget.AppCompatEditText
android:id="#+id/et_input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"/>
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:id="#+id/rl_sign_in_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="#dimen/_20dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="42dp"
android:onClick="#{() -> callback.method2()}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/input_layout_password">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="10dp"
android:gravity="center"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="#+id/rl_copy_right"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="#dimen/_5dp"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
android:id="#+id/tv_back_to_signin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:overScrollMode="always"
android:layout_above="#id/tv_copyright_text"/>
<TextView
android:id="#+id/tv_copyright_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
android:overScrollMode="always"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:visibility="visible" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
add this adjustResize to the activity tag in your manifest , then your view will shrink if keyboard opens.
<activity
android:name=".Activities.MyActivity"
android:windowSoftInputMode="adjustResize" ----->this tag
/>
and for your scroll it might help but let me know if it didnt , and post some screenshots of how your view looks.
I have a fragment and LinearLayout in my activity. In this fragment I have a textview. If there is no ScrollView in fragment, everything works fine. But if there is ScrollView LinearLayout move to the top of keyboard.
This is how my app looks without Scrollview on the text: https://yapx.ru/v/EPcoQ
And this how it looks with it: https://yapx.ru/v/EPcqd
I don't like that Navigation Bar on the bottom isn't hidden when the keyboard is active. What can I do to make app lok like on the first photo andk make textView scrollable?
I've tried to use "windowSoftInputMode" to forbid keyboard move this LinearLayout, but it didn't helped.
I have also tried "focusableInTouchMode" and "isScrollContainer"
attributes, but they were useless too.
This is the activity file:
<?xml version="1.0" encoding="utf-8"?>
<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:id="#+id/main_chetnost"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#86A0FC"
android:windowSoftInputMode="adjustResize"
>
<fragment
android:id="#+id/fragment_theory"
android:name="com.example.user.mathplace_1.theory"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toTopOf="#+id/linearLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/toolbar" />
<fragment
android:id="#+id/fragment_task"
android:name="com.example.user.mathplace_1.Task"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toTopOf="#+id/linearLayout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/toolbar"
app:layout_constraintVertical_bias="0.0" />
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="0dp"
android:layout_height="60dp"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="MathPlace"
app:titleTextColor="#fff">
<ImageButton
android:id="#+id/homeButton"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="end"
android:layout_marginStart="8dp"
android:layout_marginTop="6dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="6dp"
android:background="#drawable/home"
android:contentDescription="#string/report_description"
android:onClick="delete"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.887"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.987" />
</android.support.v7.widget.Toolbar>
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="75dp"
android:background="#FFF"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
android:focusableInTouchMode="false"
android:isScrollContainer="false">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#accbff"
android:orientation="horizontal"
android:focusableInTouchMode="false"
android:isScrollContainer="false">
<LinearLayout
android:id="#+id/LinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:focusableInTouchMode="false"
android:isScrollContainer="false"/>
</HorizontalScrollView>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
And this is the fragment code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/background"
xmlns:app="http://schemas.android.com/apk/res-auto">
<EditText
android:id="#+id/editText"
android:layout_width="237dp"
android:layout_height="46dp"
android:layout_marginTop="8dp"
android:ems="10"
android:hint="Введите ваш ответ"
android:inputType="number"
android:textColor="#5B6175"
android:textSize="23sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="#+id/cardView"
app:layout_constraintTop_toBottomOf="#+id/cardView"
app:layout_constraintVertical_bias="0.3" />
<ImageButton
android:id="#+id/send"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="8dp"
android:background="#drawable/send"
android:onClick="send"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/cardView"
app:layout_constraintTop_toBottomOf="#+id/cardView"
app:layout_constraintVertical_bias="0.3" />
<android.support.v7.widget.CardView
android:id="#+id/cardView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.4">
<ScrollView
android:id="#+id/scrollView4"
android:layout_width="310dp"
android:layout_height="375dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="#+id/textView3"
android:layout_width="310dp"
android:layout_height="375dp"
android:background="#drawable/text_rounded_corner"
android:padding="8dp"
android:text="dddddddddddddddddddddddd"
android:textColor="#5B6175"
android:textSize="20sp" />
</LinearLayout>
</ScrollView>
</android.support.v7.widget.CardView>
<TextView
android:id="#+id/textView"
android:layout_width="310dp"
android:layout_height="47dp"
android:background="#drawable/title_rounded_corner"
android:padding="8dp"
android:text="Заголовок"
android:textColor="#FFF"
android:textSize="24sp"
app:layout_constraintBottom_toTopOf="#+id/cardView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.504"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="#+id/star2"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="44dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="#+id/textView"
app:layout_constraintEnd_toEndOf="#+id/textView"
app:layout_constraintTop_toTopOf="#+id/textView"
app:layout_constraintVertical_bias="1.0"
app:srcCompat="#drawable/star" />
<ImageView
android:id="#+id/star1"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="#+id/textView"
app:layout_constraintEnd_toEndOf="#+id/textView"
app:layout_constraintTop_toTopOf="#+id/textView"
app:layout_constraintVertical_bias="1.0"
app:srcCompat="#drawable/star" />
<ImageView
android:id="#+id/star3"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="76dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="#+id/textView"
app:layout_constraintEnd_toEndOf="#+id/textView"
app:layout_constraintTop_toTopOf="#+id/textView"
app:layout_constraintVertical_bias="1.0"
app:srcCompat="#drawable/star" />
</android.support.constraint.ConstraintLayout>
I've found how I can make my text scrollable without breaking old app view.
I just needed to add one line to the java file:
myTextview.setMovementMethod(new ScrollingMovementMethod());
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>