use of android.widget.SeekBar in project android_frameworks_base by crdroidandroid.
the class EqualizerTest method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
SeekBar seekBar;
TextView textView;
setContentView(R.layout.equalizertest);
mSessionText = (EditText) findViewById(R.id.sessionEdit);
mSessionText.setOnKeyListener(mSessionKeyListener);
mSessionText.setText(Integer.toString(sSession));
mReleaseButton = (ToggleButton) findViewById(R.id.eqReleaseButton);
mOnOffButton = (ToggleButton) findViewById(R.id.equalizerOnOff);
getEffect(sSession);
if (mEqualizer != null) {
mReleaseButton.setOnCheckedChangeListener(this);
mOnOffButton.setOnCheckedChangeListener(this);
short[] bandLevelRange = mEqualizer.getBandLevelRange();
int centerFreq;
int[] freqRange;
// Band 1 level
centerFreq = mEqualizer.getCenterFreq((short) 0);
freqRange = mEqualizer.getBandFreqRange((short) 0);
displayFreq(R.id.eqParam1Center, centerFreq);
displayFreq(R.id.eqParam1Min, freqRange[0]);
displayFreq(R.id.eqParam1Max, freqRange[1]);
seekBar = (SeekBar) findViewById(R.id.eqParam1SeekBar);
textView = (TextView) findViewById(R.id.eqParam1Value);
mParameters[0] = new BandLevelParam(mEqualizer, 0, bandLevelRange[0], bandLevelRange[1], seekBar, textView);
seekBar.setOnSeekBarChangeListener(mParameters[0]);
// Band 2 level
centerFreq = mEqualizer.getCenterFreq((short) 1);
freqRange = mEqualizer.getBandFreqRange((short) 1);
displayFreq(R.id.eqParam2Center, centerFreq);
displayFreq(R.id.eqParam2Min, freqRange[0]);
displayFreq(R.id.eqParam2Max, freqRange[1]);
seekBar = (SeekBar) findViewById(R.id.eqParam2SeekBar);
textView = (TextView) findViewById(R.id.eqParam2Value);
mParameters[1] = new BandLevelParam(mEqualizer, 1, bandLevelRange[0], bandLevelRange[1], seekBar, textView);
seekBar.setOnSeekBarChangeListener(mParameters[1]);
// Band 3 level
centerFreq = mEqualizer.getCenterFreq((short) 2);
freqRange = mEqualizer.getBandFreqRange((short) 2);
displayFreq(R.id.eqParam3Center, centerFreq);
displayFreq(R.id.eqParam3Min, freqRange[0]);
displayFreq(R.id.eqParam3Max, freqRange[1]);
seekBar = (SeekBar) findViewById(R.id.eqParam3SeekBar);
textView = (TextView) findViewById(R.id.eqParam3Value);
mParameters[2] = new BandLevelParam(mEqualizer, 2, bandLevelRange[0], bandLevelRange[1], seekBar, textView);
seekBar.setOnSeekBarChangeListener(mParameters[2]);
// Band 4 level
centerFreq = mEqualizer.getCenterFreq((short) 3);
freqRange = mEqualizer.getBandFreqRange((short) 3);
displayFreq(R.id.eqParam4Center, centerFreq);
displayFreq(R.id.eqParam4Min, freqRange[0]);
displayFreq(R.id.eqParam4Max, freqRange[1]);
seekBar = (SeekBar) findViewById(R.id.eqParam4SeekBar);
textView = (TextView) findViewById(R.id.eqParam4Value);
mParameters[3] = new BandLevelParam(mEqualizer, 3, bandLevelRange[0], bandLevelRange[1], seekBar, textView);
seekBar.setOnSeekBarChangeListener(mParameters[3]);
// Band 5 level
centerFreq = mEqualizer.getCenterFreq((short) 4);
freqRange = mEqualizer.getBandFreqRange((short) 4);
displayFreq(R.id.eqParam5Center, centerFreq);
displayFreq(R.id.eqParam5Min, freqRange[0]);
displayFreq(R.id.eqParam5Max, freqRange[1]);
seekBar = (SeekBar) findViewById(R.id.eqParam5SeekBar);
textView = (TextView) findViewById(R.id.eqParam5Value);
mParameters[4] = new BandLevelParam(mEqualizer, 4, bandLevelRange[0], bandLevelRange[1], seekBar, textView);
seekBar.setOnSeekBarChangeListener(mParameters[4]);
// Presets
short numPresets = mEqualizer.getNumberOfPresets();
seekBar = (SeekBar) findViewById(R.id.eqParam6SeekBar);
textView = (TextView) findViewById(R.id.eqParam6Value);
mParameters[5] = new PresetParam(mEqualizer, (short) 0, (short) (numPresets - 1), seekBar, textView);
seekBar.setOnSeekBarChangeListener(mParameters[5]);
}
}
use of android.widget.SeekBar in project android_frameworks_base by crdroidandroid.
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 android_frameworks_base by crdroidandroid.
the class GradientsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final FrameLayout layout = new FrameLayout(this);
final ShadersView shadersView = new ShadersView(this);
final GradientView gradientView = new GradientView(this);
final RadialGradientView radialGradientView = new RadialGradientView(this);
final SweepGradientView sweepGradientView = new SweepGradientView(this);
final BitmapView bitmapView = new BitmapView(this);
final SeekBar rotateView = new SeekBar(this);
rotateView.setMax(360);
rotateView.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
public void onStopTrackingTouch(SeekBar seekBar) {
}
public void onStartTrackingTouch(SeekBar seekBar) {
}
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
gradientView.setRotationY((float) progress);
radialGradientView.setRotationX((float) progress);
sweepGradientView.setRotationY((float) progress);
bitmapView.setRotationX((float) progress);
}
});
layout.addView(shadersView);
layout.addView(gradientView, new FrameLayout.LayoutParams(200, 200, Gravity.CENTER));
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(200, 200, Gravity.CENTER);
lp.setMargins(220, 0, 0, 0);
layout.addView(radialGradientView, lp);
lp = new FrameLayout.LayoutParams(200, 200, Gravity.CENTER);
lp.setMargins(440, 0, 0, 0);
layout.addView(sweepGradientView, lp);
lp = new FrameLayout.LayoutParams(200, 200, Gravity.CENTER);
lp.setMargins(220, -220, 0, 0);
layout.addView(bitmapView, lp);
layout.addView(rotateView, new FrameLayout.LayoutParams(300, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM));
setContentView(layout);
}
use of android.widget.SeekBar in project android_frameworks_base by DirtyUnicorns.
the class VolumePreference method onBindDialogView.
@Override
protected void onBindDialogView(View view) {
super.onBindDialogView(view);
final SeekBar seekBar = (SeekBar) view.findViewById(R.id.seekbar);
mSeekBarVolumizer = new SeekBarVolumizer(getContext(), mStreamType, null, this);
mSeekBarVolumizer.start();
mSeekBarVolumizer.setSeekBar(seekBar);
getPreferenceManager().registerOnActivityStopListener(this);
// grab focus and key events so that pressing the volume buttons in the
// dialog doesn't also show the normal volume adjust toast.
view.setOnKeyListener(this);
view.setFocusableInTouchMode(true);
view.requestFocus();
}
use of android.widget.SeekBar in project J2ME-Loader by nikita36078.
the class ConfigActivity method onCreate.
@SuppressLint({ "StringFormatMatches", "StringFormatInvalid" })
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_config);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
ContextHolder.setCurrentActivity(this);
pathToMidletDir = getIntent().getDataString();
String appName = pathToMidletDir.substring(pathToMidletDir.lastIndexOf('/') + 1);
keylayoutFile = new File(DATA_DIR + appName, "VirtualKeyboardLayout");
dataDir = new File(DATA_DIR + appName);
params = new SharedPreferencesContainer(appName, Context.MODE_PRIVATE, this);
System.setProperty("microedition.sensor.version", "1");
System.setProperty("microedition.platform", "Nokia 6233");
System.setProperty("microedition.configuration", "CDLC1.1");
System.setProperty("microedition.profiles", "MIDP2.0");
System.setProperty("microedition.m3g.version", "1.1");
System.setProperty("microedition.media.version", "1.0");
System.setProperty("supports.mixing", "true");
System.setProperty("supports.audio.capture", "false");
System.setProperty("supports.video.capture", "false");
System.setProperty("supports.recording", "false");
System.setProperty("microedition.pim.version", "1.0");
System.setProperty("microedition.io.file.FileConnection.version", "1.0");
System.setProperty("microedition.locale", Locale.getDefault().getCountry().toLowerCase());
System.setProperty("microedition.encoding", "ISO-8859-1");
System.setProperty("user.home", Environment.getExternalStorageDirectory().getPath());
tfScreenWidth = findViewById(R.id.tfScreenWidth);
tfScreenHeight = findViewById(R.id.tfScreenHeight);
tfScreenBack = findViewById(R.id.tfScreenBack);
cxScaleToFit = findViewById(R.id.cxScaleToFit);
sbScaleRatio = findViewById(R.id.sbScaleRatio);
tfScaleRatioValue = findViewById(R.id.tfScaleRatioValue);
spOrientation = findViewById(R.id.spOrientation);
cxKeepAspectRatio = findViewById(R.id.cxKeepAspectRatio);
cxFilter = findViewById(R.id.cxFilter);
cxImmediate = findViewById(R.id.cxImmediate);
cxHwAcceleration = findViewById(R.id.cxHwAcceleration);
tfFontSizeSmall = findViewById(R.id.tfFontSizeSmall);
tfFontSizeMedium = findViewById(R.id.tfFontSizeMedium);
tfFontSizeLarge = findViewById(R.id.tfFontSizeLarge);
cxFontSizeInSP = findViewById(R.id.cxFontSizeInSP);
tfSystemProperties = findViewById(R.id.tfSystemProperties);
cxShowKeyboard = findViewById(R.id.cxIsShowKeyboard);
cxVKFeedback = findViewById(R.id.cxVKFeedback);
cxTouchInput = findViewById(R.id.cxTouchInput);
sbVKAlpha = findViewById(R.id.sbVKAlpha);
tfVKHideDelay = findViewById(R.id.tfVKHideDelay);
tfVKFore = findViewById(R.id.tfVKFore);
tfVKBack = findViewById(R.id.tfVKBack);
tfVKSelFore = findViewById(R.id.tfVKSelFore);
tfVKSelBack = findViewById(R.id.tfVKSelBack);
tfVKOutline = findViewById(R.id.tfVKOutline);
screenWidths = new ArrayList<>();
screenHeights = new ArrayList<>();
screenAdapter = new ArrayList<>();
fillScreenSizePresets(ContextHolder.getDisplayWidth(), ContextHolder.getDisplayHeight());
fontSmall = new ArrayList<>();
fontMedium = new ArrayList<>();
fontLarge = new ArrayList<>();
fontAdapter = new ArrayList<>();
addFontSizePreset("128 x 128", 9, 13, 15);
addFontSizePreset("128 x 160", 13, 15, 20);
addFontSizePreset("176 x 220", 15, 18, 22);
addFontSizePreset("240 x 320", 18, 22, 26);
findViewById(R.id.cmdScreenSizePresets).setOnClickListener(this);
findViewById(R.id.cmdSwapSizes).setOnClickListener(this);
findViewById(R.id.cmdFontSizePresets).setOnClickListener(this);
findViewById(R.id.cmdScreenBack).setOnClickListener(this);
findViewById(R.id.cmdVKBack).setOnClickListener(this);
findViewById(R.id.cmdVKFore).setOnClickListener(this);
findViewById(R.id.cmdVKSelBack).setOnClickListener(this);
findViewById(R.id.cmdVKSelFore).setOnClickListener(this);
findViewById(R.id.cmdVKOutline).setOnClickListener(this);
sbScaleRatio.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean b) {
tfScaleRatioValue.setText(String.valueOf(progress));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
tfScaleRatioValue.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
Integer enteredProgress = Integer.valueOf(s.toString());
sbScaleRatio.setProgress(enteredProgress);
}
@Override
public void afterTextChanged(Editable s) {
}
});
loadParams(params);
applyConfiguration();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
cxHwAcceleration.setVisibility(View.VISIBLE);
}
cxVKFeedback.setEnabled(cxShowKeyboard.isChecked());
cxShowKeyboard.setOnClickListener(v -> {
if (!((CheckBox) v).isChecked()) {
cxVKFeedback.setEnabled(false);
} else {
cxVKFeedback.setEnabled(true);
}
});
File appSettings = new File(getFilesDir().getParent() + File.separator + "shared_prefs", appName + ".xml");
if (appSettings.exists() && !getIntent().getBooleanExtra(SHOW_SETTINGS_KEY, false)) {
startMIDlet();
}
}
Aggregations