Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Showing and Hiding the ProgressBar
package com.chelseatroy.canary
class LoginActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
...
signInButton.setOnClickListener { view ->
if (isNetworkConnected()) {
//HERE'S WHERE WE SHOW THE PROGRESS BAR
progressBar.visibility = View.VISIBLE
authenticate()
} else {
...
}
}
}
fun authenticate() {
...
session = MockyAPIImplementation().authenticate()
//HERE'S WHERE WE HIDE THE PROGRESS BAR
progressBar.visibility = View.GONE
...
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.