Norway


I’m making a basketball scores , each scoreboard is a row in a custom recyclerview I created. The looks like this:

public int setLogo(String abrv)
    {
        int logo = 0;
        switch(abrv)
        {
            case("ATL"): logo = R.drawable.hawks;
                break;
            case("BKN"):logo =(R.drawable.nets);
                break;
            case("BOS"):logo =(R.drawable.celtics);
                break;
            case("CHA"):logo =(R.drawable.hornets);
                break;
            case("CHI"):logo =(R.drawable.bulls);
                break;
            case("CLE"):logo =(R.drawable.cavs);
                break;
            case("DAL"):logo =(R.drawable.mavericks);
                break;
            case("DEN"):logo =(R.drawable.nuggets);
                break;
            case("DET"):logo =(R.drawable.pistons);
                break;
            case("GSW"):logo =(R.drawable.warriors);
                break;
            case("HOU"):logo =(R.drawable.rockets);
                break;
            case("IND"):logo =(R.drawable.pacers);
                break;
            case("LAC"):logo =(R.drawable.clippers);
                break;
            case("LAL"):logo =(R.drawable.lakers);
                break;
            case("MEM"):logo =(R.drawable.grizzlies);
                break;
            case("MIA"):logo =(R.drawable.heat);
                break;
            case("MIL"):logo =(R.drawable.bucks);
                break;
            case("MIN"):logo =(R.drawable.twolves);
                break;
            case("NOP"):logo =(R.drawable.pels);
                break;
            case("NYK"):logo =(R.drawable.knicks);
                break;
            case("OKC"):logo =(R.drawable.thunder);
                break;
            case("ORL"):logo =(R.drawable.magic);
                break;
            case("PHI"):logo =(R.drawable.sixers);
                break;
            case("PHX"):logo =(R.drawable.suns);
                break;
            case("POR"):logo =(R.drawable.blazers);
                break;
            case("SAC"):logo =(R.drawable.kings);
                break;
            case("SAS"):logo =(R.drawable.spurs);
                break;
            case("TOR"):logo =(R.drawable.raptors);
                break;
            case("UTA"):logo =(R.drawable.jazz);
                break;
            case("WAS"):logo =(R.drawable.wizards);
                break;
        }

        return logo;
    }

This switch is seriously lagging the scroll on my RecyclerView, but I don’t know how else I can the



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here