Ayden
10/27/2019, 9:18 AMshowProgressBar(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?suhas
10/27/2019, 9:22 AMAyden
10/27/2019, 9:48 AMsuhas
10/27/2019, 9:48 AMAyden
10/27/2019, 9:49 AMMeghan
10/27/2019, 1:41 PM