Search in sources :

Example 26 with OnSeekBarChangeListener

use of android.widget.SeekBar.OnSeekBarChangeListener in project ticker by robinhood.

the class SlideActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_slide);
    final TickerView ticker = findViewById(R.id.ticker);
    final SeekBar seekBar = findViewById(R.id.seek);
    seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            ticker.setText("$" + (float) progress / 100);
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
}
Also used : SeekBar(android.widget.SeekBar) OnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener) TickerView(com.robinhood.ticker.TickerView)

Example 27 with OnSeekBarChangeListener

use of android.widget.SeekBar.OnSeekBarChangeListener in project zype-android by zype.

the class VideoCastControllerActivity method loadAndSetupViews.

private void loadAndSetupViews() {
    mPauseDrawable = getResources().getDrawable(R.drawable.ic_pause_circle_white_80dp);
    mPlayDrawable = getResources().getDrawable(R.drawable.ic_play_circle_white_80dp);
    mStopDrawable = getResources().getDrawable(R.drawable.ic_stop_circle_white_80dp);
    mPageView = findViewById(R.id.pageview);
    mPlayPause = (ImageButton) findViewById(R.id.play_pause_toggle);
    mLiveText = (TextView) findViewById(R.id.live_text);
    mStart = (TextView) findViewById(R.id.start_text);
    mEnd = (TextView) findViewById(R.id.end_text);
    mSeekbar = (SeekBar) findViewById(R.id.seekbar);
    mLine2 = (TextView) findViewById(R.id.textview2);
    mLoading = (ProgressBar) findViewById(R.id.progressbar1);
    mControllers = findViewById(R.id.controllers);
    mClosedCaptionIcon = (ImageButton) findViewById(R.id.cc);
    mSkipNext = (ImageButton) findViewById(R.id.next);
    mSkipPrevious = (ImageButton) findViewById(R.id.previous);
    mPlaybackControls = findViewById(R.id.playback_controls);
    mMini = (MiniController) findViewById(R.id.miniController1);
    mMini.setCurrentVisibility(false);
    setClosedCaptionState(CC_DISABLED);
    mPlayPause.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            try {
                mListener.onPlayPauseClicked(v);
            } catch (TransientNetworkDisconnectionException e) {
                LOGE(TAG, "Failed to toggle playback due to temporary network issue", e);
                Utils.showToast(VideoCastControllerActivity.this, R.string.ccl_failed_no_connection_trans);
            } catch (NoConnectionException e) {
                LOGE(TAG, "Failed to toggle playback due to network issues", e);
                Utils.showToast(VideoCastControllerActivity.this, R.string.ccl_failed_no_connection);
            } catch (Exception e) {
                LOGE(TAG, "Failed to toggle playback due to other issues", e);
                Utils.showToast(VideoCastControllerActivity.this, R.string.ccl_failed_perform_action);
            }
        }
    });
    mSeekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            try {
                if (mListener != null) {
                    mListener.onStopTrackingTouch(seekBar);
                }
            } catch (Exception e) {
                LOGE(TAG, "Failed to complete seek", e);
                finish();
            }
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            try {
                if (mListener != null) {
                    mListener.onStartTrackingTouch(seekBar);
                }
            } catch (Exception e) {
                LOGE(TAG, "Failed to start seek", e);
                finish();
            }
        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            mStart.setText(Utils.formatMillis(progress));
            try {
                if (mListener != null) {
                    mListener.onProgressChanged(seekBar, progress, fromUser);
                }
            } catch (Exception e) {
                LOGE(TAG, "Failed to set the progress result", e);
            }
        }
    });
    mClosedCaptionIcon.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            try {
                showTracksChooserDialog();
            } catch (TransientNetworkDisconnectionException | NoConnectionException e) {
                LOGE(TAG, "Failed to get the media", e);
            }
        }
    });
    mSkipNext.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            try {
                mListener.onSkipNextClicked(v);
            } catch (TransientNetworkDisconnectionException | NoConnectionException e) {
                LOGE(TAG, "Failed to move to the next item in the queue", e);
            }
        }
    });
    mSkipPrevious.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            try {
                mListener.onSkipPreviousClicked(v);
            } catch (TransientNetworkDisconnectionException | NoConnectionException e) {
                LOGE(TAG, "Failed to move to the previous item in the queue", e);
            }
        }
    });
}
Also used : SeekBar(android.widget.SeekBar) NoConnectionException(com.google.android.libraries.cast.companionlibrary.cast.exceptions.NoConnectionException) OnClickListener(android.view.View.OnClickListener) TransientNetworkDisconnectionException(com.google.android.libraries.cast.companionlibrary.cast.exceptions.TransientNetworkDisconnectionException) OnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) TransientNetworkDisconnectionException(com.google.android.libraries.cast.companionlibrary.cast.exceptions.TransientNetworkDisconnectionException) NoConnectionException(com.google.android.libraries.cast.companionlibrary.cast.exceptions.NoConnectionException)

Example 28 with OnSeekBarChangeListener

use of android.widget.SeekBar.OnSeekBarChangeListener in project LanSoEditor_advance by LanSoSdk.

the class CameraLayerRectActivity method initView.

private void initView() {
    tvTime = (TextView) findViewById(R.id.id_cameralayer_timetv);
    playVideo = (LinearLayout) findViewById(R.id.id_cameralayer_saveplay);
    playVideo.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (SDKFileUtils.fileExist(dstPath)) {
                Intent intent = new Intent(CameraLayerRectActivity.this, VideoPlayerActivity.class);
                intent.putExtra("videopath", dstPath);
                startActivity(intent);
            } else {
                Toast.makeText(CameraLayerRectActivity.this, "目标文件不存在", Toast.LENGTH_SHORT).show();
            }
        }
    });
    playVideo.setVisibility(View.GONE);
    findViewById(R.id.id_cameralayer_flashlight).setOnClickListener(this);
    findViewById(R.id.id_cameralayer_frontcamera).setOnClickListener(this);
    findViewById(R.id.id_camerape_demo_selectbtn).setOnClickListener(this);
    handler = new Handler(this);
    AdjusterFilter = (SeekBar) findViewById(R.id.id_cameralayer_demo_seek1);
    AdjusterFilter.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        // TODO Auto-generated method stub
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        // TODO Auto-generated method stub
        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            // TODO Auto-generated method stub
            if (mFilterAdjuster != null) {
                mFilterAdjuster.adjust(progress);
            }
        }
    });
}
Also used : SeekBar(android.widget.SeekBar) OnClickListener(android.view.View.OnClickListener) Handler(android.os.Handler) Intent(android.content.Intent) OnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener) View(android.view.View) DrawPadCameraView(com.lansosdk.videoeditor.DrawPadCameraView) TextView(android.widget.TextView) VideoFocusView(com.example.advanceDemo.view.VideoFocusView) Paint(android.graphics.Paint) Point(android.graphics.Point) VideoPlayerActivity(com.example.advanceDemo.VideoPlayerActivity)

Example 29 with OnSeekBarChangeListener

use of android.widget.SeekBar.OnSeekBarChangeListener in project LanSoEditor_advance by LanSoSdk.

the class MoreLayHeadSeekActivity method initView.

private void initView() {
    btnPlay = (LinearLayout) findViewById(R.id.id_videoLayer_saveplay);
    btnPlay.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(MoreLayHeadSeekActivity.this, VideoPlayerActivity.class);
            intent.putExtra("videopath", dstPath);
            startActivity(intent);
        }
    });
    btnPlay.setVisibility(View.GONE);
    skbTime = (SeekBar) findViewById(R.id.id_transform2_seekbar);
    skbTime.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            if (fromUser) {
                Log.i(TAG, "seekbar  progress " + progress);
                seekTo(progress);
            }
        }
    });
}
Also used : SeekBar(android.widget.SeekBar) OnClickListener(android.view.View.OnClickListener) Intent(android.content.Intent) OnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener) GLSurfaceView(android.opengl.GLSurfaceView) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) DrawPadView(com.lansosdk.videoeditor.DrawPadView) Paint(android.graphics.Paint) VideoPlayerActivity(com.example.advanceDemo.VideoPlayerActivity)

Example 30 with OnSeekBarChangeListener

use of android.widget.SeekBar.OnSeekBarChangeListener in project LanSoEditor_advance by LanSoSdk.

the class BitmapLayerFilterDemoActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.bitmaplayer_filter_layout);
    initView();
    drawPadView = (DrawPadView) findViewById(R.id.DrawPad_view);
    // 在手机的默认路径下创建一个文件名,用来保存生成的视频文件,(在onDestroy中删除)
    dstPath = SDKFileUtils.newMp4PathInBox();
    mContext = getApplicationContext();
    findViewById(R.id.id_bitmapfilter_demo_selectbtn).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            selectFilter();
        }
    });
    AdjusterFilter = (SeekBar) findViewById(R.id.id_bitmapfilter_demo_seek1);
    AdjusterFilter.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            if (mFilterAdjuster != null) {
                mFilterAdjuster.adjust(progress);
            }
        }
    });
    new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            initDrawPad();
        }
    }, 200);
}
Also used : SeekBar(android.widget.SeekBar) OnClickListener(android.view.View.OnClickListener) Handler(android.os.Handler) OnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener) View(android.view.View) DrawPadView(com.lansosdk.videoeditor.DrawPadView)

Aggregations

OnSeekBarChangeListener (android.widget.SeekBar.OnSeekBarChangeListener)34 SeekBar (android.widget.SeekBar)33 View (android.view.View)24 TextView (android.widget.TextView)18 OnClickListener (android.view.View.OnClickListener)13 Intent (android.content.Intent)9 CompoundButton (android.widget.CompoundButton)9 ImageView (android.widget.ImageView)8 AdapterView (android.widget.AdapterView)7 Button (android.widget.Button)6 OnCheckedChangeListener (android.widget.CompoundButton.OnCheckedChangeListener)6 SuppressLint (android.annotation.SuppressLint)5 Paint (android.graphics.Paint)5 LayoutInflater (android.view.LayoutInflater)5 DialogInterface (android.content.DialogInterface)4 CheckBox (android.widget.CheckBox)4 AlertDialog (android.app.AlertDialog)3 Dialog (android.app.Dialog)3 ProgressDialog (android.app.ProgressDialog)3 Point (android.graphics.Point)3