android scrollview not scrolling down after keyboard opens - android

I have a textview that is inside of a scrollview, it scrolls fine untill the soft keyboard is opened.
When the keyboard is opened it act like it scrolled up again with the height of the keyboard.
What I have tried
I tried this in the manifest, but yielded the exact same results
android:windowSoftInputMode="adjustResize"
Then this:
android:windowSoftInputMode="adjustPan"
That seemed to work, but the problem was that it was moving the whole screen up and taking the header out of view.
I also tried adding the following in the linear layout
android:focusable="true"
android:focusableInTouchMode="true"
That only caused the app not to focus on the input field (EditText) and the keyboard didn't open automatically, but when you clicked on the input field it would just act the same as before.
This is the XML file code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/lightGray"
android:orientation="vertical" >
<ScrollView
android:id="#+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/bottom_layout"
android:layout_marginTop="10dip" >
<LinearLayout
android:id="#+id/msg_list_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/bottom_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#android:color/background_light">
<Button
android:id="#+id/send_btn"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="#string/txt_send" />
<EditText
android:id="#+id/msg_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/send_btn"
android:layout_toLeftOf="#+id/send_btn"
android:inputType="text" >
</EditText>
</RelativeLayout>
Any suggestions?

I had same problem and the solutions is this:
My activity was in fullscreen mode and scroll does not work in this mode this is a bug and we send a report to google.
Just look at your activity in manifest if there is a fullscreen mode just remove it.

I got this problem and it is a headache.
the soloution is instead of drawing an XML layout from the top of the screen, you need to draw it from the bottom of the screen.
look at these examples :
main.xml
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="0dp"
android:layout_height="match_parent"
android:fillViewport="true"
android:isScrollContainer="true"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<include layout="#layout/main_contents"/>
</ScrollView>
</android.support.constraint.ConstraintLayout>
main_contents.xml
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="20dp">
<android.support.constraint.Guideline
android:id="#+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.92" />
<android.support.v7.widget.CardView
android:id="#+id/card1"
android:layout_width="0dp"
android:layout_height="250dp"
android:layout_margin="30dp"
android:padding="10dp"
app:cardCornerRadius="10dp"
app:layout_constraintBottom_toTopOf="#+id/guideline"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="#+id/sam3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="sample"
android:textColor="#673AB7"
android:textSize="23sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/sam2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:backgroundTint="#673AB7"
android:digits="0123456789"
android:gravity="center"
android:hint="sample"
android:inputType="phone"
android:maxLength="11"
android:maxLines="1"
android:nextFocusDown="#id/sam1"
android:textColor="#673AB7"
android:layout_marginStart="40dp"
android:layout_marginEnd="40dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/sam3"
app:layout_constraintVertical_bias="0.3"/>
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
<Button
android:id="#+id/sam1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="#fff"
android:background="#673AB7"
android:text="sample"
android:layout_marginLeft="60dp"
android:layout_marginRight="60dp"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="#+id/card1"
app:layout_constraintEnd_toEndOf="#+id/card1"
app:layout_constraintStart_toStartOf="#+id/card1"
app:layout_constraintTop_toBottomOf="#+id/card1" />
</android.support.constraint.ConstraintLayout>
main_contents2.xml
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="20dp">
<android.support.constraint.Guideline
android:id="#+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.45" />
<android.support.v7.widget.CardView
android:id="#+id/card1"
android:layout_width="0dp"
android:layout_height="250dp"
android:layout_margin="30dp"
android:padding="10dp"
app:cardCornerRadius="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/guideline">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="#+id/sam2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_marginStart="40dp"
android:layout_marginEnd="40dp"
android:backgroundTint="#673AB7"
android:digits="0123456789"
android:gravity="center"
android:hint="sample"
android:inputType="phone"
android:maxLength="11"
android:maxLines="1"
android:nextFocusDown="#id/sam1"
android:textColor="#673AB7"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/sam3"
app:layout_constraintVertical_bias="0.3" />
<TextView
android:id="#+id/sam3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="sample"
android:textColor="#673AB7"
android:textSize="23sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
<Button
android:id="#+id/sam1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="#fff"
android:background="#673AB7"
android:text="sample"
android:layout_marginLeft="60dp"
android:layout_marginRight="60dp"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="#+id/card1"
app:layout_constraintEnd_toEndOf="#+id/card1"
app:layout_constraintStart_toStartOf="#+id/card1"
app:layout_constraintTop_toBottomOf="#+id/card1" />
</android.support.constraint.ConstraintLayout>
the second XML file main_contents2 drew from top and android just put the EditText from top of the keyboard.BUT the main_contents drawn from the bottom of the screen. so when the soft keyboard comes up the layout resizes.

Try changing the layout_height of scrollview to wrap_content.

All you need to do is
android:isScrollContainer="true"

Related

windowSoftInput hides items in recycleview

Im creating a chat app and so far it looks something like this:
The moment I start typing it hides the last 2 items and looks like (the edittext hides g,h messages):
My XML file looks as follows:
<?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=".ChatActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rv_Messages"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintHeight_percent="0.9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="#+id/ib_Send"
style="?android:borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:adjustViewBounds="true"
android:src="#drawable/ic_location_on_black_24dp"
app:layout_constraintHeight_percent="0.1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<EditText
android:id="#+id/et_Message"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:hint="enter message here"
android:backgroundTint="#color/colorLightPurple"
android:inputType="textMultiLine|textPersonName"
app:layout_constraintHeight_percent="0.1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/ib_Send"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
and I have added to my manifest android:windowSoftInputMode="adjustPan"
Is there a way that I can make sure that my recycleview will always show the lates messages/ make sure the edittext wont hide?
Thank you
Use the combination of relative and linear layout and then use marginBottom inside recyclerview. Hope you will find it.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ChatActivity">
<include
android:id="#+id/chat_toolbar"
layout="#layout/app_bar_layout">
</include>
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/private_messages_list_of_users"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/chat_toolbar"
android:layout_above="#+id/chat_linear_layout"
android:layout_marginBottom="6dp"
>
</androidx.recyclerview.widget.RecyclerView>
<RelativeLayout
android:id="#+id/chat_linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:background="#android:color/background_light"
android:orientation="horizontal"
>
<ImageButton
android:id="#+id/send_files_btn"
android:layout_width="60dp"
android:layout_height="50dp"
android:src="#drawable/ic_attach_file_black_24dp"
android:layout_alignParentStart="true"
android:backgroundTint="#android:color/white"
/>
<EditText
android:id="#+id/input_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="type message here..."
android:padding="15dp"
android:maxLines="5"
android:layout_toEndOf="#+id/send_files_btn"
android:layout_toStartOf="#+id/send_message_btn"
/>
<ImageButton
android:id="#+id/send_message_btn"
android:layout_width="60dp"
android:layout_height="wrap_content"
android:src="#drawable/send_message"
android:layout_alignParentEnd="true"
android:backgroundTint="#android:color/white"
/>
</RelativeLayout>
</RelativeLayout>
check out my above example...

Activity resized after keyboard is appears

I have an activity that contains one fragment added by the include tag (at the top of the activity) and one main central fragment. The main fragment also contains the editText widget. When I click on the edittext keyboard it is displayed and based on the window chosen, the SoftInputMode keyboard moves the window upwards (the upper fragment disappears behind the screen) or overlaps the buttons below the keyboard on the main fragment. (scrolling does not appear in both cases).
I need scrollable fragment window, but its impossible? How?
Xmls:
Activity:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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="?attr/bg_second"
android:keepScreenOn="true">
<FrameLayout
android:id="#+id/fl_work_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom|right|end"
tools:ignore="RtlHardcoded" />
<include layout="#layout/view_menu_main" />
Main fragment:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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:layout_height="wrap_content">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="#+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="#id/tv_tariff_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/textInputLayout">
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rv_border"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/space_large_m"
android:background="?attr/bg_main"
android:minHeight="120dp"
android:paddingStart="#dimen/space_medium_xl"
android:paddingTop="#dimen/space_medium_l"
android:paddingEnd="#dimen/space_medium_xl" />
<TextView
android:id="#+id/tv_empty_point"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="#dimen/space_medium_s"
android:text="#string/road_to_empty_text"
android:textAlignment="center"
android:textColor="?attr/text_main"
tools:textColor="#color/black" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="#dimen/space_medium_xl"
android:tint="#android:color/white"
app:backgroundTint="#color/bg_button_light"
app:layout_anchor="#id/rv_border"
app:layout_anchorGravity="bottom|right|end"
app:srcCompat="#android:drawable/ic_input_add" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="70dp"
android:paddingStart="#dimen/space_small_l"
android:paddingEnd="#dimen/space_small_l"
android:theme="#style/TextInputLayout"
app:layout_constraintBottom_toTopOf="#id/tv_tariff_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="+7949919">
<EditText
android:id="#+id/phone_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/phone_number_of_client"
android:importantForAutofill="no"
android:inputType="phone"
android:maxLength="15"
android:maxLines="1"
android:singleLine="true"
android:textColor="?attr/text_main"
android:textColorHighlight="#android:color/darker_gray"
android:textColorHint="#android:color/darker_gray"
tools:textColor="#color/black" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="#+id/tv_tariff_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:padding="#dimen/space_medium_s"
android:singleLine="true"
android:text="#string/work_main_tariff"
android:textColor="?attr/text_main"
android:textSize="#dimen/font_size_huge"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/textInputLayout"
tools:textColor="#color/black" />
<LinearLayout
android:id="#+id/ll_tariff_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_second"
android:orientation="horizontal"
android:weightSum="3"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/tv_tariff_label">
<TextView
android:id="#+id/tv_tariff"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1.8"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:paddingStart="#dimen/space_medium_s"
android:paddingEnd="#dimen/space_medium_s"
android:tag="tariff"
android:textColor="?attr/text_main"
android:textSize="#dimen/font_size_huge"
tools:text="My tariff"
tools:textColor="#color/black" />
<Button
android:id="#+id/add_opt_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginEnd="4dp"
android:layout_weight="1"
android:background="#drawable/custom_button_green"
android:text="#string/options_title"
android:textColor="?attr/text_button"
android:textSize="#dimen/font_size_large"
android:visibility="invisible"
tools:textColor="#color/white" />
<ProgressBar
android:id="#+id/p_bar_options"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:layout_marginEnd="4dp"
android:layout_weight="1.2"
android:padding="4dp"
android:text="#string/options_title"
android:textColor="?attr/text_button"
android:textSize="#dimen/font_size_large"
android:theme="#style/accentStyle"
android:visibility="gone"
tools:textColor="#color/white" />
</LinearLayout>
<Button
android:id="#+id/btn_start_work"
android:layout_width="wrap_content"
android:layout_height="#dimen/button_height"
android:layout_gravity="center_horizontal"
android:layout_marginTop="50dp"
android:background="#drawable/custom_button_green"
android:text="#string/work_btn_begin"
android:textColor="?attr/text_button"
android:textSize="#dimen/font_size_large"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/ll_tariff_view"
tools:textColor="#color/white" />
<ProgressBar
android:id="#+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:theme="#style/accentStyle"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/ll_tariff_view"
tools:visibility="visible" />
</androidx.constraintlayout.widget.ConstraintLayout>
You can use below code into Manifest file for your activity, I think it should resolve your problem
android:windowSoftInputMode="adjustPan|adjustResize"

TextView goes beyound the ConstraintLayout

I would like to get a effect dotted text(ellipsis property) - both textView in this same line, but I have problem with ConstraintLayout.
In first TextView if I have long text, my second textView going to off screen.
I would like to block second textView on the end of layout and dotted 1st textView.
It is possible ?
Screens:
short text
long text
xml:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimary"
android:padding="16dp"
tools:context=".MainActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="20dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="36dp"
android:background="#00D54C4C"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="longTextlongTextlongTextlongTextlongTextlong"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="85dp" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123456789"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="#+id/textView2"
tools:layout_editor_absoluteY="85dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Your constraints aren't correct as you don't have an end constraint. The following should resolve that issue:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimary"
android:padding="16dp"
tools:context=".MainActivity">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_margin="20dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="36dp"
android:background="#00D54C4C"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="longTextlongTextlongTextlongTextlongTextlong"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:layout_editor_absoluteY="85dp" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="123456789"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="85dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
That however still leaves you with some fairly gnarly layout code that isn't too great. There is never a good reason to have nested ConstraintLayouts so I'd recommend refactoring it to be something like this (which will still give you same end result):
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimary"
android:padding="16dp"
tools:context=".MainActivity">
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="longTextlongTextlongTextlongTextlongTextlong"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="#+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="123456789"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/textView2"/>
</androidx.constraintlayout.widget.ConstraintLayout>
The above also includes vertical constraints (constraintTop_...) which will ensure the layout displays correctly at runtime and will also resolve the IDE warning you had with the code previously.
And then from there to get the ellipsize effect you just need to add the following attributes to your TextView: android:ellipsize="end" and android:lines="1"
The final XML would look something like this:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimary"
android:padding="16dp"
tools:context=".MainActivity">
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="longTextlongTextlongTextlongTextlongTextlonglongTextlongTextlongTextlongTextlongTextlong"
android:ellipsize="end"
android:lines="1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="#+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="123456789"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/textView2"/>
</androidx.constraintlayout.widget.ConstraintLayout>
One thing to note: this does remove the margin you had previously. Making use of Guideline you are able to add the margins/padding you wanted by adding a start and end Guideline which has a vertical orientation. The final-final version of the layout would look something like this:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimary"
android:padding="16dp"
tools:context=".MainActivity">
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guidelineStart"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_begin="16dp" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guidelineEnd"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_end="16dp" />
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="longTextlongTextlongTextlongTextlongTextlonglongTextlongTextlongTextlongTextlongTextlong"
android:ellipsize="end"
android:lines="1"
app:layout_constraintStart_toStartOf="#+id/guidelineStart"
app:layout_constraintEnd_toEndOf="#+id/guidelineEnd"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="#+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="123456789"
app:layout_constraintStart_toStartOf="#+id/guidelineStart"
app:layout_constraintEnd_toEndOf="#+id/guidelineEnd"
app:layout_constraintTop_toBottomOf="#id/textView2"/>
</androidx.constraintlayout.widget.ConstraintLayout>
Having TextViews On Same Line
If you want to have the TextViews on the same line you can use another Guideline to include where the first should stop and the second should begin. In this example the guideline is set at the halfway point using app:layout_constraintGuide_percent=".5":
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/colorPrimary"
android:padding="16dp"
tools:context=".MainActivity">
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guidelineStart"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_begin="16dp" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guidelineCenter"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_percent=".5" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guidelineEnd"
android:layout_width="0dp"
android:layout_height="0dp"
android:orientation="vertical"
app:layout_constraintGuide_end="16dp" />
<TextView
android:id="#+id/textView2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="longTextlongTextlong"
android:ellipsize="end"
android:lines="1"
app:layout_constraintStart_toStartOf="#+id/guidelineStart"
app:layout_constraintEnd_toStartOf="#+id/guidelineCenter"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="#+id/textView3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="123456789"
app:layout_constraintStart_toStartOf="#+id/guidelineCenter"
app:layout_constraintEnd_toEndOf="#+id/guidelineEnd"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
Add the following to your text view you want to ellipsize(...)
android:ellipsize="end"
android:singleLine="true"

Layout in fragment not centering

I'm building my first proper application for Android. I wish to use the Navigation Drawer Activity to switch between screens and options. So far so good. All working great. But my layouts that load in the content are not aligned properly. See pictures
I have tried to change the layout_width and layout_height to fill_parent, match_parent and wrap_content in all combinations. Also tried adding the gravity center and vertical gravity but so far i have failed.
content layout:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:showIn="#layout/app_bar_main_menu"
tools:context=".MainMenu">
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
the content im trying to put in the content layout:
<?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:layout_editor_absoluteY="81dp">
<ImageView
android:layout_width="34dp"
android:layout_height="34dp" app:srcCompat="#drawable/fragment_client_add_address"
android:id="#+id/imageView10"
app:layout_constraintEnd_toStartOf="#+id/editText10"
android:layout_marginEnd="12dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="#+id/editText10"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:hint="Kontakt broj"
android:ems="10"
android:id="#+id/editText9"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="24dp" app:layout_constraintTop_toBottomOf="#+id/editText11"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:hint="Adresa"
android:ems="10"
android:id="#+id/editText10"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="24dp" app:layout_constraintTop_toBottomOf="#+id/editText9"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:hint="Naziv klijenta"
android:ems="10"
android:id="#+id/editText11" android:layout_marginEnd="8dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="64dp" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintHorizontal_bias="0.518"/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:hint="E-Mail"
android:ems="10"
android:id="#+id/editText12"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginTop="24dp" app:layout_constraintTop_toBottomOf="#+id/editText10"/>
<ImageView
android:layout_width="34dp"
android:layout_height="34dp" app:srcCompat="#drawable/round_person_black_48"
android:id="#+id/imageView11"
android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="#+id/editText11" app:layout_constraintEnd_toStartOf="#+id/editText11"
android:layout_marginEnd="12dp"/>
<ImageView
android:layout_width="34dp"
android:layout_height="34dp" app:srcCompat="#drawable/round_call_black_48"
android:id="#+id/imageView12"
android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="#+id/editText9" app:layout_constraintEnd_toStartOf="#+id/editText9"
android:layout_marginEnd="12dp"/>
<ImageView
android:layout_width="34dp"
android:layout_height="34dp" app:srcCompat="#drawable/fragment_client_add_email"
android:id="#+id/imageView13"
android:layout_marginTop="8dp"
app:layout_constraintTop_toTopOf="#+id/editText12" app:layout_constraintEnd_toStartOf="#+id/editText12"
android:layout_marginEnd="12dp"/>
<Spinner
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="#+id/spinner"
android:layout_marginTop="24dp"
app:layout_constraintTop_toBottomOf="#+id/editText12" app:layout_constraintStart_toStartOf="#+id/editText12"
app:layout_constraintEnd_toEndOf="#+id/editText12" android:entries="#array/clientType"
/>
<Spinner
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="#+id/spinner2" app:layout_constraintStart_toStartOf="#+id/spinner"
app:layout_constraintEnd_toEndOf="#+id/spinner" android:entries="#array/clientContract"
app:layout_constraintTop_toBottomOf="#+id/spinner" android:layout_marginTop="32dp"/>
<Button
android:text="#string/button_genericConfirm"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="#+id/button" android:layout_marginBottom="32dp"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="128dp" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="128dp" android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="#+id/spinner2" app:layout_constraintVertical_bias="1.0"/>
</androidx.constraintlayout.widget.ConstraintLayout>
This is what i expect it to look like:
But in reality this is what it looks like:
The issue in your RelativeLayout inside your content layout
You need to chnage the width of your RelativeLayout to android:layout_width="match_parent" in your content layout
Try this
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:showIn="#layout/app_bar_main_menu"
tools:context=".MainMenu">
<RelativeLayout
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
The problem is not with your fragment layout implementation, I just tried in an activity and it is worked properly.
I would say to change the content layout to FrameLayout, which is often used to hold the fragments, more information can be found here :Why is a FrameLayout used for fragments?
The frame layout instead of relative layout should be
<FrameLayout
android:id="#+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
Just left the id as relativeLayout, but feel free to change it.
Also, if you have such a problem, you can always use the layout inspector, it is in the tools menu, give it a try. Or you can just play with background colors, to check the layout sizes, just like back in time, before layout inspector.
It is always good to use drawablestart instead of imageview in all edit text
Please find below xml may it will be helpful
<?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">
<EditText
android:id="#+id/editText11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="64dp"
android:layout_marginEnd="8dp"
android:drawableStart="#mipmap/ic_launcher"
android:ems="10"
android:hint="Naziv klijenta"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.518"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="#+id/editText9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:drawableStart="#mipmap/ic_launcher"
android:ems="10"
android:hint="Kontakt broj"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText11" />
<EditText
android:id="#+id/editText10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:drawableStart="#mipmap/ic_launcher"
android:ems="10"
android:hint="Adresa"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText9" />
<EditText
android:id="#+id/editText12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:drawableStart="#mipmap/ic_launcher"
android:ems="10"
android:hint="E-Mail"
android:inputType="textPersonName"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText10" />
<Spinner
android:id="#+id/spinner"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:entries="#mipmap/ic_launcher"
app:layout_constraintEnd_toEndOf="#+id/editText12"
app:layout_constraintStart_toStartOf="#+id/editText12"
app:layout_constraintTop_toBottomOf="#+id/editText12" />
<Spinner
android:id="#+id/spinner2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:entries="#mipmap/ic_launcher"
app:layout_constraintEnd_toEndOf="#+id/spinner"
app:layout_constraintStart_toStartOf="#+id/spinner"
app:layout_constraintTop_toBottomOf="#+id/spinner" />
<Button
android:id="#+id/button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="128dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="128dp"
android:layout_marginBottom="32dp"
android:text="xxxx"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/spinner2"
app:layout_constraintVertical_bias="1.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
In case you want specific size for your imageview in left use below code
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
>
<item
android:drawable="#drawable/icon"
android:width="#dimen/icon_size"
android:height="#dimen/icon_size"
/>
</layer-list >
Use FrameLayout instead of relative layout and finally remove the line from parent constraint layout..
tools:layout_editor_absoluteY="81dp"
try to use like below
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat
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_gravity="center_vertical"
android:gravity="center_vertical"
android:layout_height="match_parent">
<ImageView
android:layout_width="34dp"
android:layout_height="34dp"
app:srcCompat="#drawable/fragment_client_add_address"
android:id="#+id/imageView10"
android:layout_marginEnd="12dp"
android:layout_marginTop="8dp"/>
</androidx.appcompat.widget.LinearLayoutCompat>
And for content main
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="#+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.appcompat.widget.LinearLayoutCompat>
You can use the property app:layout_constraintVertical_bias so that it is biased equally to parent. This can also be achieved in layout editor by constraining all 4 sides of the layout to parent.

How to remain fixed positions of layout after dynamically setting the text?

I'm making an application that gets the categories of foods from a remote database and put them in a recyclerView
but the positions keep changing after setting the text,
I need the "see more" to remain on the right side like this
.
How can I solve this problem?
This is how it looks now
.
That's my code:
<?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:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_horizontal_margin"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="#dimen/activity_horizontal_margin">
<TextView
android:id="#+id/textTest1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:text="Heading"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Large"
app:layout_constraintBaseline_toBaselineOf="#+id/textView"
app:layout_constraintEnd_toStartOf="#+id/textView"
app:layout_constraintStart_toStartOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="right">
<TextView
android:id="#+id/textView"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:text="#string/see_more"
android:textColor="#26979d"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/textTest1"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="17dp"
android:layout_height="19dp"
app:srcCompat="#drawable/ic_right_arrow"
tools:layout_editor_absoluteX="335dp"
tools:layout_editor_absoluteY="9dp" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
Thanks to CodeRed answer, I found the answer, hope it will help someone else. It was a wrap-content error
<?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:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/activity_horizontal_margin"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="#+id/linearlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="#dimen/activity_horizontal_margin">
<TextView
android:id="#+id/textTest1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:text="Heading"
android:textAppearance="#style/Base.TextAppearance.AppCompat.Large"
app:layout_constraintBaseline_toBaselineOf="#+id/textView"
app:layout_constraintEnd_toStartOf="#+id/textView"
app:layout_constraintStart_toStartOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="right">
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/see_more"
android:textColor="#26979d"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/textTest1"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="15dp"
android:layout_height="15dp"
app:srcCompat="#drawable/ic_right_arrow"
tools:layout_editor_absoluteX="335dp"
tools:layout_editor_absoluteY="9dp" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
I cannot try this myself but I am sure that your android:layout_width in the second LinearLayout is the suspect. As you can see, the See More > is floating in the right however the width itself is restricting it to go further

Categories

Resources