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