Search in sources :

Example 11 with SeekBar

use of android.widget.SeekBar in project BoomMenu by Nightonke.

the class ButtonPlaceAlignmentActivity method initLeftMarginSeek.

private void initLeftMarginSeek() {
    SeekBar leftMarginSeekBar = (SeekBar) findViewById(R.id.left_margin_seek);
    assert leftMarginSeekBar != null;
    leftMarginSeekBar.setMax(Util.dp2px(50));
    leftMarginSeekBar.setProgress((int) bmb.getButtonLeftMargin());
    leftMarginSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            leftMarginSeekText.setText("Left margin = " + seekBar.getProgress() + " pixel(s)");
            bmb.setButtonLeftMargin(progress);
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
    leftMarginSeekText = (TextView) findViewById(R.id.left_margin_text);
    leftMarginSeekText.setText("Left margin = " + leftMarginSeekBar.getProgress() + " pixel(s)");
}
Also used : SeekBar(android.widget.SeekBar)

Example 12 with SeekBar

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

the class GradientsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final FrameLayout layout = new FrameLayout(this);
    final ShadersView shadersView = new ShadersView(this);
    final GradientView gradientView = new GradientView(this);
    final RadialGradientView radialGradientView = new RadialGradientView(this);
    final SweepGradientView sweepGradientView = new SweepGradientView(this);
    final BitmapView bitmapView = new BitmapView(this);
    final SeekBar rotateView = new SeekBar(this);
    rotateView.setMax(360);
    rotateView.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        public void onStopTrackingTouch(SeekBar seekBar) {
        }

        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            gradientView.setRotationY((float) progress);
            radialGradientView.setRotationX((float) progress);
            sweepGradientView.setRotationY((float) progress);
            bitmapView.setRotationX((float) progress);
        }
    });
    layout.addView(shadersView);
    layout.addView(gradientView, new FrameLayout.LayoutParams(200, 200, Gravity.CENTER));
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(200, 200, Gravity.CENTER);
    lp.setMargins(220, 0, 0, 0);
    layout.addView(radialGradientView, lp);
    lp = new FrameLayout.LayoutParams(200, 200, Gravity.CENTER);
    lp.setMargins(440, 0, 0, 0);
    layout.addView(sweepGradientView, lp);
    lp = new FrameLayout.LayoutParams(200, 200, Gravity.CENTER);
    lp.setMargins(220, -220, 0, 0);
    layout.addView(bitmapView, lp);
    layout.addView(rotateView, new FrameLayout.LayoutParams(300, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM));
    setContentView(layout);
}
Also used : SeekBar(android.widget.SeekBar) FrameLayout(android.widget.FrameLayout) Paint(android.graphics.Paint)

Example 13 with SeekBar

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

the class PointsActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setBackgroundDrawable(new ColorDrawable(0xff000000));
    SeekBar slider = new SeekBar(this);
    LinearLayout container = new LinearLayout(this);
    container.setOrientation(LinearLayout.VERTICAL);
    setContentView(container);
    container.addView(slider);
    slider.setMax(100);
    slider.setProgress(50);
    FrameLayout frame = new FrameLayout(this);
    final RenderingView gpuView = new RenderingView(this, Color.GREEN);
    frame.addView(gpuView);
    final RenderingView swView = new RenderingView(this, Color.RED);
    swView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
    frame.addView(swView);
    container.addView(frame);
    slider.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            mSeekValue = (float) progress / 100.0f;
            float gpuAlpha = Math.min(2.0f * mSeekValue, 1f);
            gpuView.setAlpha(gpuAlpha);
            float swAlpha = Math.min((1 - mSeekValue) * 2.0f, 1f);
            System.out.println("(gpuAlpha, swAlpha = " + gpuAlpha + ", " + swAlpha);
            swView.setAlpha(swAlpha);
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }
    });
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) SeekBar(android.widget.SeekBar) FrameLayout(android.widget.FrameLayout) LinearLayout(android.widget.LinearLayout) Paint(android.graphics.Paint)

Example 14 with SeekBar

use of android.widget.SeekBar in project RoboBinding by RoboBinding.

the class SeekBarAddOnTest method setUp.

@Before
public void setUp() {
    view = new SeekBar(RuntimeEnvironment.application);
    viewListeners = new SeekBarAddOn(view);
}
Also used : SeekBar(android.widget.SeekBar) Before(org.junit.Before)

Example 15 with SeekBar

use of android.widget.SeekBar in project RoboBinding by RoboBinding.

the class AbstractSeekBarAttributeTest method initializeViewAndListeners.

@Before
public void initializeViewAndListeners() {
    view = new SeekBar(RuntimeEnvironment.application);
    viewAddOn = new MockSeekBarAddOn(view);
}
Also used : SeekBar(android.widget.SeekBar) Before(org.junit.Before)

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