Simple ImageView color animation

前端 未结 2 1726
一向
一向 2021-01-22 01:21

Hi I am relatively new to Android, and I would like, if possible, some guidelines or suggestions on where to search in order to solve my issue. Apparently, I do not possess the

2条回答
  •  囚心锁ツ
    2021-01-22 02:00

    You can do this by using a custom ProgressBar. Even more simpler

    
            
    

    progress_bar_clip.xml

    
    
    
        
            
        
        
            
                
                
            
        
    
    
    

    You don't have do load any animations. Just use a handler and increment the progress bar by 1.

    final ProgressBar bar = (ProgressBar) findViewById(R.id.progressbar);
    
            final Handler handler = new Handler();
            runnable = new Runnable() {
    
                @Override
                public void run() {
                    if(bar.getProgress() != 100) {
                        bar.incrementProgressBy(1);
                        handler.postDelayed(runnable, 500);
                    }
                }
            };;
    
            handler.post(runnable);
    

提交回复
热议问题