Hello I have an issue with my layout. Its working properly on preview mode and on an emulator with Api level 24 but when I run it on a device with api 19 it just breaks up and gets all messed up. Even my edit text fields end up unresponsive. here I paste my XML code to see if you guys coud help me out.
EDIT: I am very sorry I've pasted the wrong code (it was incomplete). I have edited and now its correct. Also attached a couple of pictures of how looks in the named devices.
Here is the messed layout And here is the correct one
.Another thing is that I am using one nested constraint layout. Do you thing that could be it?
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusableInTouchMode="true"
tools:context="com.cuantomefalta.cuantomefalta.MainActivity">
<EditText
android:id="#+id/weighing3"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:background="#drawable/little_square"
android:cursorVisible="false"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:hint="#string/cero_percent"
android:imeOptions="actionDone"
android:inputType="number"
android:textColor="#android:color/white"
android:textSize="25sp"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/weighing2"
tools:text="25%"
android:layout_marginLeft="8dp"
android:layout_marginTop="2dp"
android:layout_marginStart="8dp"/>
<EditText
android:id="#+id/grade3"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:background="#drawable/little_square"
android:cursorVisible="false"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:hint="#string/one"
android:imeOptions="actionDone"
android:inputType="number"
android:textColor="#android:color/white"
android:textSize="25sp"
android:visibility="gone"
app:layout_constraintLeft_toRightOf="#+id/weighing3"
app:layout_constraintRight_toLeftOf="#+id/converted3"
app:layout_constraintTop_toTopOf="#+id/weighing3"
tools:text="100" />
<TextView
android:id="#+id/converted3"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:background="#drawable/little_square"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="#string/one_point_cero"
android:textColor="#android:color/white"
android:textSize="25sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/weighing3"
tools:text="8.5"
android:layout_marginTop="2dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"/>
<EditText
android:id="#+id/weighing2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:background="#drawable/little_square"
android:cursorVisible="false"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:hint="#string/cero_percent"
android:imeOptions="actionDone"
android:inputType="number"
android:textColor="#android:color/white"
android:textSize="25sp"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/weighing1"
tools:text="25%"
android:layout_marginLeft="8dp"
android:layout_marginTop="2dp"
android:layout_marginStart="8dp"/>
<EditText
android:id="#+id/grade2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:background="#drawable/little_square"
android:cursorVisible="false"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:hint="#string/one"
android:imeOptions="actionDone"
android:inputType="number"
android:textColor="#android:color/white"
android:textSize="25sp"
android:visibility="gone"
app:layout_constraintLeft_toRightOf="#+id/weighing2"
app:layout_constraintRight_toLeftOf="#+id/converted2"
app:layout_constraintTop_toTopOf="#+id/weighing2"
tools:text="100" />
<TextView
android:id="#+id/converted2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:background="#drawable/little_square"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="#string/one_point_cero"
android:textColor="#android:color/white"
android:textSize="25sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/weighing2"
tools:text="8.5"
android:layout_marginTop="0dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"/>
<EditText
android:id="#+id/weighing1"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:background="#drawable/little_square"
android:cursorVisible="false"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:hint="#string/cero_percent"
android:imeOptions="actionDone"
android:inputType="number"
android:textColor="#android:color/white"
android:textSize="25sp"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/weighing"
tools:text="25%"
android:layout_marginLeft="8dp"
android:layout_marginTop="2dp"
android:layout_marginStart="8dp"/>
<EditText
android:id="#+id/grade1"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:background="#drawable/little_square"
android:cursorVisible="false"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:hint="#string/one"
android:imeOptions="actionDone"
android:inputType="number"
android:textColor="#android:color/white"
android:textSize="25sp"
android:visibility="gone"
app:layout_constraintLeft_toRightOf="#+id/weighing1"
app:layout_constraintRight_toLeftOf="#+id/converted1"
app:layout_constraintTop_toTopOf="#+id/weighing1"
tools:text="100"
android:layout_marginTop="0dp"
app:layout_constraintHorizontal_bias="0.5" />
<TextView
android:id="#+id/converted1"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:background="#drawable/little_square"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="#string/one_point_cero"
android:textColor="#android:color/white"
android:textSize="25sp"
android:visibility="gone"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/weighing1"
tools:text="8.5"
android:layout_marginTop="0dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"/>
<EditText
android:id="#+id/weighing"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="2dp"
android:background="#drawable/little_square"
android:cursorVisible="false"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:hint="#string/cero_percent"
android:imeOptions="actionDone"
android:inputType="number"
android:textColor="#android:color/white"
android:textSize="25sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="25%"
/>
<EditText
android:id="#+id/grade"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
android:background="#drawable/little_square"
android:cursorVisible="false"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:hint="#string/one"
android:imeOptions="actionDone"
android:inputType="number"
android:textColor="#android:color/white"
android:textSize="25sp"
app:layout_constraintLeft_toRightOf="#+id/weighing"
app:layout_constraintRight_toLeftOf="#+id/converted"
app:layout_constraintTop_toTopOf="#+id/weighing"
tools:text="100" />
<TextView
android:id="#+id/converted"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:background="#drawable/little_square"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="#string/one_point_cero"
android:textColor="#android:color/white"
android:textSize="25sp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/weighing"
tools:text="1.0" />
<com.google.android.gms.ads.AdView xmlns:ads="http://schemas.android.com/apk/res-auto"
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="ca-app-pub-2505831397151341/8310107897"
ads:layout_constraintBottom_toBottomOf="parent"
ads:layout_constraintHorizontal_bias="0.0"
ads:layout_constraintLeft_toLeftOf="parent"
ads:layout_constraintRight_toRightOf="parent" />
<android.support.constraint.ConstraintLayout
android:id="#+id/shareView"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_gravity="center_vertical"
android:background="#drawable/big_circle"
android:layout_marginEnd="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginStart="8dp"
app:layout_constraintBottom_toTopOf="#+id/adView"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<TextSwitcher
android:id="#+id/final_grade"
android:layout_width="0dp"
android:layout_height="234dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginTop="-12dp"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:textColor="#android:color/white"
android:textSize="125sp"
tools:text="55" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginTop="-12dp"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:textColor="#android:color/white"
android:textSize="125sp"
tools:text="99" />
</TextSwitcher>
<EditText
android:id="#+id/goalGrade"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_vertical"
android:background="#drawable/little_circle"
android:cursorVisible="false"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:inputType="number"
android:imeOptions="actionDone"
android:text="#string/five"
android:textColor="#android:color/white"
android:textSize="30sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
tools:text="#string/five"
android:layout_marginBottom="8dp" />
<TextView
android:id="#+id/first_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:text="#string/me_faltan"
android:textColor="#android:color/white"
android:textSize="25sp"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/shareView"
android:layout_marginTop="24dp"
/>
<TextView
android:id="#+id/second_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:text="#string/para_llegar"
android:textColor="#android:color/white"
android:textSize="20sp"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="#+id/goalGrade"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/floatingActionButton8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:clickable="true"
app:fabSize="mini"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="#+id/shareView"
app:srcCompat="#drawable/ic_add_white_24dp" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/floatingActionButton9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:clickable="true"
app:fabSize="mini"
app:layout_constraintLeft_toLeftOf="#+id/floatingActionButton8"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/floatingActionButton8"
app:srcCompat="#drawable/ic_clear_white_24dp" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/floatingActionButton10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:clickable="true"
app:fabSize="mini"
app:layout_constraintLeft_toLeftOf="#+id/floatingActionButton9"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/floatingActionButton9"
app:srcCompat="#drawable/ic_delete_sweep_white_24dp" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/floatingActionButton11"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:clickable="true"
app:fabSize="mini"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="#+id/floatingActionButton10"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/floatingActionButton10"
app:layout_constraintBottom_toBottomOf="#id/shareView"
app:srcCompat="#drawable/ic_play_arrow_white_24dp" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/floatingActionButton12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginRight="0dp"
android:clickable="true"
app:fabSize="mini"
app:layout_constraintRight_toRightOf="#id/shareView"
app:layout_constraintBottom_toBottomOf="#+id/shareView"
app:srcCompat="#drawable/ic_share_white_24dp"
android:visibility="gone"
android:layout_marginBottom="56dp" />
</android.support.constraint.ConstraintLayout>
Check in the build.gradle(module App) for the minSdkVersion & targetSdkVersion, your device might not be in the range, if so correct that
Your display resolution might be the problem.
Related
I am using InputEditTextLayout Outline Dense.
The stroke is cut out like this when hint enabled= off but shown correctly when hint is enabled.
https://ibb.co/yPrjHJ2
https://ibb.co/WD8Lktc
I tried putting padding and margins but nothing works. I couldn't find how to set padding for background in InputEditTextLayout.
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<ImageView
android:id="#+id/imageView2"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_marginTop="124dp"
android:minHeight="10dp"
android:paddingBottom="16dp"
android:src="#drawable/signin_header"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/textInputLayout2"
style="#style/LoginTextInputLayoutStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:hintEnabled="false"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toStartOf="#+id/guideline2"
app:layout_constraintHorizontal_bias="0.0"
android:paddingBottom="4dp"
android:paddingTop="2dp"
app:layout_constraintStart_toStartOf="#+id/guideline3"
app:layout_constraintTop_toBottomOf="#+id/imageView2">
<com.google.android.material.textfield.TextInputEditText
android:id="#+id/login_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email"
android:paddingStart="16dp"
android:layout_gravity="center"
android:inputType="textEmailAddress"
android:textColor="#color/LightBlack"
android:textColorHint="#color/LightBlack"
android:textSize="16dp" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/textInputLayout"
style="#style/LoginTextInputLayoutStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginVertical="#dimen/tex_size_default"
android:layout_marginTop="32dp"
app:hintEnabled="false"
android:paddingBottom="2dp"
android:paddingTop="2dp"
app:layout_constraintEnd_toStartOf="#+id/guideline2"
app:layout_constraintStart_toStartOf="#+id/guideline3"
app:layout_constraintTop_toBottomOf="#+id/textInputLayout2"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:id="#+id/login_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter Password"
android:inputType="textPassword"
android:paddingStart="16dp"
android:textColorHint="#color/LightBlack"
android:textColor="#color/LightBlack"
android:textSize="16sp" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="#+id/not_regis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:paddingEnd="5dp"
android:text="Not registered?"
android:textAlignment="center"
android:textColor="#android:color/white"
android:textSize="#dimen/tex_size_default"
app:layout_constraintStart_toStartOf="#+id/textView13"
app:layout_constraintTop_toBottomOf="#+id/textView13" />
<TextView
android:id="#+id/login_signup"
style="#style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="wrap_content"
android:layout_height="26dp"
android:layout_toEndOf="#+id/not_regis"
android:onClick="signup_screen"
android:text="Sign Up"
android:textAlignment="center"
android:textColor="#F57C00"
android:textSize="#dimen/tex_size_default"
android:textStyle="bold"
app:layout_constraintBaseline_toBaselineOf="#+id/not_regis"
app:layout_constraintStart_toEndOf="#+id/not_regis" />
<com.google.android.material.button.MaterialButton
android:id="#+id/login_login"
style="#style/RoundButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="92dp"
android:layout_marginTop="32dp"
android:onClick="login"
android:padding="10dp"
android:text="LOGIN"
android:textColor="#android:color/black"
app:layout_constraintStart_toStartOf="#+id/guideline3"
app:layout_constraintTop_toBottomOf="#+id/textInputLayout" />
<TextView
android:id="#+id/textView13"
android:layout_width="137dp"
android:layout_height="23dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="8dp"
android:layout_marginTop="40dp"
android:onClick="forgetpassword"
android:text="Forgot password"
android:textColor="#F57C00"
android:textSize="#dimen/tex_size_default"
app:layout_constraintStart_toStartOf="#+id/guideline3"
app:layout_constraintTop_toBottomOf="#+id/login_login" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.84" />
<androidx.constraintlayout.widget.Guideline
android:id="#+id/guideline3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.16" />
</androidx.constraintlayout.widget.ConstraintLayout>
You can try below sample one to showing correctly TextInpuLayout Stroke. You can also refer them for a more complete solution.
<TextView
android:id="#+id/not_regis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:paddingEnd="5dp"
android:text="Not registered?"
android:textAlignment="center"
android:textColor="#android:color/white"
android:textSize="#dimen/tex_size_default"
app:layout_constraintStart_toStartOf="#+id/textView13"
app:layout_constraintTop_toBottomOf="#+id/textView13" />
Try this one example which I have used.
<com.google.android.material.textfield.TextInputLayout
android:id="#+id/user_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="42dp"
android:layout_marginTop="87dp"
android:layout_marginEnd="42dp"
android:theme="#style/TextLabel"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#id/tv_bold_line">
<androidx.appcompat.widget.AppCompatAutoCompleteTextView
android:id="#+id/ed_user_name"
style="#style/TextViewSingleLine"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:drawableEndCompat="#drawable/ic_user"
android:hint="#string/user_name"
android:imeOptions="actionNext"
android:paddingBottom="16dp"
android:textSize="#dimen/login_text" />
</com.google.android.material.textfield.TextInputLayout>
This is my first time programming in android studio and I need help in figuring out how to compare options selected by the user based on the radio buttons and query an api to pull data from a website. Below is the code of the layout.The results are supposed to be displayed on another page, thank you.
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0663ba"
tools:context=".MainActivity"
tools:layout_editor_absoluteY="81dp">
<Button
android:id="#+id/button"
android:layout_width="88dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="#000000"
android:text="#string/search"
android:textColor="#FFFFFF"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/editText3" />
<EditText
android:id="#+id/editText"
android:layout_width="172dp"
android:layout_height="50dp"
android:layout_marginBottom="32dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:ems="10"
android:hint="#string/zip_code"
android:inputType="textPostalAddress"
app:layout_constraintBottom_toTopOf="#+id/textView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.04"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="MissingConstraints" />
<TextView
android:id="#+id/textView2"
android:layout_width="175dp"
android:layout_height="44dp"
android:layout_marginBottom="48dp"
android:layout_marginStart="8dp"
android:fontFamily="sans-serif"
android:text="#string/select_date_range"
android:textAppearance="#style/TextAppearance.AppCompat"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/textView3"
app:layout_constraintStart_toStartOf="parent" />
<RadioGroup
android:id="#+id/radioGroup6"
android:layout_width="144dp"
android:layout_height="0dp"
android:layout_marginBottom="14dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:textColor="#FFFFFF"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/radioGroup7"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/textView2"
app:layout_constraintTop_toBottomOf="#+id/imageButton">
<RadioButton
android:id="#+id/radioButton8"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:checked="true"
android:text="#string/_1_week"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<RadioButton
android:id="#+id/radioButton9"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="#string/_2_weeks"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<RadioButton
android:id="#+id/radioButton7"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="#string/_3_months"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</RadioGroup>
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_marginBottom="28dp"
android:layout_marginStart="16dp"
android:text="#string/select_crime_type"
android:textAppearance="#style/TextAppearance.AppCompat"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/textView4"
app:layout_constraintStart_toStartOf="parent" />
<RadioGroup
android:id="#+id/radioGroup7"
android:layout_width="144dp"
android:layout_height="0dp"
android:layout_marginBottom="11dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:textColor="#FFFFFF"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/textView4"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/textView3"
app:layout_constraintTop_toBottomOf="#+id/radioGroup6">
<RadioButton
android:id="#+id/radioButton13"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/rape"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<RadioButton
android:id="#+id/radioButton15"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="#string/assault"
android:textColor="#FFFFFF"
android:textSize="18sp" />
<RadioButton
android:id="#+id/radioButton14"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:text="#string/murder"
android:textColor="#FFFFFF"
android:textSize="18sp" />
</RadioGroup>
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="33dp"
android:text="#string/search_for_criminal_or_victim"
android:textAlignment="viewStart"
android:textAppearance="#style/TextAppearance.AppCompat"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="#+id/editText3"
app:layout_constraintEnd_toEndOf="#+id/radioGroup7"
app:layout_constraintTop_toBottomOf="#+id/radioGroup7" />
<EditText
android:id="#+id/editText3"
android:layout_width="195dp"
android:layout_height="45dp"
android:layout_marginBottom="66dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:ems="10"
android:hint="#string/enter_full_name"
android:inputType="textPersonName"
android:textColor="#FFFFFF"
android:textSize="24sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.502"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView4" />
<ImageButton
android:id="#+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="147dp"
android:layout_marginBottom="76dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:backgroundTint="#a91818"
android:scaleType="fitCenter"
android:src="#drawable/new_crime_img"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="#+id/radioGroup6"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
</android.support.constraint.ConstraintLayout>
On my ListView some lines are not RTL aligned.
After scrolling and redrawing the lines are correct.
My layout of the line item:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/clFrontView"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:id="#+id/ivCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/circle"
tools:ignore="ContentDescription"
android:layout_marginTop="5dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintLeft_toLeftOf="parent" />
<ImageView
android:id="#+id/ivReminderType"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
tools:ignore="ContentDescription"
app:layout_constraintTop_toTopOf="#id/ivCircle"
app:layout_constraintBottom_toBottomOf="#id/ivCircle"
app:layout_constraintStart_toStartOf="#id/ivCircle"
app:layout_constraintEnd_toEndOf="#id/ivCircle"
app:layout_constraintLeft_toLeftOf="#id/ivCircle"
app:layout_constraintRight_toRightOf="#id/ivCircle" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/civContactImage"
android:layout_width="42dp"
android:layout_height="42dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<ImageView
android:id="#+id/icivCircleSmall"
android:layout_width="15dp"
android:layout_height="15dp"
app:layout_constraintEnd_toEndOf="#id/civContactImage"
app:layout_constraintRight_toRightOf="#id/civContactImage"
app:layout_constraintBottom_toBottomOf="#id/civContactImage"
tools:ignore="ContentDescription"/>
<TextView
android:id="#+id/tvTextLine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
tools:text="Line of Text"
android:textSize="18sp"
android:maxLines="2"
app:layout_constraintLeft_toRightOf="#id/ivCircle"
app:layout_constraintStart_toEndOf="#id/ivCircle"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"/>
<TextView
android:id="#+id/tvTextLine2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintStart_toStartOf="#id/tvTextLine"
app:layout_constraintLeft_toLeftOf="#id/tvTextLine"
app:layout_constraintTop_toBottomOf="#id/tvTextLine" />
<TextView
android:id="#+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
tools:text="Wed, 01.05.2018 10:10"
android:textColor="#FF909090"
android:textSize="12sp"
android:drawablePadding="5dp"
app:layout_constraintStart_toStartOf="#id/tvTextLine"
app:layout_constraintLeft_toLeftOf="#id/tvTextLine"
app:layout_constraintTop_toBottomOf="#id/tvTextLine2" />
<TextView
android:id="#+id/tvRepeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
tools:text="Every 2nd Friday"
android:textColor="#FF909090"
android:textSize="12sp"
android:drawablePadding="5dp"
app:layout_constraintStart_toStartOf="#id/tvTextLine"
app:layout_constraintLeft_toLeftOf="#id/tvTextLine"
app:layout_constraintTop_toBottomOf="#id/tvTime" />
</android.support.constraint.ConstraintLayout>
First start it looks like this, the first line is not RTL:
After scrolling down and again up to the top it is correct:
build.gradle dependency:
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
These changes may work:
<ImageView
android:id="#+id/ivCircle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/bg_circle_win"
app:layout_constraintBottom_toBottomOf="#+id/civContactImage"
app:layout_constraintStart_toStartOf="#+id/civContactImage"
tools:ignore="ContentDescription" />
<ImageView
android:id="#+id/ivReminderType"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
app:layout_constraintEnd_toEndOf="#+id/civContactImage"
app:layout_constraintTop_toTopOf="#+id/civContactImage"
tools:ignore="ContentDescription" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/civContactImage"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/icivCircleSmall"
android:layout_width="15dp"
android:layout_height="15dp"
app:layout_constraintEnd_toEndOf="#id/civContactImage"
app:layout_constraintRight_toRightOf="#id/civContactImage"
app:layout_constraintBottom_toBottomOf="#id/civContactImage"
tools:ignore="ContentDescription"/>
<TextView
android:id="#+id/tvTextLine"
android:layout_width="wrap_content"
android:layout_height="23dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:gravity="center_vertical"
android:maxLines="2"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="#+id/civContactImage"
tools:text="Line of Text" />
<TextView
android:id="#+id/tvTextLine2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="16sp"
android:visibility="gone" />
<TextView
android:id="#+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:textColor="#FF909090"
android:textSize="12sp"
app:layout_constraintEnd_toStartOf="#+id/civContactImage"
app:layout_constraintTop_toBottomOf="#+id/tvTextLine"
tools:text="Wed, 01.05.2018 10:10" />
<TextView
android:id="#+id/tvRepeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:textColor="#FF909090"
android:textSize="12sp"
app:layout_constraintEnd_toStartOf="#+id/civContactImage"
app:layout_constraintTop_toBottomOf="#+id/tvTime"
tools:text="Every 2nd Friday" />
I hope to work. good luck
Try this maybe it could solve the problem. Small testing changes are there you can remove them according to your need, Firstly, I have changed the tools:text to android:text so that it shows dummy data.Secondly, The two imageview named as ivReminderType and icivCircleSmall I have put two default images just for testing purpose so do change that. Also there is one imageview named icivCircleSmall I didnt know where it should be constarined to so I have not edited any code written for it. Below is the edited code of the xml.
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/clFrontView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="10dp">
<ImageView
android:id="#+id/ivCircle"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:src="#mipmap/ic_launcher"
app:layout_constraintBottom_toTopOf="#+id/tvRepeat"
app:layout_constraintEnd_toStartOf="#+id/tvTime"
app:layout_constraintTop_toBottomOf="#+id/tvTextLine"
tools:ignore="ContentDescription" />
<ImageView
android:id="#+id/ivReminderType"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:src="#mipmap/ic_launcher"
app:layout_constraintBottom_toBottomOf="#+id/tvRepeat"
app:layout_constraintEnd_toStartOf="#+id/tvRepeat"
app:layout_constraintTop_toBottomOf="#+id/tvTime"
tools:ignore="ContentDescription" />
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/civContactImage"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:src="#mipmap/ic_launcher"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="#+id/icivCircleSmall"
android:layout_width="15dp"
android:layout_height="15dp"
app:layout_constraintBottom_toBottomOf="#id/civContactImage"
app:layout_constraintEnd_toEndOf="#id/civContactImage"
app:layout_constraintRight_toRightOf="#id/civContactImage"
tools:ignore="ContentDescription" />
<TextView
android:id="#+id/tvTextLine"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:gravity="center_vertical"
android:maxLines="2"
android:text="Line of Text"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="#+id/civContactImage"
app:layout_constraintTop_toTopOf="#+id/civContactImage" />
<TextView
android:id="#+id/tvTextLine2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="16sp"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="#id/tvTextLine"
app:layout_constraintStart_toStartOf="#id/tvTextLine"
app:layout_constraintTop_toBottomOf="#id/tvTextLine" />
<TextView
android:id="#+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:text="Wed, 01.05.2018 10:10"
android:textColor="#FF909090"
android:textSize="12sp"
app:layout_constraintEnd_toStartOf="#+id/civContactImage"
app:layout_constraintTop_toBottomOf="#id/tvTextLine2" />
<TextView
android:id="#+id/tvRepeat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:text="Every 2nd Friday"
android:textColor="#FF909090"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="#+id/tvTime"
app:layout_constraintLeft_toLeftOf="#id/tvTextLine"
app:layout_constraintStart_toStartOf="#id/tvTextLine"
app:layout_constraintTop_toBottomOf="#id/tvTime" />
</android.support.constraint.ConstraintLayout>
Hope it helps!
Searched around, can't find this issue specifically. Created an account specifically to ask WHAT'S HAPPENING HERE?!
Using a ConstraintLayout for the first time - I've had good success, but for some reason CANNOT get two of my Components to play nicely.
Here's what I WANT it to look like (accomplished by breaking constraints and hardcoding stuff):
...and here's the jumbled mess I get if I try to constrain "LabelJournal" and "linearLayout2":
The problems are happening for components named "LabelJournal" and "linearLayout2". Here's what my LayoutFile looks like... It's a WIP so I know right now there's a lot of hardcoding of text values and whatnot - I'm just trying to figure out WHAT in the world is causing these two components to get stuck at the top of the parent:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="#+id/imageButton"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#android:color/transparent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_left" />
<EditText
android:id="#+id/editText"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_marginEnd="14dp"
android:layout_marginStart="14dp"
android:inputType="date"
android:text="03/04/2018"
android:textAlignment="center"
android:textSize="24sp"
app:layout_constraintEnd_toStartOf="#+id/imageButton2"
app:layout_constraintStart_toEndOf="#+id/imageButton"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="#+id/imageButton2"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#android:color/transparent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="#drawable/ic_right" />
<TextView
android:id="#+id/LabelJournal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="Journal:"
android:textStyle="italic"
app:layout_constraintBottom_toTopOf="#id/ContentJournal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/imageButton" />
<TextView
android:id="#+id/ContentJournal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="The journal text would go in right about here. It should wrap to the next line for sufficientyl large text blocks."
android:textColorLink="#android:color/black"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="#+id/LabelTags"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/LabelJournal" />
<TextView
android:id="#+id/LabelTags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp"
android:text="Tags:"
android:textStyle="italic"
app:layout_constraintBottom_toTopOf="#+id/horizontalScrollView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="#id/ContentJournal" />
<HorizontalScrollView
android:id="#+id/horizontalScrollView"
android:layout_width="0dp"
android:layout_height="41dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/LabelTags">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:id="#+id/TagDayOff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:padding="10dp"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:text="#DayOff"
android:textAlignment="center"
android:textColor="#android:color/darker_gray"
android:textSize="18sp" />
<TextView
android:id="#+id/TagUntracked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:padding="10dp"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:text="#Untracked"
android:textAlignment="center"
android:textColor="#android:color/darker_gray"
android:textSize="18sp" />
<TextView
android:id="#+id/TagTravel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:padding="10dp"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:text="#Travel"
android:textAlignment="center"
android:textColor="#android:color/darker_gray"
android:textSize="18sp" />
<TextView
android:id="#+id/TagGames"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:padding="10dp"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:text="#Games"
android:textAlignment="center"
android:textColor="#android:color/darker_gray"
android:textSize="18sp" />
<TextView
android:id="#+id/TagMovie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical|center_horizontal"
android:padding="10dp"
android:paddingBottom="15dp"
android:paddingTop="15dp"
android:text="#Games"
android:textAlignment="center"
android:textColor="#android:color/darker_gray"
android:textSize="18sp" />
</LinearLayout>
</HorizontalScrollView>
<TextView
android:id="#+id/LabelDIet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="Diet:"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/horizontalScrollView" />
<TextView
android:id="#+id/ContentCalories"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="8dp"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/LabelDIet"
tools:text="2813" />
<TextView
android:id="#+id/DietCalLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="Cal"
android:textSize="10sp"
android:textStyle="italic"
app:layout_constraintBottom_toBottomOf="#+id/ContentCalories"
app:layout_constraintStart_toEndOf="#+id/ContentCalories" />
<ProgressBar
android:id="#+id/ProgressCalories"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="2dp"
android:layout_marginEnd="-8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="2dp"
android:progressDrawable="#android:color/holo_blue_dark"
android:progressTint="#android:color/holo_green_light"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="#+id/ContentCalories"
app:layout_constraintEnd_toEndOf="#+id/ContentProteinPercent"
app:layout_constraintStart_toEndOf="#+id/DietCalLabel"
app:layout_constraintTop_toTopOf="#+id/ContentCalories" />
<TextView
android:id="#+id/ContentProtein"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="#+id/DietCalLabel"
app:layout_constraintTop_toBottomOf="#+id/ContentCalories"
tools:text="154" />
<TextView
android:id="#+id/DietProteinLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="P"
android:textSize="10sp"
android:textStyle="italic"
app:layout_constraintBottom_toBottomOf="#+id/ContentProtein"
app:layout_constraintStart_toEndOf="#+id/ContentProtein" />
<ProgressBar
android:id="#+id/ProgressProtein"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="150dp"
android:layout_height="0dp"
android:layout_marginBottom="4dp"
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:progressDrawable="#android:color/holo_blue_dark"
android:progressTint="#android:color/holo_red_light"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="#+id/ContentProtein"
app:layout_constraintStart_toEndOf="#+id/DietCalLabel"
app:layout_constraintTop_toTopOf="#+id/ContentProtein" />
<TextView
android:id="#+id/ContentProteinPercent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:paddingEnd="8dp"
android:paddingStart="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.074"
app:layout_constraintStart_toEndOf="#+id/ProgressProtein"
app:layout_constraintTop_toTopOf="#+id/ContentProtein"
tools:text="22 %" />
<TextView
android:id="#+id/ContentFat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="#+id/DietCalLabel"
app:layout_constraintTop_toBottomOf="#+id/ContentProtein"
tools:text="103" />
<TextView
android:id="#+id/dietProteinLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="F"
android:textSize="10sp"
android:textStyle="italic"
app:layout_constraintBottom_toBottomOf="#+id/ContentFat"
app:layout_constraintStart_toEndOf="#+id/ContentFat" />
<ProgressBar
android:id="#+id/ProgressFats"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="150dp"
android:layout_height="0dp"
android:layout_marginBottom="4dp"
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:progressDrawable="#android:color/holo_blue_dark"
android:progressTint="#android:color/holo_orange_light"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="#+id/ContentFat"
app:layout_constraintStart_toEndOf="#+id/DietCalLabel"
app:layout_constraintTop_toTopOf="#+id/ContentFat" />
<TextView
android:id="#+id/contentProteinPercent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:paddingEnd="8dp"
android:paddingStart="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.074"
app:layout_constraintStart_toEndOf="#+id/ProgressProtein"
app:layout_constraintTop_toTopOf="#+id/ContentFat"
tools:text="33 %" />
<TextView
android:id="#+id/ContentCarbs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:textSize="18sp"
app:layout_constraintEnd_toStartOf="#+id/DietCalLabel"
app:layout_constraintTop_toBottomOf="#+id/ContentFat"
tools:text="302" />
<TextView
android:id="#+id/DietCarbLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="C"
android:textSize="10sp"
android:textStyle="italic"
app:layout_constraintBottom_toBottomOf="#+id/ContentCarbs"
app:layout_constraintStart_toEndOf="#+id/ContentCarbs" />
<ProgressBar
android:id="#+id/ProgressCarbs"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="150dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginStart="8dp"
android:progressDrawable="#android:color/holo_blue_dark"
android:progressTint="#android:color/holo_blue_light"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="#+id/ContentCarbs"
app:layout_constraintStart_toEndOf="#+id/DietCalLabel"
app:layout_constraintTop_toTopOf="#+id/ContentCarbs" />
<TextView
android:id="#+id/ContentCarbPercent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:paddingEnd="8dp"
android:paddingStart="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.074"
app:layout_constraintStart_toEndOf="#+id/ProgressProtein"
app:layout_constraintTop_toTopOf="#+id/ContentCarbs"
tools:text="43 %" />
<TextView
android:id="#+id/LabelExercise"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="Exercise:"
android:textStyle="italic"
app:layout_constraintBottom_toTopOf="#+id/linearLayout2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/ContentCarbs" />
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="436dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/LabelExercise" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageButton
android:id="#+id/ImageExerciseAttribution"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_weight="1"
android:background="#android:color/transparent"
android:scaleType="fitXY"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/LabelExercise"
app:srcCompat="#drawable/fit" />
<TextView
android:id="#+id/ContentExercise"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:text="45 min - PHUL Upper Power"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="#+id/ImageExerciseAttribution"
app:layout_constraintStart_toEndOf="#+id/ImageExerciseAttribution"
app:layout_constraintTop_toTopOf="#+id/ImageExerciseAttribution" />
</LinearLayout>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
Perhaps I should also mention - I have no errors showing up in my Constraint Layout (although a ton of warnings about hardcoded text and whatnot that I'll deal with later).
Alright took me an hour of tinkering - but ever line in my Layout HTML that contains "layout_constraintBottom_toTopOf" caused the problem. I don't know if it's an ordering thing or some weird drawing hierarchy. It makes no sense to me how this got busted.
I tried every combination of this, some people said it's a bug but I think it's something small I'm missing. With the follwing XML, I can't scroll at all, only the horizontal scroll works.
I have a side-scroll RecyclerView which I can drag left and right, but the page has more I items than can fit, hence the ScrollView.
At first I was aiming for a collapsable toolbar, but when I add CoordinatorLayout, the activity is just blank.
My XML:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="true"
app:layout_constraintTop_toBottomOf="#+id/scrollv"
tools:context="com.wearecatchapp.blueandwhite.catchapp_droid.EventDetailActivity">
<android.support.v7.widget.Toolbar
android:id="#+id/detail_toolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="#fff"
android:elevation="2dp"
android:minHeight="60dp"
android:theme="#style/ThemeOverlay.AppCompat.ActionBar"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="#+id/evt_title"
fontPath="fonts/PanameFY.otf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="30sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="2dp"
android:text="Organizer's level:"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="12sp" />
<ImageView
android:id="#+id/org_level"
android:layout_width="60dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical" />
</LinearLayout>
<TextView
android:id="#+id/optional_title"
fontPath="fonts/PanameFY.otf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:padding="2dp"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="24sp"
android:visibility="gone" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
<android.support.v4.widget.NestedScrollView
android:id="#+id/scrollv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="#+id/detail_toolbar">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/activity_image"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:srcCompat="#color/black" />
<TextView
android:id="#+id/month"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="NOV"
android:textAlignment="center"
android:textColor="#android:color/holo_red_light"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/activity_image" />
<TextView
android:id="#+id/day"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="2dp"
android:text="15"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="24sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/month" />
<TextView
android:id="#+id/starts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="Starts"
android:textColor="#color/black"
android:textSize="18sp"
app:layout_constraintLeft_toRightOf="#+id/month"
app:layout_constraintTop_toBottomOf="#+id/activity_image" />
<TextView
android:id="#+id/ends"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="7dp"
android:text="Ends"
android:textColor="#color/black"
android:textSize="18sp"
app:layout_constraintLeft_toRightOf="#+id/day"
app:layout_constraintTop_toBottomOf="#+id/starts" />
<TextView
android:id="#+id/start_date"
fontPath="fonts/AvenirNext-Medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="42dp"
android:layout_marginStart="42dp"
android:layout_marginTop="8dp"
android:text=" 18:10 Wed, Nov 15"
android:textColor="#color/black"
android:textSize="18sp"
app:layout_constraintLeft_toRightOf="#+id/starts"
app:layout_constraintTop_toBottomOf="#+id/activity_image" />
<TextView
android:id="#+id/textView34"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginStart="50dp"
android:layout_marginTop="7dp"
android:textColor="#color/black"
android:textSize="18sp"
app:layout_constraintLeft_toRightOf="#+id/ends"
app:layout_constraintTop_toBottomOf="#+id/start_date" />
<View
android:id="#+id/view10"
id="#+id/view8"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="#color/thegray"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/linearLayout2" />
<View
android:id="#+id/view9"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="9dp"
android:background="#color/thegray"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView34" />
<LinearLayout
android:id="#+id/linearLayout"
android:layout_width="397dp"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView34">
<ImageView
android:id="#+id/requests_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_weight="1"
app:srcCompat="#drawable/requestsicon" />
<ImageView
android:id="#+id/invite_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_weight="1"
app:srcCompat="#drawable/invitefriends" />
<ImageView
android:id="#+id/recommend_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_weight="1"
app:srcCompat="#drawable/recommend" />
<ImageView
android:id="#+id/share_image"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_weight="1"
app:srcCompat="#drawable/shareblue" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="396dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/linearLayout">
<TextView
android:id="#+id/requests_text"
fontPath="fonts/avenir-next-bold.ttf"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Requests"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:id="#+id/invite_friends_text"
fontPath="fonts/avenir-next-bold.ttf"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Invite friends"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:id="#+id/recommend_event_text"
fontPath="fonts/avenir-next-bold.ttf"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Recommend"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="12sp" />
<TextView
android:id="#+id/share_text"
fontPath="fonts/avenir-next-bold.ttf"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Share"
android:textAlignment="center"
android:textColor="#color/black"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="#+id/status_text"
fontPath="fonts/avenir-next-bold.ttf"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingLeft="8dp"
android:textColor="#color/dark_gray"
android:textSize="20sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view10" />
<ImageView
android:id="#+id/is_for"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="6dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/status_text"
app:srcCompat="#drawable/maleandfemale" />
<TextView
android:id="#+id/going"
fontPath="fonts/AvenirNext-Medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="15dp"
android:text="going"
android:textColor="#color/black"
app:layout_constraintLeft_toRightOf="#+id/is_for"
app:layout_constraintTop_toBottomOf="#+id/status_text" />
<TextView
android:id="#+id/more_togo"
fontPath="fonts/AvenirNext-Medium.ttf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginStart="20dp"
android:layout_marginTop="15dp"
android:text="TextView"
android:textColor="#color/black"
app:layout_constraintLeft_toRightOf="#+id/hor_view"
app:layout_constraintTop_toBottomOf="#+id/status_text" />
<View
android:id="#+id/hor_view"
class="android.support.v4.widget.Space"
android:layout_width="1dp"
android:layout_height="30dp"
android:layout_marginLeft="35dp"
android:layout_marginStart="35dp"
android:layout_marginTop="8dp"
android:background="#color/dark_gray"
app:layout_constraintLeft_toRightOf="#+id/going"
app:layout_constraintTop_toBottomOf="#+id/status_text" />
<android.support.v7.widget.RecyclerView
android:id="#+id/participants_list"
android:layout_width="0dp"
android:layout_height="117dp"
android:layout_marginTop="12dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/hor_view" />
<View
android:id="#+id/view16"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="8dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/participants_list" />
<TextView
android:id="#+id/textView47"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="17dp"
android:text="Costs"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view16" />
<TextView
android:id="#+id/cost_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="17dp"
android:text="TextView"
android:textSize="18sp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view16" />
<View
android:id="#+id/view19"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="55dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view16" />
<TextView
android:id="#+id/cost_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="13dp"
android:textSize="18sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view19" />
<View
android:id="#+id/view20"
android:layout_width="0dp"
android:layout_height="1px"
android:layout_marginTop="16dp"
android:background="#color/thegray"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view19" />
<ImageView
android:id="#+id/imageView15"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:padding="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/view20"
app:srcCompat="#drawable/pinblue" />
<TextView
android:id="#+id/textView50"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="7dp"
android:layout_marginStart="7dp"
android:layout_marginTop="16dp"
android:text="Event location"
android:textColor="#color/colorPrimary"
android:textSize="18sp"
app:layout_constraintLeft_toRightOf="#+id/imageView15"
app:layout_constraintTop_toBottomOf="#+id/view20" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:padding="8dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/textView50"
app:srcCompat="#drawable/background" />
</android.support.constraint.ConstraintLayout>
</android.support.v4.widget.NestedScrollView>
<android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="60dp"
android:layout_marginBottom="29dp"
android:layout_marginEnd="40dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:layout_marginStart="40dp"
app:cardBackgroundColor="#color/colorPrimary"
app:cardCornerRadius="18dp"
app:cardElevation="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:text="REQUEST TO JOIN"
android:textColor="#android:color/white"
android:textSize="14dp" />
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
Someone pleeeease for the love of god explain this sh*t to me.
Try adding setNestedScrollingEnabled(false) to your inner recyclerview.
https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html
setNestedScrollingEnabled
Enable or disable nested scrolling for this view.
If this property is set to true the view will be permitted to initiate
nested scrolling operations with a compatible parent view in the
current hierarchy. If this view does not implement nested scrolling
this will have no effect. Disabling nested scrolling while a nested
scroll is in progress has the effect of stopping the nested scroll.
1)xml
android.support.v4.widget.NestedScrollView
inner use LinerLayout
2)
recyclerView = (RecyclerView)view.findViewById(R.id.recyclerview_main);
recyclerView.setNestedScrollingEnabled(false);
If someone still facing this issue, please take care of 2 things:
Your NestedScrollView height should be match_parent. If you are using NestedScrollView inside ConstraintLayout you can achive this by following line of code
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
Add below line in your RecyclerView
android:nestedScrollingEnabled="false"
I hope it will save others time.