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

Commit bffd631a authored by Alan Viverette's avatar Alan Viverette
Browse files

Allow the framework to recycle ApnPreference views

BUG: 10079104
Change-Id: Iaa4f155da12a141f16300076cc820d47e0c5779a
parent 35bac199
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -241,4 +241,8 @@

    <!-- Scrollbar style OUTSIDE_OVERLAY -->
    <integer name="preference_scrollbar_style">33554432</integer>

    <style name="ApnPreference">
        <item name="android:layout">@layout/apn_preference_layout</item>
    </style>
</resources>
+2 −21
Original line number Diff line number Diff line
@@ -35,31 +35,16 @@ public class ApnPreference extends Preference implements
        CompoundButton.OnCheckedChangeListener, OnClickListener {
    final static String TAG = "ApnPreference";

    /**
     * @param context
     * @param attrs
     * @param defStyle
     */
    public ApnPreference(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init();
    }

    /**
     * @param context
     * @param attrs
     */
    public ApnPreference(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
        this(context, attrs, R.style.ApnPreference);
    }

    /**
     * @param context
     */
    public ApnPreference(Context context) {
        super(context);
        init();
        this(context, null);
    }

    private static String mSelectedKey = null;
@@ -99,10 +84,6 @@ public class ApnPreference extends Preference implements
        return view;
    }

    private void init() {
        setLayoutResource(R.layout.apn_preference_layout);
    }

    public boolean isChecked() {
        return getKey().equals(mSelectedKey);
    }