Search in sources :

Example 41 with FrameLayout

use of android.widget.FrameLayout in project platform_frameworks_base by android.

the class MovingSurfaceViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FrameLayout content = new FrameLayout(this);
    mSurfaceView = new MySurfaceView(this);
    mSurfaceView.getHolder().addCallback(this);
    final float density = getResources().getDisplayMetrics().density;
    int size = (int) (200 * density);
    content.addView(mSurfaceView, new FrameLayout.LayoutParams(size, size, Gravity.CENTER_HORIZONTAL | Gravity.TOP));
    mAnimator = ObjectAnimator.ofFloat(mSurfaceView, "myTranslationY", 0, size);
    mAnimator.setRepeatMode(ObjectAnimator.REVERSE);
    mAnimator.setRepeatCount(ObjectAnimator.INFINITE);
    mAnimator.setDuration(200);
    mAnimator.setInterpolator(new LinearInterpolator());
    setContentView(content);
}
Also used : LinearInterpolator(android.view.animation.LinearInterpolator) FrameLayout(android.widget.FrameLayout)

Example 42 with FrameLayout

use of android.widget.FrameLayout in project platform_frameworks_base by android.

the class Rotate3dTextActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    final LinearLayout layout = new LinearLayout(this);
    layout.setOrientation(LinearLayout.VERTICAL);
    Rotate3dTextView view = new Rotate3dTextView(this);
    layout.addView(view, makeLayoutParams());
    view = new Rotate3dTextView(this);
    FrameLayout container = new FrameLayout(this);
    container.setLayerType(View.LAYER_TYPE_HARDWARE, null);
    container.addView(view);
    layout.addView(container, makeLayoutParams());
    setContentView(layout);
}
Also used : FrameLayout(android.widget.FrameLayout) LinearLayout(android.widget.LinearLayout)

Example 43 with FrameLayout

use of android.widget.FrameLayout in project platform_frameworks_base by android.

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 44 with FrameLayout

use of android.widget.FrameLayout in project platform_frameworks_base by android.

the class SingleFrameTextureViewTestActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    TextView preview = new TextView(this);
    preview.setText("This is a preview");
    preview.setBackgroundColor(Color.WHITE);
    mPreview = preview;
    mTextureView = new TextureView(this);
    mTextureView.setSurfaceTextureListener(this);
    FrameLayout content = new FrameLayout(this);
    content.addView(mTextureView, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    content.addView(mPreview, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    setContentView(content);
}
Also used : FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) TextureView(android.view.TextureView)

Example 45 with FrameLayout

use of android.widget.FrameLayout in project AndroidPicker by gzu-liyujiang.

the class BasicPopup method initDialog.

private void initDialog() {
    contentLayout = new FrameLayout(activity);
    contentLayout.setLayoutParams(new ViewGroup.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
    contentLayout.setFocusable(true);
    contentLayout.setFocusableInTouchMode(true);
    //contentLayout.setFitsSystemWindows(true);
    dialog = new Dialog(activity);
    //触摸屏幕取消窗体
    dialog.setCanceledOnTouchOutside(true);
    //按返回键取消窗体
    dialog.setCancelable(true);
    dialog.setOnKeyListener(this);
    dialog.setOnDismissListener(this);
    Window window = dialog.getWindow();
    if (window != null) {
        window.setGravity(Gravity.BOTTOM);
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        //AndroidRuntimeException: requestFeature() must be called before adding content
        window.requestFeature(Window.FEATURE_NO_TITLE);
        window.setContentView(contentLayout);
    }
    setSize(screenWidthPixels, WRAP_CONTENT);
}
Also used : Window(android.view.Window) ColorDrawable(android.graphics.drawable.ColorDrawable) ViewGroup(android.view.ViewGroup) Dialog(android.app.Dialog) FrameLayout(android.widget.FrameLayout)

Aggregations

FrameLayout (android.widget.FrameLayout)634 View (android.view.View)244 TextView (android.widget.TextView)143 ViewGroup (android.view.ViewGroup)128 ImageView (android.widget.ImageView)95 LinearLayout (android.widget.LinearLayout)89 ListView (android.widget.ListView)54 AdapterView (android.widget.AdapterView)49 Button (android.widget.Button)44 LayoutInflater (android.view.LayoutInflater)42 Bitmap (android.graphics.Bitmap)41 LayoutParams (android.view.ViewGroup.LayoutParams)37 AbsListView (android.widget.AbsListView)37 Context (android.content.Context)35 Intent (android.content.Intent)28 Activity (android.app.Activity)25 TextureView (android.view.TextureView)25 ColorDrawable (android.graphics.drawable.ColorDrawable)23 FileOutputStream (java.io.FileOutputStream)23 Drawable (android.graphics.drawable.Drawable)20