use of android.widget.FrameLayout in project android_frameworks_base by ParanoidAndroid.
the class TimeDialogActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout layout = new FrameLayout(this);
Button b = new Button(this);
b.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER));
b.setText("Show dialog");
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
new TimePickerDialog(TimeDialogActivity.this, null, 12, 12, true).show();
}
});
layout.addView(b);
setContentView(layout);
}
use of android.widget.FrameLayout 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.FrameLayout 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.FrameLayout in project android_frameworks_base by ParanoidAndroid.
the class SimplePathsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout layout = new FrameLayout(this);
EditText text = new EditText(this);
layout.addView(text, new FrameLayout.LayoutParams(600, 350, Gravity.CENTER));
text.setText("This is an example of an EditText widget \n" + "using simple paths to create the selection.");
//text.setSelection(0, text.getText().length());
setContentView(layout);
}
use of android.widget.FrameLayout in project android_frameworks_base by ParanoidAndroid.
the class BitmapsAlphaActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final BitmapsView view = new BitmapsView(this);
final FrameLayout layout = new FrameLayout(this);
layout.addView(view, new FrameLayout.LayoutParams(480, 800, Gravity.CENTER));
setContentView(layout);
}
Aggregations