You should add an id to items to access them via java/kotlin.
check this background XML file
-
to change the solid color of this, on constraintLayout background, this drawable XML is applied
val background = constraintLayout.background as RippleDrawable
val bgShape = background.findDrawableByLayerId(R.id.fab_shape) as GradientDrawable
bgShape.color = color
for reference read this