I have put Constraint layout inside a Nested Scrollview to make the screen scrollable, but it doesn't scroll.
This is my XML:
<?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_height="match_parent"
android:layout_width="match_parent"
android:fillViewport="true">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/clMain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/dark_blue"
tools:context=".SignUpActivity"
>
<ImageView
android:id="#+id/ivLogo"
android:layout_width="#dimen/_148sdp"
android:layout_height="#dimen/_60sdp"
android:src="#drawable/logo_voodlee"
app:layout_constraintVertical_bias="0.08"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:id="#+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name as on Pan Card"
android:visibility="visible"
app:fontFamily="#font/poppins_regular"
android:textColor="#color/fade_green"
android:textSize="#dimen/_11ssp"
app:layout_constraintVertical_bias="0.285"
app:layout_constraintHorizontal_bias="0.135"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<EditText
android:id="#+id/etName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name as on Pan Card"
android:gravity="left"
android:inputType="textVisiblePassword"
android:background="#drawable/bg_edittext_thin_line_bright_green"
android:layout_marginLeft="#dimen/_20sdp"
android:layout_marginRight="#dimen/_20sdp"
android:lineSpacingExtra="#dimen/_3sdp"
app:fontFamily="#font/poppins_regular"
android:textColor="#color/bright_green"
android:textColorHint="#color/fade_green"
android:textSize="#dimen/dimen_20dp"
android:importantForAutofill="no"
app:layout_constraintVertical_bias="0.31"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:id="#+id/tvEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Email"
android:visibility="visible"
app:fontFamily="#font/poppins_regular"
android:textColor="#color/fade_green"
android:textSize="#dimen/_11ssp"
app:layout_constraintVertical_bias="0.4"
app:layout_constraintHorizontal_bias="0.091"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<EditText
android:id="#+id/etEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textVisiblePassword"
android:hint="Email"
android:gravity="left"
android:background="#drawable/bg_edittext_thin_line_bright_green"
android:lineSpacingExtra="#dimen/_3sdp"
app:fontFamily="#font/poppins_regular"
android:layout_marginLeft="#dimen/_20sdp"
android:layout_marginRight="#dimen/_20sdp"
android:textColor="#color/bright_green"
android:textColorHint="#color/fade_green"
android:textSize="#dimen/dimen_20dp"
android:importantForAutofill="no"
app:layout_constraintVertical_bias="0.43"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:id="#+id/tvErrorMsgEmail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:text="* Please enter valid email address"
android:textSize="#dimen/_10ssp"
android:textColor="#color/voodlee_red"
app:fontFamily="#font/poppins_regular"
android:layout_marginTop="#dimen/_4sdp"
app:layout_constraintHorizontal_bias=".1375"
app:layout_constraintVertical_bias="0.47"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:id="#+id/tvMob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mobile Number"
android:gravity="center_vertical"
android:visibility="visible"
app:fontFamily="#font/poppins_regular"
android:textColor="#color/fade_green"
android:textSize="#dimen/_11ssp"
app:layout_constraintVertical_bias="0.515"
app:layout_constraintHorizontal_bias="0.115"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<EditText
android:id="#+id/etMob"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:hint="Mobile Number"
android:gravity="left"
android:lineSpacingExtra="#dimen/_3sdp"
android:layout_marginLeft="#dimen/_20sdp"
android:layout_marginRight="#dimen/_20sdp"
android:textColor="#color/bright_green"
android:textColorHint="#color/fade_green"
android:textSize="#dimen/dimen_20dp"
app:fontFamily="#font/poppins_regular"
android:background="#drawable/bg_edittext_thin_line_bright_green"
android:importantForAutofill="no"
app:layout_constraintVertical_bias="0.55"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:id="#+id/tvErrorMsgMobile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:text="* Please enter valid mobile number"
android:textSize="#dimen/_10ssp"
android:textColor="#color/voodlee_red"
app:fontFamily="#font/poppins_regular"
android:layout_marginTop="#dimen/_4sdp"
app:layout_constraintHorizontal_bias=".135"
app:layout_constraintVertical_bias="0.5875"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:id="#+id/tvAgree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="By clicking Proceed you agree to"
android:textSize="#dimen/dimen_14dp"
android:textColor="#color/bright_green"
app:fontFamily="#font/poppins_regular"
android:gravity="center"
app:layout_constraintVertical_bias="0.6575"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:id="#+id/tvAgree2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="the"
android:textSize="#dimen/dimen_14dp"
android:textColor="#color/bright_green"
app:fontFamily="#font/poppins_regular"
android:gravity="center"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintHorizontal_bias="0.125"
app:layout_constraintLeft_toLeftOf="#id/tvAgree"
app:layout_constraintRight_toRightOf="#id/tvAgree"
app:layout_constraintTop_toBottomOf="#id/tvAgree"
app:layout_constraintBottom_toBottomOf="parent"
/>
<TextView
android:id="#+id/tvTnc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Terms and conditions"
android:textColor="#color/text_highlight"
android:textSize="#dimen/dimen_14dp"
app:fontFamily="#font/poppins_regular"
app:layout_constraintVertical_bias="0.01"
app:layout_constraintHorizontal_bias="0.2"
app:layout_constraintLeft_toRightOf="#id/tvAgree2"
app:layout_constraintRight_toRightOf="#id/tvAgree"
app:layout_constraintTop_toBottomOf="#id/tvAgree"
app:layout_constraintBottom_toBottomOf="parent"
/>
<Button
android:id="#+id/btnNextSignUp"
android:layout_width="match_parent"
android:layout_height="#dimen/_36sdp"
android:background="#drawable/bg_btn_proceed_disabled"
android:layout_margin="#dimen/_25sdp"
android:text="Proceed"
android:textColor="#color/dark_blue"
android:textAllCaps="false"
android:textSize="#dimen/dimen_20dp"
android:onClick="onClickNext"
android:fontFamily="#font/poppins_semi_bold"
android:foreground="?attr/selectableItemBackground"
app:layout_constraintVertical_bias="0.825"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:id="#+id/tvAlreadyHave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/text_highlight"
android:text="Already have an account?"
app:fontFamily="#font/poppins_regular"
android:textSize="#dimen/_11sdp"
android:textStyle="bold"
app:layout_constraintVertical_bias="0.87"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<!--Code for Progressbar at bottom of screen-->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/clProgressSignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="visible"
app:layout_constraintVertical_bias="0.96"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<ImageView
android:id="#+id/ivFlowLine"
android:layout_width="#dimen/_210sdp"
android:layout_height="wrap_content"
android:scaleType="fitXY"
app:layout_constraintVertical_bias=".425"
app:layout_constraintHorizontal_bias=".425"
android:src=
"#drawable/bg_flow_line_fade_green"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<ImageView
android:id="#+id/ivStartCircle"
android:layout_width="#dimen/_9sdp"
android:layout_height="#dimen/_9sdp"
android:src="#drawable/bg_flow_circle_bright_green"
app:layout_constraintRight_toLeftOf="#id/ivFlowLine"
app:layout_constraintTop_toTopOf="#id/ivFlowLine"
app:layout_constraintBottom_toBottomOf="#id/ivFlowLine"/>
<com.example.voodlee.GradualGrowingLine
android:id="#+id/ivOrangeLineSignUp"
android:layout_width="#dimen/_14sdp"
android:layout_height="#dimen/_3sdp"
app:startingPoint="0"
app:layout_constraintVertical_bias=".425"
app:layout_constraintLeft_toLeftOf="#id/ivStartCircle"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<ImageView
android:id="#+id/ivCircle2"
android:layout_width="#dimen/_16sdp"
android:layout_height="#dimen/_16sdp"
android:layout_marginLeft="#dimen/_22sdp"
app:layout_constraintVertical_bias=".4"
app:layout_constraintHorizontal_bias="0.43"
android:src=
"#drawable/bg_flow_circle_black"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageView
android:id="#+id/ivCircle5"
android:layout_width="#dimen/_16sdp"
android:layout_height="#dimen/_16sdp"
app:layout_constraintVertical_bias=".4"
android:src=
"#drawable/bg_flow_circle_black"
app:layout_constraintHorizontal_bias="0.85"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:id="#+id/tvSignUp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SignUp"
android:textSize="#dimen/_9ssp"
android:textColor="#color/fade_green"
app:fontFamily="#font/poppins_regular"
app:layout_constraintLeft_toLeftOf="#id/ivCircle2"
app:layout_constraintRight_toRightOf="#id/ivCircle2"
app:layout_constraintTop_toBottomOf="#id/ivCircle2"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Autosaving"
android:textSize="#dimen/_9sdp"
android:textColor="#color/fade_green"
app:fontFamily="#font/poppins_regular"
app:layout_constraintLeft_toLeftOf="#id/ivCircle5"
app:layout_constraintRight_toRightOf="#id/ivCircle5"
app:layout_constraintTop_toBottomOf="#id/ivCircle5"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="#+id/cl2ProgressSignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintVertical_bias="0.96"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<ImageView
android:id="#+id/iv2FlowLine"
android:layout_width="#dimen/_210sdp"
android:layout_height="wrap_content"
android:scaleType="fitXY"
app:layout_constraintVertical_bias=".425"
app:layout_constraintHorizontal_bias=".425"
android:src=
"#drawable/bg_flow_line_fade_green"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<ImageView
android:id="#+id/iv2StartCircle"
android:layout_width="#dimen/_9sdp"
android:layout_height="#dimen/_9sdp"
android:src="#drawable/bg_flow_circle_bright_green"
app:layout_constraintRight_toLeftOf="#id/iv2FlowLine"
app:layout_constraintTop_toTopOf="#id/iv2FlowLine"
app:layout_constraintBottom_toBottomOf="#id/iv2FlowLine"/>
<ImageView
android:id="#+id/iv2OrangeLine"
android:layout_width="#dimen/_14sdp"
android:layout_height="#dimen/_3sdp"
app:layout_constraintVertical_bias="0.425"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:src=
"#drawable/bg_flow_line_green_2"
app:layout_constraintLeft_toLeftOf="#id/iv2StartCircle"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<com.example.voodlee.GradualGrowingLine
android:id="#+id/iv2OrangeLineSignUp"
android:layout_width="#dimen/_50sdp"
android:layout_height="#dimen/_3sdp"
app:startingPoint="14"
app:layout_constraintVertical_bias=".425"
app:layout_constraintLeft_toLeftOf="#id/iv2StartCircle"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
<ImageView
android:id="#+id/iv2Circle2"
android:layout_width="#dimen/_16sdp"
android:layout_height="#dimen/_16sdp"
android:layout_marginLeft="#dimen/_22sdp"
app:layout_constraintVertical_bias=".4"
app:layout_constraintHorizontal_bias="0.43"
android:src=
"#drawable/bg_flow_circle_black"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<ImageView
android:id="#+id/iv2Circle5"
android:layout_width="#dimen/_16sdp"
android:layout_height="#dimen/_16sdp"
app:layout_constraintVertical_bias=".4"
android:src=
"#drawable/bg_flow_circle_black"
app:layout_constraintHorizontal_bias="0.85"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<TextView
android:id="#+id/tv2SignUp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
androidø:text="SignUp"
android:textSize="#dimen/_9ssp"
android:textColor="#color/fade_green"
app:fontFamily="#font/poppins_regular"
app:layout_constraintLeft_toLeftOf="#id/iv2Circle2"
app:layout_constraintRight_toRightOf="#id/iv2Circle2"
app:layout_constraintTop_toBottomOf="#id/iv2Circle2"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Autosaving"
android:textSize="#dimen/_9sdp"
android:textColor="#color/fade_green"
app:fontFamily="#font/poppins_regular"
app:layout_constraintLeft_toLeftOf="#id/iv2Circle5"
app:layout_constraintRight_toRightOf="#id/iv2Circle5"
app:layout_constraintTop_toBottomOf="#id/iv2Circle5"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
To be sure if Constraint layout really scrolls with Scrollview/Nested Scrollview, I created a demo project with simple layout with Constraint layout within Scrollview, and it DID scroll.
But I'm not sure why my screen with above layout doesn't scroll. Please help me figure out the issue.
Solved it by removing android: fillViewPort = "true" attribute from NestedScrollview, and adding an empty view at the end of layout like this:
<View
android:id="#+id/view1"
android:layout_width="match_parent"
android:layout_height="#dimen/_20sdp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#id/clProgressSignUp"
/>
Pleas try below Structure for scrolling ConstraintLayout.
<LinearLayout>
<androidx.core.widget.NestedScrollView>
<androidx.constraintlayout.widget.ConstraintLayout>
......
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout>
Related
How can i constraint the recyclerview elements to the fragment itself, i made a recyclerview with 3 textviews, then I made item list fragment to contain a labels and the recyclerview but when i open the app i get like the screenshot shows.
i want the recyclerview to be in match line with the Item, Price and quantity labels
RecyclerView
<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="48dp"
android:descendantFocusability="blocksDescendants">
<TextView
android:id="#+id/item_name"
style="#style/Widget.Inventory.ListItemTextView"
android:layout_width="180dp"
android:layout_marginStart="#dimen/margin_between_elements"
android:fontFamily="sans-serif"
app:layout_constraintEnd_toStartOf="#+id/item_price"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="Cogs and Widgets" />
<TextView
android:id="#+id/item_price"
style="#style/Widget.Inventory.ListItemTextView"
android:layout_width="100dp"
android:layout_below="#+id/item_name"
android:layout_marginStart="#dimen/margin_between_elements"
android:fontFamily="sans-serif-medium"
android:textAlignment="center"
app:layout_constraintEnd_toStartOf="#+id/item_quantity"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="#+id/item_name"
app:layout_constraintTop_toTopOf="parent"
tools:text="$4.99" />
<TextView
android:id="#+id/item_quantity"
style="#style/Widget.Inventory.ListItemTextView"
android:layout_width="80dp"
android:layout_alignParentEnd="true"
android:layout_marginEnd="#dimen/margin_between_elements"
android:fontFamily="sans-serif-medium"
android:textAlignment="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintTop_toTopOf="parent"
tools:text="3" />
Fragment
<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:layout_margin="#dimen/margin"
tools:context=".ItemListFragment">
<TextView
android:id="#+id/item_name"
style="#style/Widget.Inventory.Header"
android:layout_marginStart="#dimen/margin_between_elements"
android:text="#string/item"
app:layout_constraintEnd_toStartOf="#+id/item_price"
app:layout_constraintHorizontal_weight="2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/item_price"
style="#style/Widget.Inventory.Header"
android:layout_below="#+id/item_name"
android:layout_marginStart="#dimen/margin_between_elements"
android:text="#string/price"
android:textAlignment="center"
app:layout_constraintEnd_toStartOf="#+id/item_quantity"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="#+id/item_name"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="#+id/item_quantity"
style="#style/Widget.Inventory.Header"
android:layout_alignParentEnd="true"
android:layout_marginEnd="#dimen/margin_between_elements"
android:text="#string/quantity_in_stock"
android:textAlignment="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="#+id/item_price"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="#+id/divider"
style="#style/Divider"
android:layout_marginTop="#dimen/margin_between_elements"
app:layout_constraintBottom_toTopOf="#+id/recyclerView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/item_quantity" />
<androidx.recyclerview.widget.RecyclerView
android:id="#+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/divider" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="#+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="#dimen/margin_between_elements"
android:layout_marginBottom="#dimen/margin_between_elements"
android:contentDescription="#string/add_new_item"
android:src="#android:drawable/ic_input_add"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:tint="#android:color/white" />
</androidx.constraintlayout.widget.ConstraintLayout>
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?
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>
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
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"