use of org.holoeverywhere.LayoutInflater in project little-bear-dictionary by daimajia.
the class HoloListMenuItemView method insertRadioButton.
private void insertRadioButton() {
LayoutInflater inflater = getInflater();
mRadioButton = (RadioButton) inflater.inflate(R.layout.list_menu_item_radio, this, false);
addView(mRadioButton);
}
use of org.holoeverywhere.LayoutInflater in project little-bear-dictionary by daimajia.
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 little-bear-dictionary by daimajia.
the class PreferenceScreen method showDialog.
@SuppressLint("NewApi")
private void showDialog(Bundle state) {
Context context = getContext();
if (mListView != null) {
mListView.setAdapter(null);
}
final int theme = getThemeResId(context);
LayoutInflater inflater = LayoutInflater.from(context);
View childPrefScreen = inflater.inflate(R.layout.preference_list_fragment, null);
mListView = (ListView) childPrefScreen.findViewById(android.R.id.list);
bind(mListView);
final CharSequence title = getTitle();
final boolean titleEmpty = TextUtils.isEmpty(title);
Dialog dialog = mDialog = new PreferenceDialog(theme);
if (titleEmpty) {
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
} else {
if (VERSION.SDK_INT >= 11) {
dialog.requestWindowFeature(Window.FEATURE_ACTION_BAR);
}
dialog.setContentView(childPrefScreen);
dialog.setTitle(title);
}
dialog.setOnDismissListener(this);
if (state != null) {
dialog.onRestoreInstanceState(state);
}
getPreferenceManager().addPreferencesScreen(dialog);
dialog.show();
}
use of org.holoeverywhere.LayoutInflater in project mobile-android by photo.
the class ImageFlowUtils method getView.
/**
* General get view method which builds the one single line of images
*
* @param position
* @param convertView
* @param parent
* @param lineLayoutId
* @param childLayoutId
* @param imageViewId
* @param context
* @return
*/
public View getView(int position, View convertView, ViewGroup parent, int lineLayoutId, int childLayoutId, int imageViewId, Context context) {
ViewGroup view;
CommonUtils.debug(TAG, "getView: called for position %1$d", position);
if (convertView == null) {
// if it's not recycled, instantiate and
// initialize
final LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = (ViewGroup) layoutInflater.inflate(lineLayoutId, null);
} else {
// Otherwise re-use the converted view
view = (ViewGroup) convertView;
}
int childCount = view.getChildCount();
List<T> values = (List<T>) getGroupItem(position);
addOrReuseChilds(view, childCount, values, childLayoutId, imageViewId, context);
removeUnusedViews(imageViewId, view, values, childCount);
return view;
}
use of org.holoeverywhere.LayoutInflater in project HoloEverywhere by Prototik.
the class ViewStubHolo method inflate.
public View inflate() {
final ViewParent viewParent = getParent();
if (viewParent != null && viewParent instanceof ViewGroup) {
if (mLayoutResource != 0) {
final ViewGroup parent = (ViewGroup) viewParent;
final LayoutInflater factory;
if (mInflater != null) {
factory = mInflater;
} else {
factory = LayoutInflater.from(getContext());
}
final View view = factory.inflate(mLayoutResource, parent, false);
if (mInflatedId != NO_ID) {
view.setId(mInflatedId);
}
final int index = parent.indexOfChild(this);
parent.removeViewInLayout(this);
final ViewGroup.LayoutParams layoutParams = getLayoutParams();
if (layoutParams != null) {
parent.addView(view, index, layoutParams);
} else {
parent.addView(view, index);
}
mInflatedViewRef = new WeakReference<View>(view);
if (mInflateListener != null) {
mInflateListener.onInflate(this, view);
}
return view;
} else {
throw new IllegalArgumentException("ViewStubHolo must have a valid layoutResource");
}
} else {
throw new IllegalStateException("ViewStubHolo must have a non-null ViewGroup viewParent");
}
}
Aggregations