SoFunction
Updated on 2025-03-11

Android picture converter example

 @Override
 protected void onCreate(Bundle savedInstanceState) {

  (savedInstanceState);
  setContentView();

  up=(Button) findViewById(.bt1);
  down=(Button) findViewById(.bt2);

 
  imageSwitcher=(ImageSwitcher) findViewById(.imagSw1);
  ((this, .fade_in));
  ((this, .fade_out));
  (new ViewFactory() {

  
   public View makeView() {
    ImageView imageView = new ImageView();
    (.FIT_CENTER);
    (new (
      LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT
      ));
    return imageView;
   }
  });

  (imagId[index]);

  (new OnClickListener() {

   @Override
   public void onClick(View v) {
    if(index>0){
     index--;
    }else{
     index=-1;
    }
    (imagId[index]);
   }
  });

  (new OnClickListener() {

   @Override
   public void onClick(View v) {
    if(index<-1){
     index++;
    }else{
     index=0;
    }
    (imagId[index]);
   }
  });
 }
}