use of android.widget.FrameLayout in project weiciyuan by qii.
the class PullToRefreshListView method handleStyledAttributes.
@Override
protected void handleStyledAttributes(TypedArray a) {
super.handleStyledAttributes(a);
mListViewExtrasEnabled = a.getBoolean(R.styleable.PullToRefresh_ptrListViewExtrasEnabled, true);
if (mListViewExtrasEnabled) {
final FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL);
// Create Loading Views ready for use later
FrameLayout frame = new FrameLayout(getContext());
mHeaderLoadingView = createLoadingLayout(getContext(), Mode.PULL_FROM_START, a);
mHeaderLoadingView.setVisibility(View.GONE);
frame.addView(mHeaderLoadingView, lp);
mRefreshableView.addHeaderView(frame, null, false);
mLvFooterLoadingFrame = new FrameLayout(getContext());
mFooterLoadingView = createLoadingLayout(getContext(), Mode.PULL_FROM_END, a);
mFooterLoadingView.setVisibility(View.GONE);
mLvFooterLoadingFrame.addView(mFooterLoadingView, lp);
/**
* If the value for Scrolling While Refreshing hasn't been
* explicitly set via XML, enable Scrolling While Refreshing.
*/
if (!a.hasValue(R.styleable.PullToRefresh_ptrScrollingWhileRefreshingEnabled)) {
setScrollingWhileRefreshingEnabled(true);
}
}
}
use of android.widget.FrameLayout in project platform_frameworks_base by android.
the class ThinPatchesActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout layout = new FrameLayout(this);
PatchView b = new PatchView(this);
b.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
layout.addView(b);
layout.setBackgroundColor(0xffffffff);
setContentView(layout);
}
use of android.widget.FrameLayout in project platform_frameworks_base by android.
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 platform_frameworks_base by android.
the class ViewFlipperActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final LayoutInflater inflater = getLayoutInflater();
final View widget = inflater.inflate(R.layout.widget, null);
widget.setLayoutParams(new FrameLayout.LayoutParams(180, 180, Gravity.CENTER));
ViewFlipper flipper = (ViewFlipper) widget.findViewById(R.id.flipper);
View view = inflater.inflate(R.layout.flipper_item, flipper, false);
flipper.addView(view);
((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset1);
((TextView) view.findViewById(R.id.widget_text)).setText("This is a long line of text, " + "enjoy the wrapping and drawing");
view = inflater.inflate(R.layout.flipper_item, flipper, false);
flipper.addView(view);
((ImageView) view.findViewById(R.id.widget_image)).setImageResource(R.drawable.sunset3);
((TextView) view.findViewById(R.id.widget_text)).setText("Another very long line of text, " + "enjoy the wrapping and drawing");
FrameLayout layout = new FrameLayout(this);
layout.addView(widget);
setContentView(layout);
}
use of android.widget.FrameLayout in project platform_frameworks_base by android.
the class GetBitmapActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FrameLayout content = new FrameLayout(this);
mTextureView = new TextureView(this);
mTextureView.setSurfaceTextureListener(this);
Button button = new Button(this);
button.setText("Copy bitmap to /sdcard/textureview.png");
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bitmap b = mTextureView.getBitmap();
try {
FileOutputStream out = new FileOutputStream(Environment.getExternalStorageDirectory() + "/textureview.png");
try {
b.compress(Bitmap.CompressFormat.PNG, 100, out);
} finally {
try {
out.close();
} catch (IOException e) {
// Ignore
}
}
} catch (FileNotFoundException e) {
// Ignore
}
}
});
content.addView(mTextureView, new FrameLayout.LayoutParams(500, 400, Gravity.CENTER));
content.addView(button, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM));
setContentView(content);
}
Aggregations