Search in sources :

Example 31 with FrameLayout

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

Example 32 with FrameLayout

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

Example 33 with FrameLayout

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

Example 34 with FrameLayout

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);
}
Also used : ViewFlipper(android.widget.ViewFlipper) LayoutInflater(android.view.LayoutInflater) FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View)

Example 35 with FrameLayout

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);
}
Also used : Bitmap(android.graphics.Bitmap) Button(android.widget.Button) FrameLayout(android.widget.FrameLayout) FileOutputStream(java.io.FileOutputStream) FileNotFoundException(java.io.FileNotFoundException) TextureView(android.view.TextureView) IOException(java.io.IOException) TextureView(android.view.TextureView) View(android.view.View)

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