Search in sources :

Example 1 with SeekBarVolumizer

use of android.preference.SeekBarVolumizer in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class VolumeSeekBarPreference method init.

private void init() {
    if (mSeekBar == null)
        return;
    final SeekBarVolumizer.Callback sbvc = new SeekBarVolumizer.Callback() {

        @Override
        public void onSampleStarting(SeekBarVolumizer sbv) {
            if (mCallback != null) {
                mCallback.onSampleStarting(sbv);
            }
        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) {
            if (mCallback != null) {
                mCallback.onStreamValueChanged(mStream, progress);
            }
        }

        @Override
        public void onMuted(boolean muted, boolean zenMuted) {
            if (mMuted == muted && mZenMuted == zenMuted)
                return;
            mMuted = muted;
            mZenMuted = zenMuted;
            updateIconView();
        }
    };
    final Uri sampleUri = mStream == AudioManager.STREAM_MUSIC ? getMediaVolumeUri() : null;
    if (mVolumizer == null) {
        mVolumizer = new SeekBarVolumizer(getContext(), mStream, sampleUri, sbvc);
    }
    mVolumizer.start();
    mVolumizer.setSeekBar(mSeekBar);
    updateIconView();
    mCallback.onStreamValueChanged(mStream, mSeekBar.getProgress());
    updateSuppressionText();
    if (!isEnabled()) {
        mSeekBar.setEnabled(false);
        mVolumizer.stop();
    }
}
Also used : SeekBar(android.widget.SeekBar) SeekBarVolumizer(android.preference.SeekBarVolumizer) Uri(android.net.Uri)

Aggregations

Uri (android.net.Uri)1 SeekBarVolumizer (android.preference.SeekBarVolumizer)1 SeekBar (android.widget.SeekBar)1