I want to make the gradient area swipe-able (down to show, swipe up to hide).
this is my code :
val scopeLayout = inflaterView.findViewById<ConstraintLayout>(R.id.scope_layout)
scopeLayout.setOnTouchListener({ v, event ->
when (event.action) {
MotionEvent.ACTION_DOWN ->
Toast.makeText(context, "you just touch the screen :-)", Toast.LENGTH_SHORT).show()
scopeLayout.height = 215 // error val cannot be reassigned
}
true
})
and I got the error val cannot be reassigned
. and how to set the height with dp
value?