Android Question Change Indeterminated progressbar Tint color

Discussion in 'Android Questions' started by inakigarm, Jan 28, 2015.

  1. inakigarm

    inakigarm Well-Known Member Licensed User

    Hi:

    I'd search the forum and found several examples on progress bar estandard, but couldn't find a way to change indeterminate progressbar tint color (not background)

    I found the way to do it but I don't know how to do code it using reflection or javaobject; if someone can help to code using reflection I hope I 'll learn the way to do it in a future

    Source: http://stackoverflow.com/questions/2729180/how-to-change-the-color-of-an-indefinite-progressbar?lq=1
    Code:
    progressBar.getIndeterminateDrawable().setColorFilter(
                getResources().getColor(R.color.light_light_purple),
                android.graphics.PorterDuff.Mode.SRC_IN);

    Thanks
     
    Last edited: Jan 28, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can use this code:
    Code:
    Dim jo As JavaObject = ProgressBar1
    jo = jo.RunMethod(
    "getIndeterminateDrawable"Null)
    jo.RunMethod(
    "setColorFilter"Array (Colors.Red, "SRC_IN"))
     
  3. inakigarm

    inakigarm Well-Known Member Licensed User

    Perfect !!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice