use of org.holoeverywhere.widget.FrameLayout in project HoloEverywhere by Prototik.
the class MenuPopupHelper method measureContentWidth.
private int measureContentWidth(ListAdapter adapter) {
// Menus don't tend to be long, so this is more sane than it looks.
int width = 0;
View itemView = null;
int itemType = 0;
final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
final int heightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
final int count = adapter.getCount();
for (int i = 0; i < count; i++) {
final int positionType = adapter.getItemViewType(i);
if (positionType != itemType) {
itemType = positionType;
itemView = null;
}
if (mMeasureParent == null) {
mMeasureParent = new FrameLayout(mContext);
}
itemView = adapter.getView(i, itemView, mMeasureParent);
itemView.measure(widthMeasureSpec, heightMeasureSpec);
width = Math.max(width, itemView.getMeasuredWidth());
}
return width;
}
use of org.holoeverywhere.widget.FrameLayout in project HoloEverywhere by Prototik.
the class ActionBarActivityDelegateBase method getListMenuView.
private MenuView getListMenuView(Context context, MenuPresenter.Callback cb) {
if (mMenu == null) {
return null;
}
if (mListMenuPresenter == null) {
TypedArray a = context.obtainStyledAttributes(R.styleable.Theme);
final int listPresenterTheme = a.getResourceId(R.styleable.Theme_panelMenuListTheme, R.style.Theme_AppCompat_CompactMenu);
a.recycle();
mListMenuPresenter = new ListMenuPresenter(R.layout.abc_list_menu_item_layout, listPresenterTheme);
mListMenuPresenter.setCallback(cb);
mMenu.addMenuPresenter(mListMenuPresenter);
} else {
// Make sure we update the ListView
mListMenuPresenter.updateMenuView(false);
}
return mListMenuPresenter.getMenuView(new FrameLayout(context));
}
use of org.holoeverywhere.widget.FrameLayout in project little-bear-dictionary by daimajia.
the class PopupMenuHelper method measureContentWidth.
private int measureContentWidth(ListAdapter adapter) {
int width = 0;
View itemView = null;
int itemType = 0;
final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
final int heightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
final int count = adapter.getCount();
for (int i = 0; i < count; i++) {
final int positionType = adapter.getItemViewType(i);
if (positionType != itemType) {
itemType = positionType;
itemView = null;
}
if (mMeasureParent == null) {
mMeasureParent = new FrameLayout(mContext);
}
itemView = adapter.getView(i, itemView, mMeasureParent);
itemView.measure(widthMeasureSpec, heightMeasureSpec);
width = Math.max(width, itemView.getMeasuredWidth());
}
return width;
}
Aggregations