Search in sources :

Example 51 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)

Example 52 with SeekBar

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

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 53 with SeekBar

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

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

Example 54 with SeekBar

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

the class OnTheGoDialog method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Window window = getWindow();
    window.setType(WindowManager.LayoutParams.TYPE_VOLUME_OVERLAY);
    window.getAttributes().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
    window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
    window.requestFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.quick_settings_onthego_dialog);
    setCanceledOnTouchOutside(true);
    final ContentResolver resolver = mContext.getContentResolver();
    final SeekBar mSlider = (SeekBar) findViewById(R.id.alpha_slider);
    final float value = Settings.System.getFloat(resolver, Settings.System.ON_THE_GO_ALPHA, 0.5f);
    final int progress = ((int) (value * 100));
    mSlider.setProgress(progress);
    mSlider.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
            sendAlphaBroadcast(String.valueOf(i + 10));
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            removeAllOnTheGoDialogCallbacks();
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            dismissOnTheGoDialog(mOnTheGoDialogShortTimeout);
        }
    });
    if (!OnTheGoUtils.hasFrontCamera(getContext())) {
        findViewById(R.id.onthego_category_1).setVisibility(View.GONE);
    } else {
        final Switch mServiceToggle = (Switch) findViewById(R.id.onthego_service_toggle);
        final boolean restartService = Settings.System.getInt(resolver, Settings.System.ON_THE_GO_SERVICE_RESTART, 0) == 1;
        mServiceToggle.setChecked(restartService);
        mServiceToggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                Settings.System.putInt(resolver, Settings.System.ON_THE_GO_SERVICE_RESTART, (b ? 1 : 0));
                dismissOnTheGoDialog(mOnTheGoDialogShortTimeout);
            }
        });
        final Switch mCamSwitch = (Switch) findViewById(R.id.onthego_camera_toggle);
        final boolean useFrontCam = (Settings.System.getInt(resolver, Settings.System.ON_THE_GO_CAMERA, 0) == 1);
        mCamSwitch.setChecked(useFrontCam);
        mCamSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
                Settings.System.putInt(resolver, Settings.System.ON_THE_GO_CAMERA, (b ? 1 : 0));
                sendCameraBroadcast();
                dismissOnTheGoDialog(mOnTheGoDialogShortTimeout);
            }
        });
    }
}
Also used : Window(android.view.Window) SeekBar(android.widget.SeekBar) Switch(android.widget.Switch) CompoundButton(android.widget.CompoundButton) ContentResolver(android.content.ContentResolver)

Example 55 with SeekBar

use of android.widget.SeekBar in project BleSensorTag by StevenRudenko.

the class BleServicesAdapter method getChildView.

@Override
public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
    final ChildViewHolder holder;
    if (convertView == null) {
        holder = new ChildViewHolder();
        convertView = inflater.inflate(R.layout.li_characteristic, parent, false);
        holder.name = (TextView) convertView.findViewById(R.id.name);
        holder.uuid = (TextView) convertView.findViewById(R.id.uuid);
        holder.modes = (TextView) convertView.findViewById(R.id.modes);
        holder.seek = (SeekBar) convertView.findViewById(R.id.seek);
        holder.seek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

            @Override
            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                if (serviceListener == null || def == null || !fromUser) {
                    return;
                }
                final BaseSensor<?> sensor = (BaseSensor<?>) def.getSensor(holder.service.getUuid().toString());
                if (sensor == null) {
                    return;
                }
                if (sensor instanceof TiPeriodicalSensor) {
                    final TiPeriodicalSensor periodicalSensor = (TiPeriodicalSensor) sensor;
                    periodicalSensor.setPeriod(progress + periodicalSensor.getMinPeriod());
                    serviceListener.onServiceUpdated(holder.service);
                }
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {
            }
        });
        convertView.setTag(holder);
    } else {
        holder = (ChildViewHolder) convertView.getTag();
    }
    final BluetoothGattCharacteristic item = getChild(groupPosition, childPosition);
    final String uuid = item.getUuid().toString();
    final String name;
    final String modes = getModeString(item.getProperties());
    holder.service = item.getService();
    final String serviceUUID = item.getService().getUuid().toString();
    final Sensor<?> sensor = def != null ? (Sensor<?>) def.getSensor(serviceUUID) : null;
    // reset visibility
    holder.uuid.setVisibility(View.VISIBLE);
    holder.seek.setVisibility(View.GONE);
    if (sensor != null) {
        name = sensor.getCharacteristicName(uuid);
        if (sensor instanceof BaseSensor) {
            final BaseSensor<?> tiSensor = (BaseSensor<?>) sensor;
            if (tiSensor.isConfigUUID(uuid)) {
                if (sensor instanceof TiPeriodicalSensor) {
                    final TiPeriodicalSensor periodicalSensor = (TiPeriodicalSensor) sensor;
                    final int max = periodicalSensor.getMaxPeriod() - periodicalSensor.getMinPeriod();
                    final int value = periodicalSensor.getPeriod() - periodicalSensor.getMinPeriod();
                    holder.seek.setMax(max);
                    holder.seek.setProgress(value);
                    holder.seek.setVisibility(View.VISIBLE);
                    holder.uuid.setVisibility(View.GONE);
                }
            }
        }
    } else {
        name = "Unknown";
    }
    holder.name.setText(name);
    holder.uuid.setText(uuid);
    holder.modes.setText(modes);
    return convertView;
}
Also used : SeekBar(android.widget.SeekBar) BaseSensor(sample.ble.sensortag.sensor.BaseSensor) TiPeriodicalSensor(sample.ble.sensortag.sensor.ti.TiPeriodicalSensor) BluetoothGattCharacteristic(android.bluetooth.BluetoothGattCharacteristic)

Aggregations

SeekBar (android.widget.SeekBar)193 TextView (android.widget.TextView)90 View (android.view.View)64 ImageView (android.widget.ImageView)28 LinearLayout (android.widget.LinearLayout)22 FrameLayout (android.widget.FrameLayout)19 Intent (android.content.Intent)18 CompoundButton (android.widget.CompoundButton)18 OnSeekBarChangeListener (android.widget.SeekBar.OnSeekBarChangeListener)14 Paint (android.graphics.Paint)13 AdapterView (android.widget.AdapterView)13 AlertDialog (android.support.v7.app.AlertDialog)11 Button (android.widget.Button)11 DialogInterface (android.content.DialogInterface)10 CheckBox (android.widget.CheckBox)10 ToggleButton (android.widget.ToggleButton)10 SuppressLint (android.annotation.SuppressLint)9 EditText (android.widget.EditText)9 Spinner (android.widget.Spinner)7 SharedPreferences (android.content.SharedPreferences)6