Search in sources :

Example 81 with SeekBar

use of android.widget.SeekBar in project muzei by romannurik.

the class SettingsAdvancedFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.settings_advanced_fragment, container, false);
    mBlurSeekBar = (SeekBar) rootView.findViewById(R.id.blur_amount);
    mBlurSeekBar.setProgress(Prefs.getSharedPreferences(getContext()).getInt(Prefs.PREF_BLUR_AMOUNT, MuzeiBlurRenderer.DEFAULT_BLUR));
    mBlurSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int value, boolean fromUser) {
            if (fromUser) {
                mHandler.removeCallbacks(mUpdateBlurRunnable);
                mHandler.postDelayed(mUpdateBlurRunnable, 750);
            }
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    mDimSeekBar = (SeekBar) rootView.findViewById(R.id.dim_amount);
    mDimSeekBar.setProgress(Prefs.getSharedPreferences(getContext()).getInt(Prefs.PREF_DIM_AMOUNT, MuzeiBlurRenderer.DEFAULT_MAX_DIM));
    mDimSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int value, boolean fromUser) {
            if (fromUser) {
                mHandler.removeCallbacks(mUpdateDimRunnable);
                mHandler.postDelayed(mUpdateDimRunnable, 750);
            }
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    mGreySeekBar = (SeekBar) rootView.findViewById(R.id.grey_amount);
    mGreySeekBar.setProgress(Prefs.getSharedPreferences(getContext()).getInt(Prefs.PREF_GREY_AMOUNT, MuzeiBlurRenderer.DEFAULT_GREY));
    mGreySeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int value, boolean fromUser) {
            if (fromUser) {
                mHandler.removeCallbacks(mUpdateGreyRunnable);
                mHandler.postDelayed(mUpdateGreyRunnable, 750);
            }
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    CheckBox mNotifyNewWallpaperCheckBox = (CheckBox) rootView.findViewById(R.id.notify_new_wallpaper_checkbox);
    mNotifyNewWallpaperCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton button, boolean checked) {
            PreferenceManager.getDefaultSharedPreferences(getContext()).edit().putBoolean(NewWallpaperNotificationReceiver.PREF_ENABLED, checked).apply();
        }
    });
    mNotifyNewWallpaperCheckBox.setChecked(PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean(NewWallpaperNotificationReceiver.PREF_ENABLED, true));
    CheckBox mBlurOnLockScreenCheckBox = (CheckBox) rootView.findViewById(R.id.blur_on_lockscreen_checkbox);
    mBlurOnLockScreenCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton button, boolean checked) {
            Prefs.getSharedPreferences(getContext()).edit().putBoolean(Prefs.PREF_DISABLE_BLUR_WHEN_LOCKED, !checked).apply();
        }
    });
    mBlurOnLockScreenCheckBox.setChecked(!Prefs.getSharedPreferences(getContext()).getBoolean(Prefs.PREF_DISABLE_BLUR_WHEN_LOCKED, false));
    return rootView;
}
Also used : SeekBar(android.widget.SeekBar) CheckBox(android.widget.CheckBox) View(android.view.View) CompoundButton(android.widget.CompoundButton)

Example 82 with SeekBar

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

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

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

the class MediaRouteControllerDialog method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_LEFT_ICON);
    setContentView(R.layout.media_route_controller_dialog);
    mVolumeLayout = (LinearLayout) findViewById(R.id.media_route_volume_layout);
    mVolumeSlider = (SeekBar) findViewById(R.id.media_route_volume_slider);
    mVolumeSlider.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        private final Runnable mStopTrackingTouch = new Runnable() {

            @Override
            public void run() {
                if (mVolumeSliderTouched) {
                    mVolumeSliderTouched = false;
                    updateVolume();
                }
            }
        };

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            if (mVolumeSliderTouched) {
                mVolumeSlider.removeCallbacks(mStopTrackingTouch);
            } else {
                mVolumeSliderTouched = true;
            }
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            // Defer resetting mVolumeSliderTouched to allow the media route provider
            // a little time to settle into its new state and publish the final
            // volume update.
            mVolumeSlider.postDelayed(mStopTrackingTouch, VOLUME_UPDATE_DELAY_MILLIS);
        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            if (fromUser) {
                mRoute.requestSetVolume(progress);
            }
        }
    });
    mDisconnectButton = (Button) findViewById(R.id.media_route_disconnect_button);
    mDisconnectButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mRoute.isSelected()) {
                mRouter.getDefaultRoute().select();
            }
            dismiss();
        }
    });
    mCreated = true;
    if (update()) {
        mControlView = onCreateMediaControlView(savedInstanceState);
        FrameLayout controlFrame = (FrameLayout) findViewById(R.id.media_route_control_frame);
        if (mControlView != null) {
            controlFrame.addView(mControlView);
            controlFrame.setVisibility(View.VISIBLE);
        } else {
            controlFrame.setVisibility(View.GONE);
        }
    }
}
Also used : SeekBar(android.widget.SeekBar) FrameLayout(android.widget.FrameLayout) View(android.view.View)

Example 84 with SeekBar

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

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

Example 85 with SeekBar

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

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