Search in sources :

Example 56 with SeekBar

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

the class IncreasingRingVolumePreference method onBindViewHolder.

@Override
public void onBindViewHolder(PreferenceViewHolder holder) {
    super.onBindViewHolder(holder);
    initHandler();
    final SeekBar seekBar = (SeekBar) holder.findViewById(R.id.start_volume);
    if (seekBar == mStartVolumeSeekBar)
        return;
    mStartVolumeSeekBar = seekBar;
    mRampUpTimeSeekBar = (SeekBar) holder.findViewById(R.id.ramp_up_time);
    mRampUpTimeValue = (TextView) holder.findViewById(R.id.ramp_up_time_value);
    final ContentResolver cr = getContext().getContentResolver();
    float startVolume = CMSettings.System.getFloat(cr, CMSettings.System.INCREASING_RING_START_VOLUME, 0.1f);
    int rampUpTime = CMSettings.System.getInt(cr, CMSettings.System.INCREASING_RING_RAMP_UP_TIME, 10);
    mStartVolumeSeekBar.setProgress(Math.round(startVolume * 1000F));
    mStartVolumeSeekBar.setOnSeekBarChangeListener(this);
    mRampUpTimeSeekBar.setOnSeekBarChangeListener(this);
    mRampUpTimeSeekBar.setProgress((rampUpTime / 5) - 1);
    mRampUpTimeValue.setText(Formatter.formatShortElapsedTime(getContext(), rampUpTime * 1000));
}
Also used : SeekBar(android.widget.SeekBar) ContentResolver(android.content.ContentResolver)

Example 57 with SeekBar

use of android.widget.SeekBar 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)

Example 58 with SeekBar

use of android.widget.SeekBar in project UltimateAndroid by cymcsg.

the class CropperSample method onCreate.

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.cropper_activity);
    // Sets fonts for all
    Typeface mFont = Typeface.createFromAsset(getAssets(), "Roboto-Thin.ttf");
    ViewGroup root = (ViewGroup) findViewById(R.id.mylayout);
    setFont(root, mFont);
    // Initialize components of the app
    final CropImageView cropImageView = (CropImageView) findViewById(R.id.CropImageView);
    final SeekBar aspectRatioXSeek = (SeekBar) findViewById(R.id.aspectRatioXSeek);
    final SeekBar aspectRatioYSeek = (SeekBar) findViewById(R.id.aspectRatioYSeek);
    final ToggleButton fixedAspectRatioToggle = (ToggleButton) findViewById(R.id.fixedAspectRatioToggle);
    Spinner showGuidelinesSpin = (Spinner) findViewById(R.id.showGuidelinesSpin);
    // Sets sliders to be disabled until fixedAspectRatio is set
    aspectRatioXSeek.setEnabled(false);
    aspectRatioYSeek.setEnabled(false);
    // Set initial spinner value
    showGuidelinesSpin.setSelection(ON_TOUCH);
    //Sets the rotate button
    final Button rotateButton = (Button) findViewById(R.id.Button_rotate);
    rotateButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            cropImageView.rotateImage(ROTATE_NINETY_DEGREES);
        }
    });
    // Sets fixedAspectRatio
    fixedAspectRatioToggle.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            cropImageView.setFixedAspectRatio(isChecked);
            if (isChecked) {
                aspectRatioXSeek.setEnabled(true);
                aspectRatioYSeek.setEnabled(true);
            } else {
                aspectRatioXSeek.setEnabled(false);
                aspectRatioYSeek.setEnabled(false);
            }
        }
    });
    // Sets initial aspect ratio to 10/10, for demonstration purposes
    cropImageView.setAspectRatio(DEFAULT_ASPECT_RATIO_VALUES, DEFAULT_ASPECT_RATIO_VALUES);
    // Sets aspectRatioX
    final TextView aspectRatioX = (TextView) findViewById(R.id.aspectRatioX);
    aspectRatioXSeek.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar aspectRatioXSeek, int progress, boolean fromUser) {
            try {
                mAspectRatioX = progress;
                cropImageView.setAspectRatio(progress, mAspectRatioY);
                aspectRatioX.setText(" " + progress);
            } catch (IllegalArgumentException e) {
            }
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    // Sets aspectRatioY
    final TextView aspectRatioY = (TextView) findViewById(R.id.aspectRatioY);
    aspectRatioYSeek.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar aspectRatioYSeek, int progress, boolean fromUser) {
            try {
                mAspectRatioY = progress;
                cropImageView.setAspectRatio(mAspectRatioX, progress);
                aspectRatioY.setText(" " + progress);
            } catch (IllegalArgumentException e) {
            }
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    // Sets up the Spinner
    showGuidelinesSpin.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

        public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
            cropImageView.setGuidelines(i);
        }

        public void onNothingSelected(AdapterView<?> adapterView) {
            return;
        }
    });
    final Button cropButton = (Button) findViewById(R.id.Button_crop);
    cropButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            croppedImage = cropImageView.getCroppedImage();
            ImageView croppedImageView = (ImageView) findViewById(R.id.croppedImageView);
            croppedImageView.setImageBitmap(croppedImage);
        }
    });
}
Also used : ToggleButton(android.widget.ToggleButton) OnCheckedChangeListener(android.widget.CompoundButton.OnCheckedChangeListener) SeekBar(android.widget.SeekBar) Typeface(android.graphics.Typeface) ViewGroup(android.view.ViewGroup) Spinner(android.widget.Spinner) OnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener) ImageView(android.widget.ImageView) CropImageView(com.marshalchen.common.uimodule.cropperimage.CropImageView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) CompoundButton(android.widget.CompoundButton) Button(android.widget.Button) ToggleButton(android.widget.ToggleButton) TextView(android.widget.TextView) AdapterView(android.widget.AdapterView) ImageView(android.widget.ImageView) CropImageView(com.marshalchen.common.uimodule.cropperimage.CropImageView) CropImageView(com.marshalchen.common.uimodule.cropperimage.CropImageView) CompoundButton(android.widget.CompoundButton)

Example 59 with SeekBar

use of android.widget.SeekBar in project android-gpuimage by CyberAgent.

the class ActivityGallery method onCreate.

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gallery);
    ((SeekBar) findViewById(R.id.seekBar)).setOnSeekBarChangeListener(this);
    findViewById(R.id.button_choose_filter).setOnClickListener(this);
    findViewById(R.id.button_save).setOnClickListener(this);
    mGPUImageView = (GPUImageView) findViewById(R.id.gpuimage);
    Intent photoPickerIntent = new Intent(Intent.ACTION_PICK);
    photoPickerIntent.setType("image/*");
    startActivityForResult(photoPickerIntent, REQUEST_PICK_IMAGE);
}
Also used : SeekBar(android.widget.SeekBar) Intent(android.content.Intent)

Example 60 with SeekBar

use of android.widget.SeekBar in project android_packages_apps_DSPManager by CyanogenMod.

the class BassBoostPreference method onBindDialogView.

@Override
protected void onBindDialogView(View view) {
    super.onBindDialogView(view);
    sInstances++;
    Log.d(TAG, "onBindDialogView");
    for (int i = 0; i < SEEKBAR_ID.length; i++) {
        SeekBar seekBar = (SeekBar) view.findViewById(SEEKBAR_ID[i]);
        TextView valueDisplay = (TextView) view.findViewById(VALUE_DISPLAY_ID[i]);
        mSeekBars[i] = new BassBoostSeekBar(seekBar, valueDisplay, BASS_BOOST_PREFS[i], SEEKBAR_MAX_VALUE[i], SEEKBAR_UOM[i]);
    }
}
Also used : SeekBar(android.widget.SeekBar) TextView(android.widget.TextView)

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