Skip to content

Instantly share code, notes, and snippets.

@nickbutcher
Last active July 24, 2019 20:58
Show Gist options
  • Save nickbutcher/17eb291b9fc868a603e844a291c0de16 to your computer and use it in GitHub Desktop.
Save nickbutcher/17eb291b9fc868a603e844a291c0de16 to your computer and use it in GitHub Desktop.
/* Copyright 2019 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
data class LoginUiModel(
val submitEnabled: Boolean,
val loginInProgress: Boolean
)
setVisibility(login, !uiModel.loginInProgress)
setVisibility(progress, uiModel.loginInProgress)
fun setVisibility(view: View, visible: Boolean) {
view.visibility = if (visible) View.VISIBLE else View.GONE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment