Search in sources :

Example 16 with SeekBar

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

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]);
    }
}
Also used : SeekBar(android.widget.SeekBar) TextView(android.widget.TextView)

Example 17 with SeekBar

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

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());
    }
}
Also used : SeekBar(android.widget.SeekBar) TextView(android.widget.TextView)

Example 18 with SeekBar

use of android.widget.SeekBar in project cw-omnibus by commonsguy.

the class FragmentBase method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    setRetainInstance(true);
    View result = inflater.inflate(R.layout.scaleclip, container, false);
    SeekBar bar = ((SeekBar) result.findViewById(R.id.level));
    bar.setOnSeekBarChangeListener(this);
    image = (ImageView) result.findViewById(R.id.image);
    setImageBackground(image);
    image.setImageLevel(bar.getProgress());
    return (result);
}
Also used : SeekBar(android.widget.SeekBar) ImageView(android.widget.ImageView) View(android.view.View)

Example 19 with SeekBar

use of android.widget.SeekBar in project XobotOS by xamarin.

the class SeekBarPreference method onBindView.

@Override
protected void onBindView(View view) {
    super.onBindView(view);
    SeekBar seekBar = (SeekBar) view.findViewById(com.android.internal.R.id.seekbar);
    seekBar.setOnSeekBarChangeListener(this);
    seekBar.setMax(mMax);
    seekBar.setProgress(mProgress);
    seekBar.setEnabled(isEnabled());
}
Also used : SeekBar(android.widget.SeekBar)

Example 20 with SeekBar

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

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