use of android.widget.SeekBar in project android_frameworks_base by AOSPA.
the class BassBoostTest method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
SeekBar seekBar;
TextView textView;
setContentView(R.layout.bassboosttest);
mSessionText = (EditText) findViewById(R.id.sessionEdit);
mSessionText.setOnKeyListener(mSessionKeyListener);
mSessionText.setText(Integer.toString(sSession));
mReleaseButton = (ToggleButton) findViewById(R.id.bbReleaseButton);
mOnOffButton = (ToggleButton) findViewById(R.id.bassboostOnOff);
getEffect(sSession);
if (mBassBoost != null) {
mReleaseButton.setOnCheckedChangeListener(this);
mOnOffButton.setOnCheckedChangeListener(this);
textView = (TextView) findViewById(R.id.bbStrengthMin);
textView.setText("0");
textView = (TextView) findViewById(R.id.bbStrengthMax);
textView.setText("1000");
seekBar = (SeekBar) findViewById(R.id.bbStrengthSeekBar);
textView = (TextView) findViewById(R.id.bbStrengthValue);
mStrength = new BassBoostParam(mBassBoost, 0, 1000, seekBar, textView);
seekBar.setOnSeekBarChangeListener(mStrength);
mStrength.setEnabled(mBassBoost.getStrengthSupported());
}
}
use of android.widget.SeekBar in project Ushahidi_Android by ushahidi.
the class SeekBarPreference method onCreateDialogView.
@Override
protected View onCreateDialogView() {
LinearLayout.LayoutParams params;
LinearLayout layout = new LinearLayout(mContext);
layout.setOrientation(LinearLayout.VERTICAL);
layout.setPadding(6, 6, 6, 6);
mSplashText = new TextView(mContext);
if (mDialogMessage != null)
mSplashText.setText(mDialogMessage);
layout.addView(mSplashText);
mValueText = new TextView(mContext);
mValueText.setGravity(Gravity.CENTER_HORIZONTAL);
mValueText.setTextSize(32);
params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
layout.addView(mValueText, params);
mSeekBar = new SeekBar(mContext);
mSeekBar.setOnSeekBarChangeListener(this);
layout.addView(mSeekBar, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
if (shouldPersist())
mValue = getPersistedInt(mDefault);
mSeekBar.setMax(mMax);
if (mValue < mMin)
mSeekBar.setProgress(mMin);
else
mSeekBar.setProgress(mValue);
return layout;
}
use of android.widget.SeekBar in project AndroidFillableLoaders by JorgeCastilloPrz.
the class FillableLoaderPage method setupFillableLoader.
private void setupFillableLoader(int pageNum) {
if (pageNum == 3) {
int viewSize = getResources().getDimensionPixelSize(R.dimen.fourthSampleViewSize);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(viewSize, viewSize);
params.gravity = Gravity.CENTER;
FillableLoaderBuilder loaderBuilder = new FillableLoaderBuilder();
fillableLoader = loaderBuilder.parentView((FrameLayout) rootView).svgPath(Paths.JOB_AND_TALENT).layoutParams(params).originalDimensions(970, 970).strokeColor(Color.parseColor("#1c9ade")).fillColor(Color.parseColor("#1c9ade")).strokeDrawingDuration(2000).clippingTransform(new WavesClippingTransform()).fillDuration(10000).build();
} else if (pageNum == 6) {
int viewSize = getResources().getDimensionPixelSize(R.dimen.fourthSampleViewSize);
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(viewSize, viewSize);
params.gravity = Gravity.CENTER;
SeekBar mSeekbar = (SeekBar) rootView.findViewById(R.id.PercentageSeekBar);
mSeekbar.setProgress(mPercentage);
mSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
mPercentage = progress;
fillableLoader.setPercentage(progress);
}
public void onStartTrackingTouch(SeekBar seekBar) {
}
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
FillableLoaderBuilder loaderBuilder = new FillableLoaderBuilder();
fillableLoader = loaderBuilder.parentView((FrameLayout) rootView).svgPath(Paths.JOB_AND_TALENT).layoutParams(params).percentage(mPercentage).originalDimensions(970, 970).strokeColor(Color.parseColor("#1c9ade")).fillColor(Color.parseColor("#1c9ade")).strokeDrawingDuration(2000).clippingTransform(new WavesClippingTransform()).fillDuration(10000).build();
} else {
fillableLoader.setSvgPath(pageNum == 0 ? Paths.INDOMINUS_REX : pageNum == 1 ? Paths.RONALDO : pageNum == 2 ? Paths.SEGA : pageNum == 4 ? Paths.COCA_COLA : Paths.GITHUB);
}
fillableLoader.setOnStateChangeListener(this);
}
use of android.widget.SeekBar in project android-app by spark.
the class Pin method reset.
public void reset() {
if (analogReadView != null) {
analogReadView.setVisibility(View.GONE);
// Reset the values
ProgressBar barGraph = Ui.findView(analogReadView, R.id.tinker_analog_read_progress);
TextView readValue = Ui.findView(analogReadView, R.id.tinker_analog_read_value);
barGraph.setMax(100);
barGraph.setProgress(0);
readValue.setText("0");
analogReadView = null;
}
if (analogWriteView != null) {
// Reset the values
analogWriteView.setVisibility(View.GONE);
final SeekBar seekBar = Ui.findView(analogWriteView, R.id.tinker_analog_write_seekbar);
final TextView value = Ui.findView(analogWriteView, R.id.tinker_analog_write_value);
seekBar.setProgress(0);
value.setText("0");
analogWriteView = null;
}
if (digitalWriteView != null) {
digitalWriteView.setVisibility(View.GONE);
digitalWriteView = null;
}
if (digitalReadView != null) {
digitalReadView.setVisibility(View.GONE);
digitalReadView = null;
}
if (!stopAnimating()) {
((View) view.getParent()).setBackgroundColor(0);
}
muted = false;
analogValue = 0;
digitalValue = DigitalValue.NONE;
}
use of android.widget.SeekBar in project android-app by spark.
the class Pin method showAnalogWrite.
public void showAnalogWrite(final OnAnalogWriteListener listener) {
if (analogReadView != null) {
analogReadView.setVisibility(View.GONE);
analogReadView = null;
}
final ViewGroup parent = (ViewGroup) view.getParent();
if (analogWriteView == null) {
analogWriteView = Ui.findView(parent, R.id.tinker_analog_write_main);
}
// If the view does not exist, inflate it
if (analogWriteView == null) {
LayoutInflater inflater = (LayoutInflater) view.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (pinType == PinType.A) {
analogWriteView = inflater.inflate(R.layout.tinker_analog_write_left, parent, false);
parent.addView(analogWriteView);
} else if (pinType == PinType.D) {
analogWriteView = inflater.inflate(R.layout.tinker_analog_write_right, parent, false);
parent.addView(analogWriteView, 0);
}
}
analogWriteView.setVisibility(View.VISIBLE);
final SeekBar seekBar = Ui.findView(analogWriteView, R.id.tinker_analog_write_seekbar);
final TextView valueText = Ui.findView(analogWriteView, R.id.tinker_analog_write_value);
if (pinBackgroundAnim != null) {
pinBackgroundAnim.cancel();
pinBackgroundAnim = null;
}
parent.setBackgroundColor(0x4C000000);
seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
int value = seekBar.getProgress();
parent.setBackgroundColor(0);
showAnalogWriteValue();
listener.onAnalogWrite(value);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
valueText.setText(String.valueOf(progress));
}
});
}
Aggregations