FileDocCategorySizeDatePackage
Preference_Delegate.javaAPI DocAndroid 5.1 API3162Thu Mar 12 22:22:44 GMT 2015android.preference

Preference_Delegate

public class Preference_Delegate extends Object
Delegate that provides implementation for native methods in {@link Preference}

Through the layoutlib_create tool, selected methods of Preference have been replaced by calls to methods of the same name in this delegate class.

Fields Summary
Constructors Summary
Methods Summary
private static android.widget.ListViewcreateContainerView(android.content.Context context, android.view.ViewGroup root)

        TypedArray a = context.obtainStyledAttributes(null, R.styleable.PreferenceFragment,
                R.attr.preferenceFragmentStyle, 0);
        int mLayoutResId = a.getResourceId(R.styleable.PreferenceFragment_layout,
                        R.layout.preference_list_fragment);
        a.recycle();

        LayoutInflater inflater =
                (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(mLayoutResId, root, true);

        return (ListView) root.findViewById(android.R.id.list);
    
static android.view.ViewgetView(Preference pref, android.view.View convertView, android.view.ViewGroup parent)

        Context context = pref.getContext();
        BridgeContext bc = context instanceof BridgeContext ? ((BridgeContext) context) : null;
        convertView = pref.getView_Original(convertView, parent);
        if (bc != null) {
            Object cookie = bc.getCookie(pref);
            if (cookie != null) {
                bc.addViewKey(convertView, cookie);
            }
        }
        return convertView;
    
public static android.view.ViewinflatePreference(android.content.Context context, org.xmlpull.v1.XmlPullParser parser, android.view.ViewGroup root)
Inflates the parser and returns the ListView containing the Preferences.

        PreferenceManager pm = new PreferenceManager(context);
        PreferenceScreen ps = pm.getPreferenceScreen();
        PreferenceInflater inflater = new BridgePreferenceInflater(context, pm);
        ps = (PreferenceScreen) inflater.inflate(parser, ps, true);
        ListView preferenceView = createContainerView(context, root);
        ps.bind(preferenceView);
        return preferenceView;