Search in sources :

Example 26 with SeekBar

use of android.widget.SeekBar in project android-gpuimage by CyberAgent.

the class ActivityCamera method onCreate.

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_camera);
    ((SeekBar) findViewById(R.id.seekBar)).setOnSeekBarChangeListener(this);
    findViewById(R.id.button_choose_filter).setOnClickListener(this);
    findViewById(R.id.button_capture).setOnClickListener(this);
    mGPUImage = new GPUImage(this);
    mGPUImage.setGLSurfaceView((GLSurfaceView) findViewById(R.id.surfaceView));
    mCameraHelper = new CameraHelper(this);
    mCamera = new CameraLoader();
    View cameraSwitchView = findViewById(R.id.img_switch_camera);
    cameraSwitchView.setOnClickListener(this);
    if (!mCameraHelper.hasFrontCamera() || !mCameraHelper.hasBackCamera()) {
        cameraSwitchView.setVisibility(View.GONE);
    }
}
Also used : SeekBar(android.widget.SeekBar) GPUImage(jp.co.cyberagent.android.gpuimage.GPUImage) GLSurfaceView(android.opengl.GLSurfaceView) View(android.view.View) CameraHelper(jp.co.cyberagent.android.gpuimage.sample.utils.CameraHelper)

Example 27 with SeekBar

use of android.widget.SeekBar in project Gadgetbridge by Freeyourgadget.

the class VibrationActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_vibration);
    IntentFilter filter = new IntentFilter();
    filter.addAction(GBApplication.ACTION_QUIT);
    LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, filter);
    registerReceiver(mReceiver, filter);
    seekBar = (SeekBar) findViewById(R.id.vibration_seekbar);
    seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            if (progress > 0) {
                // 1-16
                // max 255
                progress = progress * 16 - 1;
            }
            GBApplication.deviceService().onSetConstantVibration(progress);
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
}
Also used : IntentFilter(android.content.IntentFilter) SeekBar(android.widget.SeekBar)

Example 28 with SeekBar

use of android.widget.SeekBar in project bilibili-android-client by HotBitmapGG.

the class MediaController method initControllerView.

private void initControllerView(View v) {
    mPauseButton = (ImageButton) v.findViewById(R.id.media_controller_play_pause);
    mTvPlay = (ImageView) v.findViewById(R.id.media_controller_tv_play);
    if (mPauseButton != null && mTvPlay != null) {
        mPauseButton.requestFocus();
        mPauseButton.setOnClickListener(mPauseListener);
        mTvPlay.requestFocus();
        mTvPlay.setOnClickListener(v13 -> {
            doPauseResume();
            show(sDefaultTimeout);
        });
    }
    mProgress = (SeekBar) v.findViewById(R.id.media_controller_seekbar);
    if (mProgress != null) {
        if (mProgress instanceof SeekBar) {
            SeekBar seeker = (SeekBar) mProgress;
            seeker.setOnSeekBarChangeListener(mSeekListener);
            seeker.setThumbOffset(1);
        }
        mProgress.setMax(1000);
    }
    mEndTime = (TextView) v.findViewById(R.id.media_controller_time_total);
    mCurrentTime = (TextView) v.findViewById(R.id.media_controller_time_current);
    mTitleView = (TextView) v.findViewById(R.id.media_controller_title);
    if (mTitleView != null) {
        mTitleView.setText(mTitle);
    }
    LinearLayout mDanmakuLayout = (LinearLayout) v.findViewById(R.id.media_controller_danmaku_layout);
    ImageView mDanmakuImage = (ImageView) v.findViewById(R.id.media_controller_danmaku_switch);
    TextView mDanmakuText = (TextView) v.findViewById(R.id.media_controller_danmaku_text);
    mDanmakuLayout.setOnClickListener(v1 -> {
        if (mDanmakuShow) {
            mDanmakuImage.setImageResource(R.drawable.bili_player_danmaku_is_open);
            mDanmakuText.setText("弹幕开");
            mDanmukuSwitchListener.setDanmakushow(true);
            mDanmakuShow = false;
        } else {
            mDanmakuImage.setImageResource(R.drawable.bili_player_danmaku_is_closed);
            mDanmakuText.setText("弹幕关");
            mDanmukuSwitchListener.setDanmakushow(false);
            mDanmakuShow = true;
        }
    });
    mBack = (ImageView) v.findViewById(R.id.media_controller_back);
    mBack.setOnClickListener(v12 -> mVideoBackListener.back());
}
Also used : SeekBar(android.widget.SeekBar) TextView(android.widget.TextView) ImageView(android.widget.ImageView) LinearLayout(android.widget.LinearLayout)

Example 29 with SeekBar

use of android.widget.SeekBar in project AntennaPod by AntennaPod.

the class AutoFlattrPreferenceDialog method newAutoFlattrPreferenceDialog.

public static void newAutoFlattrPreferenceDialog(final Activity activity, final AutoFlattrPreferenceDialogInterface callback) {
    Validate.notNull(activity);
    Validate.notNull(callback);
    AlertDialog.Builder builder = new AlertDialog.Builder(activity);
    @SuppressLint("InflateParams") View view = activity.getLayoutInflater().inflate(R.layout.autoflattr_preference_dialog, null);
    final CheckBox chkAutoFlattr = (CheckBox) view.findViewById(R.id.chkAutoFlattr);
    final SeekBar skbPercent = (SeekBar) view.findViewById(R.id.skbPercent);
    final TextView txtvStatus = (TextView) view.findViewById(R.id.txtvStatus);
    chkAutoFlattr.setChecked(UserPreferences.isAutoFlattr());
    skbPercent.setEnabled(chkAutoFlattr.isChecked());
    txtvStatus.setEnabled(chkAutoFlattr.isChecked());
    final int initialValue = (int) (UserPreferences.getAutoFlattrPlayedDurationThreshold() * 100.0f);
    setStatusMsgText(activity, txtvStatus, initialValue);
    skbPercent.setProgress(initialValue);
    chkAutoFlattr.setOnClickListener(v -> {
        skbPercent.setEnabled(chkAutoFlattr.isChecked());
        txtvStatus.setEnabled(chkAutoFlattr.isChecked());
    });
    skbPercent.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            setStatusMsgText(activity, txtvStatus, progress);
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    builder.setTitle(R.string.pref_auto_flattr_title).setView(view).setPositiveButton(R.string.confirm_label, (dialog, which) -> {
        float progDouble = ((float) skbPercent.getProgress()) / 100.0f;
        callback.onConfirmed(chkAutoFlattr.isChecked(), progDouble);
        dialog.dismiss();
    }).setNegativeButton(R.string.cancel_label, (dialog, which) -> {
        callback.onCancelled();
        dialog.dismiss();
    }).setCancelable(false).show();
}
Also used : AlertDialog(android.support.v7.app.AlertDialog) UserPreferences(de.danoeh.antennapod.core.preferences.UserPreferences) Context(android.content.Context) SeekBar(android.widget.SeekBar) SuppressLint(android.annotation.SuppressLint) AlertDialog(android.support.v7.app.AlertDialog) TextView(android.widget.TextView) Validate(org.apache.commons.lang3.Validate) CheckBox(android.widget.CheckBox) R(de.danoeh.antennapod.R) View(android.view.View) Activity(android.app.Activity) SeekBar(android.widget.SeekBar) TextView(android.widget.TextView) View(android.view.View) SuppressLint(android.annotation.SuppressLint) CheckBox(android.widget.CheckBox) SuppressLint(android.annotation.SuppressLint) TextView(android.widget.TextView)

Example 30 with SeekBar

use of android.widget.SeekBar in project android_frameworks_base by DirtyUnicorns.

the class EnvReverbTest method onCreate.

@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    Log.d(TAG, "onCreate");
    SeekBar seekBar;
    TextView textView;
    ToggleButton button;
    setContentView(R.layout.envreverbtest);
    ImageView playPause = (ImageView) findViewById(R.id.playPause1);
    ImageView stop = (ImageView) findViewById(R.id.stop1);
    textView = (TextView) findViewById(R.id.sessionText);
    if (sPlayerController == null) {
        sPlayerController = new SimplePlayer(this, R.id.playPause1, playPause, R.id.stop1, stop, textView, R.raw.mp3_sample, AudioManager.STREAM_MUSIC, 0);
    } else {
        sPlayerController.set(this, R.id.playPause1, playPause, R.id.stop1, stop, textView, AudioManager.STREAM_MUSIC, 0);
    }
    // send level
    mSendLevelSeekBar = (SeekBar) findViewById(R.id.sendLevelSeekBar);
    mSendLevelDisplay = (TextView) findViewById(R.id.sendLevelValue);
    mSendLevelSeekBar.setMax(100);
    mSendLevelSeekBar.setOnSeekBarChangeListener(this);
    mSendLevelSeekBar.setProgress(expToLin(sSendLevel, 100));
    sPlayerController.setAuxEffectSendLevel(sSendLevel);
    mOnOffButton = (ToggleButton) findViewById(R.id.rvbOnOff);
    mReleaseButton = (ToggleButton) findViewById(R.id.rvbReleaseButton);
    mAttachButton = (ToggleButton) findViewById(R.id.attachButton);
    getEffect(0);
    if (mReverb != null) {
        mOnOffButton.setOnCheckedChangeListener(this);
        mReleaseButton.setOnCheckedChangeListener(this);
        mAttachButton.setOnCheckedChangeListener(this);
        //            button = (ToggleButton)findViewById(R.id.rvbBypass);
        //            button.setChecked(false);
        //            button.setOnCheckedChangeListener(this);
        // Room level
        seekBar = (SeekBar) findViewById(R.id.rvbParam1SeekBar);
        textView = (TextView) findViewById(R.id.rvbParam1Value);
        mParameters[0] = new RoomLevelParam(mReverb, seekBar, textView);
        seekBar.setOnSeekBarChangeListener(mParameters[0]);
        // Room HF level
        seekBar = (SeekBar) findViewById(R.id.rvbParam2SeekBar);
        textView = (TextView) findViewById(R.id.rvbParam2Value);
        mParameters[1] = new RoomHFLevelParam(mReverb, seekBar, textView);
        seekBar.setOnSeekBarChangeListener(mParameters[1]);
        // Decay time
        seekBar = (SeekBar) findViewById(R.id.rvbParam3SeekBar);
        textView = (TextView) findViewById(R.id.rvbParam3Value);
        mParameters[2] = new DecayTimeParam(mReverb, seekBar, textView);
        seekBar.setOnSeekBarChangeListener(mParameters[2]);
        // Decay HF ratio
        seekBar = (SeekBar) findViewById(R.id.rvbParam4SeekBar);
        textView = (TextView) findViewById(R.id.rvbParam4Value);
        mParameters[3] = new DecayHFRatioParam(mReverb, seekBar, textView);
        seekBar.setOnSeekBarChangeListener(mParameters[3]);
        // Reflections level
        seekBar = (SeekBar) findViewById(R.id.rvbParam5SeekBar);
        textView = (TextView) findViewById(R.id.rvbParam5Value);
        mParameters[4] = new ReflectionsLevelParam(mReverb, seekBar, textView);
        seekBar.setOnSeekBarChangeListener(mParameters[4]);
        // Reflections delay
        seekBar = (SeekBar) findViewById(R.id.rvbParam6SeekBar);
        textView = (TextView) findViewById(R.id.rvbParam6Value);
        mParameters[5] = new ReflectionsDelayParam(mReverb, seekBar, textView);
        seekBar.setOnSeekBarChangeListener(mParameters[5]);
        // Reverb level
        seekBar = (SeekBar) findViewById(R.id.rvbParam7SeekBar);
        textView = (TextView) findViewById(R.id.rvbParam7Value);
        mParameters[6] = new ReverbLevelParam(mReverb, seekBar, textView);
        seekBar.setOnSeekBarChangeListener(mParameters[6]);
        // Reverb delay
        seekBar = (SeekBar) findViewById(R.id.rvbParam8SeekBar);
        textView = (TextView) findViewById(R.id.rvbParam8Value);
        mParameters[7] = new ReverbDelayParam(mReverb, seekBar, textView);
        seekBar.setOnSeekBarChangeListener(mParameters[7]);
        // Diffusion
        seekBar = (SeekBar) findViewById(R.id.rvbParam9SeekBar);
        textView = (TextView) findViewById(R.id.rvbParam9Value);
        mParameters[8] = new DiffusionParam(mReverb, seekBar, textView);
        seekBar.setOnSeekBarChangeListener(mParameters[8]);
        // Density
        seekBar = (SeekBar) findViewById(R.id.rvbParam10SeekBar);
        textView = (TextView) findViewById(R.id.rvbParam10Value);
        mParameters[9] = new DensityParam(mReverb, seekBar, textView);
        seekBar.setOnSeekBarChangeListener(mParameters[9]);
    }
}
Also used : ToggleButton(android.widget.ToggleButton) SeekBar(android.widget.SeekBar) TextView(android.widget.TextView) ImageView(android.widget.ImageView)

Aggregations

SeekBar (android.widget.SeekBar)338 TextView (android.widget.TextView)159 View (android.view.View)135 Intent (android.content.Intent)45 ImageView (android.widget.ImageView)43 LinearLayout (android.widget.LinearLayout)37 CompoundButton (android.widget.CompoundButton)35 OnSeekBarChangeListener (android.widget.SeekBar.OnSeekBarChangeListener)34 DialogInterface (android.content.DialogInterface)29 SuppressLint (android.annotation.SuppressLint)28 AdapterView (android.widget.AdapterView)28 Paint (android.graphics.Paint)22 OnClickListener (android.view.View.OnClickListener)21 Button (android.widget.Button)20 LayoutInflater (android.view.LayoutInflater)19 FrameLayout (android.widget.FrameLayout)19 SharedPreferences (android.content.SharedPreferences)18 AlertDialog (android.support.v7.app.AlertDialog)18 AlertDialog (android.app.AlertDialog)15 Bundle (android.os.Bundle)15