Search in sources :

Example 21 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 22 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 23 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 24 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 25 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)

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