use of org.holoeverywhere.LayoutInflater in project HoloEverywhere by Prototik.
the class ActionBarActivityDelegateBase method setContentView.
@Override
public void setContentView(int resId) {
ensureSubDecor();
if (mHasActionBar) {
final ViewGroup contentParent = (ViewGroup) mActivity.findViewById(R.id.action_bar_activity_content);
contentParent.removeAllViews();
final LayoutInflater inflater = LayoutInflater.from(mActivity);
inflater.inflate(resId, contentParent);
} else {
mActivity.superSetContentView(resId);
}
}
use of org.holoeverywhere.LayoutInflater in project HoloEverywhere by Prototik.
the class Preference method onCreateView.
protected View onCreateView(ViewGroup parent) {
final LayoutInflater layoutInflater = LayoutInflater.from(mContext);
final View layout = layoutInflater.inflate(mLayoutResId, parent, false);
final ViewGroup widgetFrame = (ViewGroup) layout.findViewById(R.id.widget_frame);
if (widgetFrame != null) {
if (mWidgetLayoutResId != 0) {
layoutInflater.inflate(mWidgetLayoutResId, widgetFrame);
} else {
widgetFrame.setVisibility(View.GONE);
}
}
return layout;
}
use of org.holoeverywhere.LayoutInflater in project HoloEverywhere by Prototik.
the class ActionBarView method initTitle.
private void initTitle() {
if (mTitleLayout == null) {
LayoutInflater inflater = LayoutInflater.from(getContext());
mTitleLayout = (LinearLayout) inflater.inflate(R.layout.abc_action_bar_title_item, this, false);
mTitleView = (TextView) mTitleLayout.findViewById(R.id.action_bar_title);
mSubtitleView = (TextView) mTitleLayout.findViewById(R.id.action_bar_subtitle);
mTitleUpView = (View) mTitleLayout.findViewById(R.id.up);
mTitleLayout.setOnClickListener(mUpClickListener);
if (mTitleStyleRes != 0) {
mTitleView.setTextAppearance(mContext, mTitleStyleRes);
}
if (mTitle != null) {
mTitleView.setText(mTitle);
}
if (mSubtitleStyleRes != 0) {
mSubtitleView.setTextAppearance(mContext, mSubtitleStyleRes);
}
if (mSubtitle != null) {
mSubtitleView.setText(mSubtitle);
mSubtitleView.setVisibility(VISIBLE);
}
final boolean homeAsUp = (mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0;
final boolean showHome = (mDisplayOptions & ActionBar.DISPLAY_SHOW_HOME) != 0;
mTitleUpView.setVisibility(!showHome ? (homeAsUp ? VISIBLE : INVISIBLE) : GONE);
mTitleLayout.setEnabled(homeAsUp && !showHome);
}
addView(mTitleLayout);
if (mExpandedActionView != null || (TextUtils.isEmpty(mTitle) && TextUtils.isEmpty(mSubtitle))) {
// Don't show while in expanded mode or with empty text
mTitleLayout.setVisibility(GONE);
}
}
use of org.holoeverywhere.LayoutInflater in project mobile-android by photo.
the class ImageFlowUtils method getSingleImageView.
protected View getSingleImageView(View convertView, T value, int imageHeight, int extraWidth, int layoutId, int imageViewId, Context context) {
View view;
ViewHolder viewHolder;
if (convertView == null) {
// if it's not recycled, instantiate and
// initialize
CommonUtils.debug(TAG, "Creating new view for child");
final LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = layoutInflater.inflate(layoutId, null);
viewHolder = creatViewHolder(view);
viewHolder.mImageView = (ImageView) view.findViewById(imageViewId);
view.setTag(viewHolder);
} else {
// Otherwise re-use the converted view
view = convertView;
viewHolder = (ViewHolder) view.getTag();
}
float ratio = getRatio(value);
int height = imageHeight;
int width = (int) (ratio * height) + extraWidth;
CommonUtils.debug(TAG, "getSingleImageView: processing image: " + value + "; Width: " + getWidth(value) + "; Height: " + getHeight(value) + "; Extra width: " + extraWidth + "; Req Width: " + width + "; Req Height: " + height);
width = width + 2 * borderSize;
height = height + 2 * borderSize;
LinearLayout.LayoutParams layoutParams = (LayoutParams) view.getLayoutParams();
if (layoutParams == null || layoutParams.width != width || layoutParams.height != height) {
layoutParams = new LinearLayout.LayoutParams(width, height);
view.setLayoutParams(layoutParams);
}
additionalSingleImageViewInit(view, value);
ImageView imageView = viewHolder.mImageView;
// Finally load the image asynchronously into the ImageView, this
// also takes care of
// setting a placeholder image while the background thread runs
loadImage(value, imageView);
return view;
}
use of org.holoeverywhere.LayoutInflater in project little-bear-dictionary by daimajia.
the class HoloListMenuItemView method insertIconView.
private void insertIconView() {
LayoutInflater inflater = getInflater();
mIconView = (ImageView) inflater.inflate(R.layout.list_menu_item_icon, this, false);
addView(mIconView, 0);
}
Aggregations