Search in sources :

Example 6 with LayoutInflater

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);
}
Also used : LayoutInflater(org.holoeverywhere.LayoutInflater)

Example 7 with LayoutInflater

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;
}
Also used : ViewGroup(android.view.ViewGroup) LayoutInflater(org.holoeverywhere.LayoutInflater) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View)

Example 8 with LayoutInflater

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();
}
Also used : Context(android.content.Context) Dialog(org.holoeverywhere.app.Dialog) LayoutInflater(org.holoeverywhere.LayoutInflater) ActionBarView(com.actionbarsherlock.internal.widget.ActionBarView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(org.holoeverywhere.widget.ListView) SuppressLint(android.annotation.SuppressLint) SuppressLint(android.annotation.SuppressLint)

Example 9 with LayoutInflater

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;
}
Also used : ViewGroup(android.view.ViewGroup) LayoutInflater(org.holoeverywhere.LayoutInflater) ArrayList(java.util.ArrayList) List(java.util.List)

Example 10 with LayoutInflater

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");
    }
}
Also used : ViewParent(android.view.ViewParent) ViewGroup(android.view.ViewGroup) LayoutInflater(org.holoeverywhere.LayoutInflater) View(android.view.View)

Aggregations

LayoutInflater (org.holoeverywhere.LayoutInflater)15 View (android.view.View)8 ViewGroup (android.view.ViewGroup)6 ImageView (android.widget.ImageView)3 TextView (android.widget.TextView)3 SuppressLint (android.annotation.SuppressLint)2 LinearLayout (org.holoeverywhere.widget.LinearLayout)2 Context (android.content.Context)1 ActionMenuPresenter (android.support.v7.internal.view.menu.ActionMenuPresenter)1 ActionMenuView (android.support.v7.internal.view.menu.ActionMenuView)1 MenuBuilder (android.support.v7.internal.view.menu.MenuBuilder)1 ActionBarView (android.support.v7.internal.widget.ActionBarView)1 MenuItem (android.view.MenuItem)1 ViewParent (android.view.ViewParent)1 AdapterView (android.widget.AdapterView)1 LayoutParams (android.widget.LinearLayout.LayoutParams)1 ActionBarView (com.actionbarsherlock.internal.widget.ActionBarView)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Dialog (org.holoeverywhere.app.Dialog)1