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)");
}
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);
}
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) {
}
});
}
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);
}
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);
}
Aggregations