Changing the color of a List object in an Android App

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I found the soflution to this problem in the list object. Now I can change the background color. I was talking to Chat GPT and he helped me fix it. 8o

    in the KcList.zip file CRunkclist.java

    Original Code

    Code
                case 26: // Set background color
                    bColor = act.getParamColour(rh, 0);
                    if(view != null)
                        view.forceLayout();
                    break;



    Corrected Code

    Code
    case 26: // Set background color
                    bColor = act.getParamColour(rh, 0);
                    listBackColor(); // apply color TonyThunder and ChatGPT :3
                    //if(view != null)
                    //    view.forceLayout();
                    break;        


    Chat GPT told me:

    Confusion or misuse of forceLayout()
    view.forceLayout() marks the view for relayout, but doesn't update the background unless explicitly reapplied. This works if the layout code (or onLayout()) calls listBackColor(), but that doesn't seem to be happening in your case.

    And Chat GPT suggested:

    Apply the color by calling listBackColor() directly.

    I did it and it worked!!! 8o

  • Thanks, yes, force layout was used to force getview in the past Android versions.

    for now, these changes are safe

    Regards,


    Fernando Vivolo

    ... new things are coming ...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!