2

I have a piece of code that changes the size of an ImageView and changes it's Resource.

When I run, I see two overlaying iterations of the ImageView. Where one will alter in size, and the other in source.

Funny thing, the one that changes size works as a mask, so that the one changing resource is only visible by the boundaries of the one changing size.

code:

if(timePassed>50){
        worldView.setImageResource(R.drawable.world_trans);
    }else if(timePassed>30){
        worldView.setImageResource(R.drawable.world_life);
    }else{
        worldView.setImageResource(R.drawable.world_bare);}


    BigDecimal LiS = BigDecimal.valueOf((double)(NOL-MIN_NOL));
    BigDecimal SRBI = BigDecimal.valueOf((double)sizeRange);
    BigDecimal SiPS = LiS.multiply(SRBI);
    BigDecimal LRBI = BigDecimal.valueOf(NOL_RANGE);
    BigDecimal RR = SiPS.divide(LRBI, RoundingMode.CEILING);
    int sizeIntoScale = RR.intValue();
    worldSize=sizeIntoScale+sizeMin;

    RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(worldSize,worldSize);

    layoutParams.addRule(RelativeLayout.CENTER_IN_PARENT,RelativeLayout.TRUE);

    worldView.setLayoutParams(layoutParams);
Goma
  • 79
  • 6

0 Answers0