更改搜索栏时设置图像

问题描述

我有一个搜索栏。在onProgressChanged方法中,我设置了textview和imageview。 TextView效果很好,但是只有在用户标记保持在特定的秒数时才设置imageview。当用户移动搜索栏时,imageview不会发生任何变化。 这是代码

            @Override
            public void onProgressChanged(SeekBar seekBar,int progress,boolean fromUser) {
                if (fromUser){
         
                        long interval = progress*1000;
                        RequestOptions options = new RequestOptions().frame(interval);
                        Glide.with(MainActivity.this).asBitmap().load(R.raw.nilo)
.apply(options).into(imageView);
                    }
                    String a = String.valueOf(formatDuration((long) progress));
                    textView.setText(a);
                }
            }
            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
      

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
                videoView.seekTo(seekBar.getProgress());
          
                
            }
        });

        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        txtVideoCurrentDuration
.setText(formatDuration((long) videoView.getCurrentPosition()));
                        if (b){
                            seekBar.setProgress(videoView.getCurrentPosition());

                        }
                    }
                });
            }
        },1000); ```

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)