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());
}
use of android.widget.SeekBar in project AndroidChromium by JackyAndroid.
the class SeekBarPreference method onBindView.
@Override
protected void onBindView(View view) {
super.onBindView(view);
SeekBar seekBar = (SeekBar) view.findViewById(R.id.seekbar);
seekBar.setOnSeekBarChangeListener(this);
seekBar.setMax(prefValueToSeekBarProgress(mMax));
seekBar.setProgress(prefValueToSeekBarProgress(mValue));
seekBar.setEnabled(isEnabled());
mSummaryView = (TextView) view.findViewById(R.id.seekbar_amount);
mSummaryView.setText(mSummary);
}
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();
}
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]);
}
}
use of android.widget.SeekBar in project android_frameworks_base by DirtyUnicorns.
the class VirtualizerTest method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
SeekBar seekBar;
TextView textView;
setContentView(R.layout.virtualizertest);
mSessionText = (EditText) findViewById(R.id.sessionEdit);
mSessionText.setOnKeyListener(mSessionKeyListener);
mSessionText.setText(Integer.toString(sSession));
mReleaseButton = (ToggleButton) findViewById(R.id.virtReleaseButton);
mOnOffButton = (ToggleButton) findViewById(R.id.virtualizerOnOff);
getEffect(sSession);
if (mVirtualizer != null) {
mReleaseButton.setOnCheckedChangeListener(this);
mOnOffButton.setOnCheckedChangeListener(this);
textView = (TextView) findViewById(R.id.virtStrengthMin);
textView.setText("0");
textView = (TextView) findViewById(R.id.virtStrengthMax);
textView.setText("1000");
seekBar = (SeekBar) findViewById(R.id.virtStrengthSeekBar);
textView = (TextView) findViewById(R.id.virtStrengthValue);
mStrength = new VirtualizerParam(mVirtualizer, 0, 1000, seekBar, textView);
seekBar.setOnSeekBarChangeListener(mStrength);
mStrength.setEnabled(mVirtualizer.getStrengthSupported());
}
}
Aggregations