Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
I spend the entire to figure out why my custom viewgroups broken as soon as i upgraded to beta1 from alpha2 version of the constraintlayout.
I created a very simple project and found constraints from kotlin class are not respected anymore in beta1.
class CustomView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr) {
init {
initialize()
}
private fun initialize() {
if (id == NO_ID) {
id = View.generateViewId()
}
val tv = TextView(context)
val layoutParams = LayoutParams(LayoutParams.MATCH_CONSTRAINT, LayoutParams.MATCH_CONSTRAINT)
tv.text = "Something"
layoutParams.startToStart = id
layoutParams.endToEnd = id
layoutParams.topToTop = id
layoutParams.bottomToBottom = id
tv.layoutParams = layoutParams
addView(tv)
I tried this way too same result
/* val set = ConstraintSet()
set.clone(this)
set.connect(
set.connect(
set.connect(
set.connect(
set.applyTo(this)*/
}
}
add this view to any xml and the results will be different in beta1 vs alpha2 release. It works perfectly fine in alpha2 but nothing shown on screen on beta1