SeekBar progress making the crosswalk webview chop

2019-07-10 04:35发布

My main activity contains a webview and a seekbar. The seekbar is an interface to interact with the server , and the crosswalk webview is to visualize a jmpeg streaming

My problem is: while the user is changing the position of the seekbar's thumb the webview content looks choppy.

seekbar's listener implementation:

seek.setOnSeekBarChangeListener(
   new SeekBar.OnSeekBarChangeListener() {
      @Override
      public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {


                       int x=2*progress;
                        int y=seekv.getProgress();

                        if (x>45 && x<55 && fromUser )
                                {seek.setProgress(25);
                                    if(!done)
                                    {done=true ;
                                    socket.emit("move1",x,y);

                                    }

                                }
                        else if (fromUser){
                          socket.emit("move1", x, y);
                           done=false ; 
                        }

                    }

0条回答
登录 后发表回答