Skip to content

Instantly share code, notes, and snippets.

@nickbutcher
Last active December 10, 2018 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickbutcher/3be93e83b86751f90bdc4115aba3d1ca to your computer and use it in GitHub Desktop.
Save nickbutcher/3be93e83b86751f90bdc4115aba3d1ca to your computer and use it in GitHub Desktop.
/* Copyright 2018 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
@BindingAdapter("indeterminateDrawableCompat")
fun bindIndeterminateProgress(progressBar: ProgressBar, @DrawableRes id: Int) {
val drawable = AppCompatResources.getDrawable(progressBar.context, id)
progressBar.indeterminateDrawable = drawable
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment