Hi guys.
I have a question here.
I have a BaseActivity which has the
showProgressBar(visibility: Boolean)
function, this will toggle the ProgressBar visibility based on the value.
Then, I have a RecipeListActivity which extends BaseActivity that will send the boolean data type in the
showProgressBar
when the button is clicked.
BaseActivity .kt
fun showProgressBar(visibility: Boolean) {
progressBar.visibility = if (visibility) View.INVISIBLE else View.VISIBLE
}
RecipeListActivity.kt
activity_content.test.setOnClickListener(View.OnClickListener { view ->
val visibility = view.visibility != View.VISIBLE
showProgressBar(visibility)
})
But right now the value of the visibility in the
showProgressBar
is showing
8
or
0
instead of true or false.
Did I miss out anything?