Search in sources :

Example 26 with FrameLayout

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);
}
Also used : Button(android.widget.Button) FrameLayout(android.widget.FrameLayout) TimePickerDialog(android.app.TimePickerDialog) View(android.view.View)

Example 27 with FrameLayout

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);
}
Also used : SeekBar(android.widget.SeekBar) FrameLayout(android.widget.FrameLayout) Paint(android.graphics.Paint)

Example 28 with FrameLayout

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) {
        }
    });
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) SeekBar(android.widget.SeekBar) FrameLayout(android.widget.FrameLayout) LinearLayout(android.widget.LinearLayout) Paint(android.graphics.Paint)

Example 29 with FrameLayout

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);
}
Also used : EditText(android.widget.EditText) FrameLayout(android.widget.FrameLayout)

Example 30 with FrameLayout

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);
}
Also used : FrameLayout(android.widget.FrameLayout)

Aggregations

FrameLayout (android.widget.FrameLayout)619 View (android.view.View)238 TextView (android.widget.TextView)136 ViewGroup (android.view.ViewGroup)125 ImageView (android.widget.ImageView)93 LinearLayout (android.widget.LinearLayout)89 ListView (android.widget.ListView)54 AdapterView (android.widget.AdapterView)47 Button (android.widget.Button)44 LayoutInflater (android.view.LayoutInflater)42 Bitmap (android.graphics.Bitmap)40 LayoutParams (android.view.ViewGroup.LayoutParams)37 AbsListView (android.widget.AbsListView)37 Context (android.content.Context)34 Activity (android.app.Activity)25 Intent (android.content.Intent)25 TextureView (android.view.TextureView)25 ColorDrawable (android.graphics.drawable.ColorDrawable)23 FileOutputStream (java.io.FileOutputStream)23 Drawable (android.graphics.drawable.Drawable)20