Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ebcef6b8 authored by Alan Viverette's avatar Alan Viverette Committed by Adam Lesinski
Browse files

Update BridgeInflater and delegate to support inheritContext arg

Change-Id: I06673f35cd4625301677f74f3e6d49669df7c271
parent 9a9fa163
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -125,10 +125,11 @@ public final class BridgeInflater extends LayoutInflater {
    }

    @Override
    public View createViewFromTag(View parent, String name, AttributeSet attrs) {
    public View createViewFromTag(View parent, String name, AttributeSet attrs,
            boolean inheritContext) {
        View view = null;
        try {
            view = super.createViewFromTag(parent, name, attrs);
            view = super.createViewFromTag(parent, name, attrs, inheritContext);
        } catch (InflateException e) {
            // try to load the class from using the custom view loader
            try {
+11 −11
Original line number Diff line number Diff line
@@ -48,9 +48,9 @@ public class LayoutInflater_Delegate {
     * This implementation just records the merge status before calling the default implementation.
     */
    @LayoutlibDelegate
    /*package*/ static void rInflate(LayoutInflater thisInflater,
            XmlPullParser parser, View parent, final AttributeSet attrs,
            boolean finishInflate) throws XmlPullParserException, IOException {
    /* package */ static void rInflate(LayoutInflater thisInflater, XmlPullParser parser,
            View parent, final AttributeSet attrs, boolean finishInflate, boolean inheritContext)
            throws XmlPullParserException, IOException {

        if (finishInflate == false) {
            // this is a merge rInflate!
@@ -61,7 +61,7 @@ public class LayoutInflater_Delegate {

        // ---- START DEFAULT IMPLEMENTATION.

        thisInflater.rInflate_Original(parser, parent, attrs, finishInflate);
        thisInflater.rInflate_Original(parser, parent, attrs, finishInflate, inheritContext);

        // ---- END DEFAULT IMPLEMENTATION.

@@ -74,10 +74,8 @@ public class LayoutInflater_Delegate {
    }

    @LayoutlibDelegate
    public static void parseInclude(
            LayoutInflater thisInflater,
            XmlPullParser parser, View parent, AttributeSet attrs)
            throws XmlPullParserException, IOException {
    public static void parseInclude(LayoutInflater thisInflater, XmlPullParser parser, View parent,
            AttributeSet attrs, boolean inheritContext) throws XmlPullParserException, IOException {

        int type;

@@ -113,9 +111,11 @@ public class LayoutInflater_Delegate {

                    if (TAG_MERGE.equals(childName)) {
                        // Inflate all children.
                        thisInflater.rInflate(childParser, parent, childAttrs, false);
                        thisInflater.rInflate(childParser, parent, childAttrs, false,
                                inheritContext);
                    } else {
                        final View view = thisInflater.createViewFromTag(parent, childName, childAttrs);
                        final View view = thisInflater.createViewFromTag(parent, childName,
                                childAttrs, inheritContext);
                        final ViewGroup group = (ViewGroup) parent;

                        // We try to load the layout params set in the <include /> tag. If
@@ -151,7 +151,7 @@ public class LayoutInflater_Delegate {
                        }

                        // Inflate all children.
                        thisInflater.rInflate(childParser, view, childAttrs, true);
                        thisInflater.rInflate(childParser, view, childAttrs, true, true);

                        // Attempt to override the included layout's android:id with the
                        // one set on the <include /> tag itself.