Search in sources :

Example 6 with LayoutInflater

use of android.view.LayoutInflater in project cw-advandroid by commonsguy.

the class ConstantsBrowser method add.

private void add() {
    LayoutInflater inflater = LayoutInflater.from(this);
    View addView = inflater.inflate(R.layout.add_edit, null);
    final DialogWrapper wrapper = new DialogWrapper(addView);
    new AlertDialog.Builder(this).setTitle(R.string.add_title).setView(addView).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
            processAdd(wrapper);
        }
    }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
        // ignore, just dismiss
        }
    }).show();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) LayoutInflater(android.view.LayoutInflater) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 7 with LayoutInflater

use of android.view.LayoutInflater in project cw-advandroid by commonsguy.

the class ContactsDemoBaseTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    LayoutInflater inflater = LayoutInflater.from(getContext());
    root = (ViewGroup) inflater.inflate(R.layout.main, null);
    root.measure(480, 320);
    root.layout(0, 0, 480, 320);
    list = (ListView) root.findViewById(android.R.id.list);
    spinner = (Spinner) root.findViewById(R.id.spinner);
}
Also used : LayoutInflater(android.view.LayoutInflater)

Example 8 with LayoutInflater

use of android.view.LayoutInflater in project cw-omnibus by commonsguy.

the class ConstantsBrowser method add.

private void add() {
    LayoutInflater inflater = LayoutInflater.from(this);
    View addView = inflater.inflate(R.layout.add_edit, null);
    final DialogWrapper wrapper = new DialogWrapper(addView);
    new AlertDialog.Builder(this).setTitle(R.string.add_title).setView(addView).setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
            processAdd(wrapper);
        }
    }).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
        // ignore,
        // just
        // dismiss
        }
    }).show();
}
Also used : AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) LayoutInflater(android.view.LayoutInflater) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 9 with LayoutInflater

use of android.view.LayoutInflater in project cw-omnibus by commonsguy.

the class ActionBarContextView method initForMode.

public void initForMode(final ActionMode mode) {
    if (mClose == null) {
        LayoutInflater inflater = LayoutInflater.from(mContext);
        mClose = (NineLinearLayout) inflater.inflate(R.layout.abs__action_mode_close_item, this, false);
        addView(mClose);
    } else if (mClose.getParent() == null) {
        addView(mClose);
    }
    View closeButton = mClose.findViewById(R.id.abs__action_mode_close_button);
    closeButton.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            mode.finish();
        }
    });
    final MenuBuilder menu = (MenuBuilder) mode.getMenu();
    if (mActionMenuPresenter != null) {
        mActionMenuPresenter.dismissPopupMenus();
    }
    mActionMenuPresenter = new ActionMenuPresenter(mContext);
    mActionMenuPresenter.setReserveOverflow(true);
    final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
    if (!mSplitActionBar) {
        menu.addMenuPresenter(mActionMenuPresenter);
        mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
        mMenuView.setBackgroundDrawable(null);
        addView(mMenuView, layoutParams);
    } else {
        // Allow full screen width in split mode.
        mActionMenuPresenter.setWidthLimit(getContext().getResources().getDisplayMetrics().widthPixels, true);
        // No limit to the item count; use whatever will fit.
        mActionMenuPresenter.setItemLimit(Integer.MAX_VALUE);
        // Span the whole width
        layoutParams.width = LayoutParams.MATCH_PARENT;
        layoutParams.height = mContentHeight;
        menu.addMenuPresenter(mActionMenuPresenter);
        mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
        mMenuView.setBackgroundDrawable(mSplitBackground);
        mSplitView.addView(mMenuView, layoutParams);
    }
    mAnimateInOnLayout = true;
}
Also used : LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) ActionMenuView(com.actionbarsherlock.internal.view.menu.ActionMenuView) View(android.view.View) MenuBuilder(com.actionbarsherlock.internal.view.menu.MenuBuilder) ActionMenuPresenter(com.actionbarsherlock.internal.view.menu.ActionMenuPresenter)

Example 10 with LayoutInflater

use of android.view.LayoutInflater in project cw-omnibus by commonsguy.

the class ListMenuItemView method insertCheckBox.

private void insertCheckBox() {
    LayoutInflater inflater = getInflater();
    mCheckBox = (CheckBox) inflater.inflate(R.layout.abs__list_menu_item_checkbox, this, false);
    addView(mCheckBox);
}
Also used : LayoutInflater(android.view.LayoutInflater)

Aggregations

LayoutInflater (android.view.LayoutInflater)1227 View (android.view.View)743 TextView (android.widget.TextView)570 ImageView (android.widget.ImageView)242 ViewGroup (android.view.ViewGroup)127 Context (android.content.Context)123 ListView (android.widget.ListView)115 LinearLayout (android.widget.LinearLayout)102 AdapterView (android.widget.AdapterView)94 RecyclerView (android.support.v7.widget.RecyclerView)87 Intent (android.content.Intent)81 DialogInterface (android.content.DialogInterface)74 AlertDialog (android.app.AlertDialog)71 FrameLayout (android.widget.FrameLayout)48 TypedArray (android.content.res.TypedArray)43 OnClickListener (android.view.View.OnClickListener)40 Button (android.widget.Button)40 Bundle (android.os.Bundle)39 Activity (android.app.Activity)38 AlertDialog (android.support.v7.app.AlertDialog)37