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