I have the following resource (message_item.xml) which is a ConstraintLayout where I set the layout_gravity to “left”
<androidx.constraintlayout.widget.ConstraintLayout ...
android:id="@+id/cl_id"
android:layout_gravity="left"
... >
In summary, I am trying to change the value to “right” during runtime from an adapter class.
I tried retreiving the layout parameters but that didn’t help.
var conLayout : ConstraintLayout = holder.itemView.findViewById<ConstraintLayout>(R.id.cl_id)
var layparms : LayoutParams = conLayout.layoutParams
Android Studio and the Android documentation for ConstraintLayout shows me no option for “layout_gravity”.
Am I missing something or is it just not implemented?
Thank you
Xon is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.