Android RecyclerView in ConstraintLayout doesn’t scroll

For a RecyclerView to scroll, one of two things must be true: The RecyclerView has a smaller height than all of its items The RecyclerView is inside a scrolling parent ConstraintLayout is not a scrolling parent, so we have to make sure that the RecyclerView is “too small”, which will cause it to let the … Read more

Android – Constraint layout – How to align a view centered over edge of other view?

Try this: <?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:orientation=”vertical” android:padding=”20dp”> <android.support.v7.widget.CardView android:id=”@+id/card_1″ android:layout_width=”0dp” android:layout_height=”200dp” android:layout_marginStart=”8dp” android:layout_marginEnd=”8dp” android:layout_marginTop=”8dp” app:layout_constraintStart_toStartOf=”parent” app:layout_constraintEnd_toEndOf=”parent” app:layout_constraintTop_toTopOf=”parent” /> <android.support.v7.widget.CardView android:id=”@+id/card_2″ android:layout_width=”100dp” android:layout_height=”100dp” android:layout_marginBottom=”8dp” android:layout_marginStart=”8dp” android:layout_marginEnd=”8dp” android:layout_marginTop=”0dp” app:cardBackgroundColor=”#69F” app:layout_constraintBottom_toBottomOf=”@+id/card_1″ app:layout_constraintStart_toStartOf=”@+id/card_1″ app:layout_constraintEnd_toEndOf=”@+id/card_1″ app:layout_constraintTop_toBottomOf=”@+id/card_1″ /> </android.support.constraint.ConstraintLayout> Explanation :- This works because of these four lines Following lines sets the blue CardView centered … Read more

Chain with a barrier in ConstraintLayout

I know it’s old but i think to do that without nesting, you have to change top component to something like this. android:layout_height=”wrap_content” android:layout_gravity=”center” <androidx.constraintlayout.widget.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_gravity=”center” xmlns:tools=”http://schemas.android.com/tools” xmlns:app=”http://schemas.android.com/apk/res-auto”>

make RecyclerView’s height to “wrap_content” in Constraint layout

i had the same issue and i find this solution: you should add this attribute to your recyclerview and it makes your recyclerview wrap_content in the constraint_layout: app:layout_constraintHeight_default=”wrap” let me know if this solution fixed your problem. EDIT : recycler’s height should be 0dp. EDIT 2 : in the newer versions of support library, use … Read more

Can’t form a chain between two views/widgets in Android Studio

I was trying to figure this out too. I’ve discovered that one way to do it is to select both views, then right click and select Center Horizontally. This creates the chain, but then you have to adjust any other constraints accordingly. I’m new to Android, so I’m sure there will be other ways….

How to add different weight to ConstraintLayout views

In XML Create a horizontal chain, and then use the app:layout_constraintHorizontal_weight attribute: <?xml version=”1.0″ encoding=”utf-8″?> <android.support.constraint.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”match_parent”> <TextView android:id=”@+id/one” android:layout_width=”0dp” android:layout_height=”48dp” android:background=”#caf” app:layout_constraintLeft_toLeftOf=”parent” app:layout_constraintRight_toLeftOf=”@+id/two” app:layout_constraintHorizontal_weight=”6″/> <TextView android:id=”@+id/two” android:layout_width=”0dp” android:layout_height=”48dp” android:background=”#fac” app:layout_constraintLeft_toRightOf=”@+id/one” app:layout_constraintRight_toRightOf=”parent” app:layout_constraintHorizontal_weight=”4″/> </android.support.constraint.ConstraintLayout> In Java Create your views and add them to the parent ConstraintLayout. You will need to give them … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)