how can i put an image out of the dialog [duplicate] - android

This question already has answers here:
View outside a Dialogs bounds
(4 answers)
Closed 2 years ago.
i want to put an image in top of a dialog with half out of the dialog and half inside the dialog as shown in this image
i try to do it using constraint layout but it shows like these
can any one help me to know how to make the image look like it out side the dialog as shown in the first image??
here is my code
<?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="450dp">
<ImageView
android:id="#+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="328dp"
android:src="#drawable/ic_done"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="35dp"
android:layout_marginStart="20dp"
android:layout_marginTop="36dp"
android:text="لحجز الخدمة قم بادخال رقم المريض"
android:textSize="30dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.496"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageView" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="72dp"
android:layout_marginEnd="24dp"
android:text="رقم المريض : "
android:textSize="30dp"
app:layout_constraintBottom_toTopOf="#+id/cancel_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="#+id/editText_pation_number"
app:layout_constraintTop_toBottomOf="#+id/textView" />
<EditText
android:id="#+id/editText_pation_number"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:inputType="number"
android:layout_marginTop="72dp"
android:layout_marginEnd="204dp"
app:layout_constraintBottom_toTopOf="#+id/order_button"
app:layout_constraintEnd_toEndOf="#+id/textView2"
app:layout_constraintHorizontal_bias="0.99"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="#+id/cancel_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:layout_marginEnd="96dp"
android:text="الغاء"
android:textSize="35dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView2"
app:layout_constraintVertical_bias="0.264" />
<Button
android:id="#+id/order_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="124dp"
android:layout_marginEnd="160dp"
android:layout_marginBottom="0dp"
android:background="#drawable/my_button"
android:shadowColor="#color/colorPrimaryDark"
android:text="حجز"
android:textColorHighlight="#color/white"
android:textSize="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/cancel_text"
app:layout_constraintHorizontal_bias="0.844"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText_pation_number"
app:layout_constraintVertical_bias="0.723" />
</androidx.constraintlayout.widget.ConstraintLayout>

Since you are using your own layout for dialog, you can make these changes below for getting full 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="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="28dp"
android:layout_marginEnd="28dp">
<ImageView
android:id="#+id/imageView"
android:layout_width="140dp"
android:layout_height="140dp"
android:src="#android:drawable/btn_star"
android:translationZ="50dp"
app:layout_constraintBottom_toTopOf="#id/box_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#id/box_view" />
<androidx.cardview.widget.CardView
android:id="#+id/box_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
app:cardCornerRadius="8dp"
app:cardElevation="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/customer_found_layout_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="80dp"
android:visibility="invisible"
tools:visibility="visible">
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="36dp"
android:layout_marginEnd="35dp"
android:text="لحجز الخدمة قم بادخال رقم المريض"
android:textSize="30dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.496"
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:layout_marginTop="72dp"
android:layout_marginEnd="24dp"
android:text="رقم المريض : "
android:textSize="30dp"
app:layout_constraintBottom_toTopOf="#+id/cancel_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="#+id/editText_pation_number"
app:layout_constraintTop_toBottomOf="#+id/textView" />
<EditText
android:id="#+id/editText_pation_number"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginTop="72dp"
android:layout_marginEnd="204dp"
android:inputType="number"
app:layout_constraintBottom_toTopOf="#+id/order_button"
app:layout_constraintEnd_toEndOf="#+id/textView2"
app:layout_constraintHorizontal_bias="0.99"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="#+id/cancel_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:layout_marginEnd="96dp"
android:text="الغاء"
android:textSize="35dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView2"
app:layout_constraintVertical_bias="0.264" />
<Button
android:id="#+id/order_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="124dp"
android:layout_marginEnd="160dp"
android:layout_marginBottom="0dp"
android:background="#color/colorPrimary"
android:shadowColor="#color/colorPrimaryDark"
android:text="حجز"
android:textColorHighlight="#000000"
android:textSize="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/cancel_text"
app:layout_constraintHorizontal_bias="0.844"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText_pation_number"
app:layout_constraintVertical_bias="0.723" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
What i did is removed imageView from it's parent and wrapped in into new parent making sibling of CardView.
I have changed backgrounds and colors, you undo those as required.

i found what i was looking forward here
i changed my code as rajasekhar suggested to me
my code went like these
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="#color/transparent"
android:layout_marginStart="28dp"
android:layout_marginEnd="28dp">
<ImageView
android:id="#+id/imageView"
android:layout_width="140dp"
android:layout_height="140dp"
android:src="#drawable/ic_done"
android:translationZ="50dp"
android:background="#color/transparent"
app:layout_constraintBottom_toTopOf="#id/box_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#id/box_view" />
<androidx.cardview.widget.CardView
android:id="#+id/box_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
app:cardCornerRadius="8dp"
app:cardElevation="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/customer_found_layout_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="80dp"
tools:visibility="visible">
<TextView
android:id="#+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="36dp"
android:layout_marginEnd="35dp"
android:text="لحجز الخدمة قم بادخال رقم المريض"
android:textSize="30dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.496"
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:layout_marginTop="72dp"
android:layout_marginEnd="24dp"
android:text="رقم المريض : "
android:textSize="30dp"
app:layout_constraintBottom_toTopOf="#+id/cancel_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="#+id/editText_pation_number"
app:layout_constraintTop_toBottomOf="#+id/textView" />
<EditText
android:id="#+id/editText_pation_number"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_marginTop="72dp"
android:layout_marginEnd="204dp"
android:inputType="number"
app:layout_constraintBottom_toTopOf="#+id/order_button"
app:layout_constraintEnd_toEndOf="#+id/textView2"
app:layout_constraintHorizontal_bias="0.99"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView"
app:layout_constraintVertical_bias="0.0" />
<TextView
android:id="#+id/cancel_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:layout_marginEnd="96dp"
android:text="الغاء"
android:textSize="35dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView2"
app:layout_constraintVertical_bias="0.264" />
<Button
android:id="#+id/order_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="124dp"
android:layout_marginEnd="160dp"
android:layout_marginBottom="0dp"
android:background="#color/colorPrimary"
android:shadowColor="#color/colorPrimaryDark"
android:text="حجز"
android:textColorHighlight="#000000"
android:textSize="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="#+id/cancel_text"
app:layout_constraintHorizontal_bias="0.844"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText_pation_number"
app:layout_constraintVertical_bias="0.723" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
but these is not been what i want but as mhp said here
i added one line to my java code
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
and now it;s worked as i wanted

Related

Recyclerview layout in dialog box

I am facing a problem while opening recyclerview in a dialog box. The layout in the recyclerview is overlapping and cutting when I open this in a dialog box same like this:
But, my original layout is look like this:
and here is the code for my layout
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView 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:layout_margin="8dp"
android:layout_marginBottom="14dp"
android:elevation="10dp"
android:padding="8dp"
app:cardCornerRadius="8dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/corner_layout"
android:paddingTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="#+id/r_field_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Admission No."
android:textColor="#009EBB"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/r_d_field_name"
app:layout_constraintStart_toStartOf="#+id/r_d_field_name"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="RtlHardcoded" />
<TextView
android:id="#+id/admission_no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="45654"
android:textColor="#555555"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="#+id/st_name"
app:layout_constraintStart_toStartOf="#+id/st_name"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/r_d_field_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Student Name"
android:textColor="#009EBB"
android:textSize="20sp"
android:textStyle="bold"
android:layout_marginStart="8dp"
app:layout_constraintBottom_toTopOf="#+id/p_a_field_name"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/r_field_name"
tools:ignore="RtlHardcoded" />
<TextView
android:id="#+id/st_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="Harikant Sharma"
android:textColor="#555555"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="#+id/st_father_mother_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/r_d_field_name"
app:layout_constraintTop_toBottomOf="#+id/admission_no" />
<TextView
android:id="#+id/p_a_field_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Parents Name"
android:textColor="#009EBB"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/btn_call_st"
app:layout_constraintStart_toStartOf="#+id/r_d_field_name"
app:layout_constraintTop_toBottomOf="#+id/r_d_field_name"
tools:ignore="RtlHardcoded" />
<TextView
android:id="#+id/st_father_mother_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Suresh Kumar Sharma"
android:textColor="#555555"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="#+id/btn_view_st_profile"
app:layout_constraintStart_toStartOf="#+id/st_name"
app:layout_constraintTop_toBottomOf="#+id/st_name" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/btn_view_st_profile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="100dp"
android:layout_marginBottom="12dp"
android:gravity="center"
android:src="#drawable/view"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="#+id/btn_call_st"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.9"
app:tint="#color/white" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/btn_call_st"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:backgroundTint="#E10751"
android:gravity="center"
android:src="#drawable/phone"
app:layout_constraintBottom_toBottomOf="#+id/btn_view_st_profile"
app:layout_constraintEnd_toStartOf="#+id/btn_view_st_profile"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#+id/btn_view_st_profile"
app:tint="#color/white" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
If you constrain both left and right, you need to set width=0dp
<TextView
android:id="#+id/st_name"
android:layout_width="0dp" <-- change to 0dp
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="Harikant Sharma"
android:textColor="#555555"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="#+id/st_father_mother_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/r_d_field_name"
app:layout_constraintTop_toBottomOf="#+id/admission_no" />

Unable to find symbol error when adding a new view to xml

I have recently upgraded my studio to artic fox. I am trying to make changes in my xml and add textView but I get this error :
error: cannot find symbol
binding.tvUserBio2.setText("LETS MAKE THIS HAPPEN");
^
symbol: variable tvUserBio2
location: variable binding of type FragmentProfileBinding
I try to clean the build, invalidate and cache studio but still it does not work. Can anyone help?
This is my XML. I try to add any textview anywhere in the XML I get the same error.
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/ui_background">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="24dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/constraint_layout_profile_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white"
android:paddingBottom="21dp"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.imageview.ShapeableImageView
android:id="#+id/iv_user_profile_pic"
android:layout_width="104dp"
android:layout_height="104dp"
android:src="#drawable/placeholder_profile"
app:layout_constraintBottom_toBottomOf="#id/level_progress_bar"
app:layout_constraintLeft_toLeftOf="#id/level_progress_bar"
app:layout_constraintRight_toRightOf="#id/level_progress_bar"
app:layout_constraintTop_toTopOf="#id/level_progress_bar"
app:shapeAppearanceOverlay="#style/CircularImageView" />
<ProgressBar
android:id="#+id/level_progress_bar"
style="#style/CircularDeterminateProgressBar"
android:layout_width="157dp"
android:layout_height="157dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:progress="60" />
<TextView
android:id="#+id/tv_profile_user_name"
style="#style/SemiBoldFont.Size16_Body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="11dp"
android:layout_marginRight="16dp"
android:ellipsize="marquee"
android:gravity="center"
android:lineSpacingExtra="-10dp"
android:maxLines="3"
android:textColor="#color/gray_30_3B4345"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#id/level_progress_bar"
tools:text="Impact\nUser" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="#+id/constraint_layout_user_titles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
app:layout_constraintLeft_toLeftOf="#id/guideline_middle"
app:layout_constraintRight_toRightOf="#id/guideline_middle"
app:layout_constraintTop_toBottomOf="#id/tv_profile_user_name">
<TextView
android:id="#+id/tv_user_top_1_per"
style="#style/RegularFont.Size10_Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:background="#drawable/button_rounded_corner_border_bg"
android:paddingLeft="8dp"
android:paddingTop="4dp"
android:paddingRight="8dp"
android:paddingBottom="4dp"
android:textColor="#color/blue_40_0091B6"
app:layout_constraintTop_toTopOf="parent"
tools:text="TOP 1%" />
<TextView
android:id="#+id/tv_user_title"
style="#style/RegularFont.Size10_Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:background="#drawable/button_rounded_corner_border_bg"
android:paddingLeft="8dp"
android:paddingTop="4dp"
android:paddingRight="8dp"
android:paddingBottom="4dp"
android:textAllCaps="true"
android:textColor="#color/blue_40_0091B6"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
tools:text="HERO FOR RUN" />
<TextView
android:id="#+id/tv_user_current_streak"
style="#style/RegularFont.Size10_Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:background="#drawable/button_rounded_corner_bg_f2f3f4"
android:drawablePadding="4dp"
android:paddingLeft="8dp"
android:paddingTop="4dp"
android:paddingRight="8dp"
android:paddingBottom="4dp"
android:textAllCaps="true"
android:textColor="#color/red_60_F55A33"
app:drawableEndCompat="#drawable/ic_streak_icon"
tools:text="99999" />
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:id="#+id/tv_user_bio"
style="#style/RegularFont.Size12_Caption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:layout_marginRight="30dp"
android:gravity="center"
android:lineSpacingExtra="-8dp"
android:textColor="#color/gray_60_919DA1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#id/constraint_layout_user_titles"
tools:text="100 pushups, 100 sit-ups, 100 squats\nand a 10km run!" />
<TextView
android:id="#+id/tv_user_bio_2"
style="#style/RegularFont.Size12_Caption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:layout_marginRight="30dp"
android:gravity="center"
android:lineSpacingExtra="-8dp"
android:textColor="#color/gray_60_919DA1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#id/tv_user_bio"
tools:text="100 pushups, 100 sit-ups, 100 squats\nand a 10km run!" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline_middle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<TextView
android:id="#+id/tv_user_impact"
style="#style/SemiBoldFont.Size20_Heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textColor="#color/gray_30_3B4345"
app:layout_constraintLeft_toLeftOf="#+id/guideline_middle"
app:layout_constraintRight_toRightOf="#+id/guideline_middle"
app:layout_constraintTop_toBottomOf="#+id/tv_user_bio"
tools:text="₹20,000" />
<TextView
android:id="#+id/tv_donated_caption"
style="#style/RegularFont.Size10_Caption.Profile_Impact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_caption_donated"
app:layout_constraintLeft_toLeftOf="#+id/guideline_middle"
app:layout_constraintRight_toRightOf="#+id/guideline_middle"
app:layout_constraintTop_toBottomOf="#+id/tv_user_impact" />
<TextView
android:id="#+id/tv_user_distance"
style="#style/MediumFont.Size14_Body.Profile_Impact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="#+id/tv_user_impact"
app:layout_constraintLeft_toLeftOf="#+id/tv_distance_caption"
app:layout_constraintRight_toRightOf="#+id/tv_distance_caption"
app:layout_constraintTop_toTopOf="#+id/tv_user_impact"
tools:text="20000 km"
/>
<TextView
android:id="#+id/tv_distance_caption"
style="#style/RegularFont.Size10_Caption.Profile_Impact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_caption_distance"
app:layout_constraintHorizontal_bias="0.4"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="#id/tv_donated_caption"
app:layout_constraintTop_toTopOf="#id/tv_donated_caption" />
<TextView
android:id="#+id/tv_user_max_streak"
style="#style/MediumFont.Size14_Body.Profile_Impact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="#+id/tv_user_impact"
app:layout_constraintLeft_toLeftOf="#+id/tv_max_streak_caption"
app:layout_constraintRight_toRightOf="#+id/tv_max_streak_caption"
app:layout_constraintTop_toTopOf="#+id/tv_user_impact"
tools:text="20000" />
<TextView
android:id="#+id/tv_max_streak_caption"
style="#style/RegularFont.Size10_Caption.Profile_Impact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_caption_max_streak"
app:layout_constraintHorizontal_bias="0.6"
app:layout_constraintLeft_toRightOf="#+id/guideline_middle"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tv_user_impact" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.cardview.widget.CardView
android:id="#+id/card_view_profile_achievements"
style="#style/CardView_Profile_Background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/constraint_layout_profile_header">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/tv_achievement_card_title"
style="#style/SemiBoldFont.Size14_Body.Profile_Card_Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_achievements_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="#+id/btn_achievement_see_more"
style="#style/SemiBoldFont.Size8_Caption.Profile_Card_Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_see_more_button_text"
app:layout_constraintBottom_toBottomOf="#+id/tv_achievement_card_title"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/tv_achievement_card_title" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rv_achievements"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tv_achievement_card_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/card_view_profile_in_progress"
style="#style/CardView_Profile_Background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:contentPadding="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/card_view_profile_achievements">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/tv_in_progress_title"
style="#style/SemiBoldFont.Size14_Body.Profile_Card_Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="#string/profile_in_progress_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/btn_in_progress_see_more"
style="#style/SemiBoldFont.Size8_Caption.Profile_Card_Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:text="#string/profile_see_more_button_text"
app:layout_constraintBottom_toBottomOf="#+id/tv_in_progress_title"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/tv_in_progress_title" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rv_in_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tv_in_progress_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/card_view_profile_steps"
style="#style/CardView_Profile_Background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/card_view_profile_in_progress">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/tv_steps_title"
style="#style/SemiBoldFont.Size14_Body.Profile_Card_Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="12dp"
android:text="#string/profile_steps_title"
app:drawableLeftCompat="#drawable/ic_profile_steps_icon"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/tv_steps_date"
style="#style/MediumFont.Size12_Caption"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_steps_title"
android:textColor="#color/gray_50_75858A"
app:layout_constraintBottom_toBottomOf="#id/tv_steps_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#id/tv_steps_title"
tools:text="04th july '21, Sun" />
<Button
android:id="#+id/btn_steps_see_more"
style="#style/SemiBoldFont.Size8_Caption.Profile_Card_Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_see_more_button_text"
app:layout_constraintBottom_toBottomOf="#+id/tv_steps_title"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/tv_steps_title" />
<com.github.mikephil.charting.charts.BarChart
android:id="#+id/steps_bar_chart"
android:layout_width="0dp"
android:layout_height="150dp"
app:layout_constraintLeft_toLeftOf="#id/tv_steps_title"
app:layout_constraintRight_toRightOf="#id/btn_steps_see_more"
app:layout_constraintTop_toBottomOf="#+id/tv_steps_title"
android:layout_marginTop="20dp"
android:visibility="gone"
/>
<TextView
android:id="#+id/my_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<LinearLayout
android:id="#+id/steps_bar_chart_layout"
android:layout_width="0dp"
android:layout_height="150dp"
app:layout_constraintLeft_toLeftOf="#id/tv_steps_title"
app:layout_constraintRight_toRightOf="#id/btn_steps_see_more"
app:layout_constraintTop_toBottomOf="#+id/tv_steps_title"
android:layout_marginTop="20dp"
android:orientation="horizontal"
></LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/card_view_profile_recent_workout"
style="#style/CardView_Profile_Background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/card_view_profile_steps">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/tv_recent_workout_title"
style="#style/SemiBoldFont.Size14_Body.Profile_Card_Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_recent_workout_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/btn_recent_workout_see_more"
style="#style/SemiBoldFont.Size8_Caption.Profile_Card_Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_see_more_button_text"
app:layout_constraintBottom_toBottomOf="#+id/tv_recent_workout_title"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/tv_recent_workout_title" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rv_recent_workout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tv_recent_workout_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="#+id/card_view_profile_charity_overview"
style="#style/CardView_Profile_Background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/card_view_profile_recent_workout">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/tv_charity_overview_title"
style="#style/SemiBoldFont.Size14_Body.Profile_Card_Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_charity_overview_title"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/btn_charity_overview_see_more"
style="#style/SemiBoldFont.Size8_Caption.Profile_Card_Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/profile_see_more_button_text"
app:layout_constraintBottom_toBottomOf="#+id/tv_charity_overview_title"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/tv_charity_overview_title" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/rv_charity_overview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/tv_charity_overview_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
There is only tv_user_bio on your xml. It means binding.tvUserBio. Why do you put 2, end of variable of tvUserBio2?

How do I properly push a layout upwards when using a Snackbar in Android?

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>

Android Studio XML can't outline imageview

I have a Frame layout and an image in said layout, now I want to outline the image in the layout, but when I try to set the background of the ImageView, it just ignores it and fits the canvas, it works in the layoutEditor but for some reason not in the actual app, one thing that I think might be important to know is that the image in the imageview is set by the user so I can't just use an already outlined image.
Thanks in advance for any help.
//Edit
layout-file-code:
<?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="#000000"
tools:context=".stickerview.EditActivity">
<ImageView
android:id="#+id/COPYRIGHT"
android:layout_width="108dp"
android:layout_height="122dp"
android:layout_marginStart="101dp"
android:layout_marginEnd="151dp"
android:layout_marginBottom="518dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.509"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.751"
app:srcCompat="#drawable/COPYRIGHT_best" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/canvas"
android:layout_width="319dp"
android:layout_height="342dp"
android:background="#drawable/image"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="#+id/saveBtn"
app:layout_constraintEnd_toEndOf="#+id/cropBtn"
app:layout_constraintHorizontal_bias="0.333"
app:layout_constraintStart_toStartOf="#+id/shareBtn"
app:layout_constraintTop_toTopOf="#+id/COPYRIGHT"
app:layout_constraintVertical_bias="1.0"
tools:visibility="visible">
<ImageView
android:id="#+id/editPresetEdit"
android:layout_width="318dp"
android:layout_height="343dp"
android:background="#drawable/outline"
android:scaleType="fitXY"
android:visibility="visible"
app:srcCompat="#drawable/backbtn"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="0dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="#+id/backBtn"
android:layout_width="53dp"
android:layout_height="44dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="713dp"
android:background="#drawable/backbtn"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<ImageView
android:id="#+id/buttonBar"
android:layout_width="333dp"
android:layout_height="101dp"
android:layout_marginStart="36dp"
android:layout_marginTop="477dp"
android:layout_marginEnd="34dp"
android:layout_marginBottom="82dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/buttonbar" />
<Button
android:id="#+id/cropBtn"
android:layout_width="60dp"
android:layout_height="79dp"
android:layout_marginStart="304dp"
android:layout_marginTop="485dp"
android:layout_marginEnd="44dp"
android:layout_marginBottom="95dp"
android:background="#drawable/cropbtn"
android:text="#string/crop_picture"
android:textSize="10sp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/COPYRIGHTBtn"
android:layout_width="51dp"
android:layout_height="79dp"
android:layout_marginStart="255dp"
android:layout_marginTop="485dp"
android:layout_marginEnd="105dp"
android:layout_marginBottom="95dp"
android:background="#drawable/textbtn"
android:text="COPYRIGHT"
android:textSize="10sp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/saveBtn"
android:layout_width="105dp"
android:layout_height="79dp"
android:layout_marginStart="151dp"
android:layout_marginTop="485dp"
android:layout_marginEnd="155dp"
android:layout_marginBottom="95dp"
android:background="#drawable/textbtn"
android:text="#string/save"
android:textSize="19sp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/textStickerBtn"
android:layout_width="55dp"
android:layout_height="79dp"
android:layout_marginStart="97dp"
android:layout_marginTop="485dp"
android:layout_marginEnd="259dp"
android:layout_marginBottom="95dp"
android:background="#drawable/textbtn"
android:text="#string/text"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/shareBtn"
android:layout_width="52dp"
android:layout_height="79dp"
android:layout_marginStart="45dp"
android:layout_marginTop="485dp"
android:layout_marginEnd="314dp"
android:layout_marginBottom="95dp"
android:background="#drawable/sharebtn"
android:text="#string/share"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/head"
android:layout_width="445dp"
android:layout_height="222dp"
android:layout_marginStart="4dp"
android:layout_marginBottom="64dp"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="#+id/button"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="#drawable/head"
tools:visibility="visible" />
<Button
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="336dp"
android:layout_marginTop="260dp"
android:text="NiggaButtonV2"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.483"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
and here is the layout I want
layout
Instead of
app:srcCompat="#drawable/COPYRIGHT_best"
Use
android:src="#drawable/COPYRIGHT_best"

AutoTextSize mismatch problem in a RecyclerView

I'm using Android Oreo AutoTextSize capability in my project.
Every thing works fine except that at first when RecyclerView being loaded, some of textView that uses AutoTextSize has a margin bottom on some RecyclerView items but when I scroll down and then come back to that items, problem solves.
and Although in some items, length of TextView is same with another item, but text sizes are different.
You can see my problem in below image :
When I scroll down and then come back, it is ok
here is items layout :
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView 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:layout_margin="8dp"
android:background="#android:color/white"
app:cardCornerRadius="10dp"
app:cardElevation="3dp">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.constraint.ConstraintLayout
android:id="#+id/fessMetaCL"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
android:layout_marginEnd="2dp"
android:layout_marginStart="2dp"
android:layout_marginTop="24dp"
android:background="#drawable/fees_item_background"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/fee_currency_icon"
app:layout_constraintVertical_bias="1.0">
<android.support.v7.widget.AppCompatTextView
android:id="#+id/fees_update_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="#string/lastupdate"
android:textColor="#color/fees_text_color"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/fee_currency_date"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toEndOf="#+id/fee_currency_stock"
app:layout_constraintTop_toTopOf="parent" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/fee_currency_date"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:maxLines="1"
android:textColor="#color/fees_text_color"
app:autoSizeMaxTextSize="#dimen/order_result_text_max_size"
app:autoSizeMinTextSize="#dimen/order_result_text_min_size"
app:autoSizeStepGranularity="#dimen/order_result_text_rise_step_size"
app:autoSizeTextType="uniform"
app:layout_constraintBaseline_toBaselineOf="#+id/fees_update_label"
app:layout_constraintEnd_toEndOf="parent" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/fees_stock_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="#string/stock"
android:textColor="#color/fees_text_color"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/fee_currency_stock"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:maxLines="1"
android:textColor="#color/fees_text_color"
app:autoSizeMaxTextSize="#dimen/order_result_text_max_size"
app:autoSizeMinTextSize="#dimen/order_result_text_min_size"
app:autoSizeStepGranularity="#dimen/order_result_text_rise_step_size"
app:autoSizeTextType="uniform"
app:layout_constraintBaseline_toBaselineOf="#+id/fees_stock_label"
app:layout_constraintStart_toEndOf="#+id/fees_stock_label" />
</android.support.constraint.ConstraintLayout>
<ImageView
android:id="#+id/fee_currency_icon"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/others" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/fee_currency_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:textColor="#color/fees_text_color"
android:textSize="#dimen/dashboard_fees_small_font_size"
app:layout_constraintStart_toEndOf="#+id/fee_currency_icon"
app:layout_constraintTop_toTopOf="#+id/fee_currency_icon" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/fee_currency_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/fees_text_color"
android:textSize="#dimen/dashboard_fees_small_font_size"
app:layout_constraintBottom_toBottomOf="#+id/fee_currency_icon"
app:layout_constraintStart_toStartOf="#+id/fee_currency_name"
app:layout_constraintTop_toBottomOf="#+id/fee_currency_name" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/fee_currency_change"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:textColor="#color/fees_text_color"
android:textSize="#dimen/dashboard_fees_big_font_size"
app:layout_constraintBottom_toBottomOf="#+id/fee_currency_icon"
app:layout_constraintStart_toStartOf="#+id/guideline4"
app:layout_constraintTop_toTopOf="#+id/fee_currency_icon" />
<android.support.v7.widget.AppCompatTextView
android:id="#+id/fees_change_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:text="#string/change"
android:textColor="#color/fees_text_color"
android:textSize="#dimen/dashboard_fees_small_font_size"
app:layout_constraintBottom_toBottomOf="#+id/fee_currency_change"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="#+id/fee_currency_change" />
<android.support.constraint.Guideline
android:id="#+id/guideline4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_begin="187dp" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>

Categories

Resources