Allow the framework to recycle ApnPreference views
BUG: 10079104 Change-Id: Iaa4f155da12a141f16300076cc820d47e0c5779a
This commit is contained in:
@@ -241,4 +241,8 @@
|
|||||||
|
|
||||||
<!-- Scrollbar style OUTSIDE_OVERLAY -->
|
<!-- Scrollbar style OUTSIDE_OVERLAY -->
|
||||||
<integer name="preference_scrollbar_style">33554432</integer>
|
<integer name="preference_scrollbar_style">33554432</integer>
|
||||||
|
|
||||||
|
<style name="ApnPreference">
|
||||||
|
<item name="android:layout">@layout/apn_preference_layout</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -35,31 +35,16 @@ public class ApnPreference extends Preference implements
|
|||||||
CompoundButton.OnCheckedChangeListener, OnClickListener {
|
CompoundButton.OnCheckedChangeListener, OnClickListener {
|
||||||
final static String TAG = "ApnPreference";
|
final static String TAG = "ApnPreference";
|
||||||
|
|
||||||
/**
|
|
||||||
* @param context
|
|
||||||
* @param attrs
|
|
||||||
* @param defStyle
|
|
||||||
*/
|
|
||||||
public ApnPreference(Context context, AttributeSet attrs, int defStyle) {
|
public ApnPreference(Context context, AttributeSet attrs, int defStyle) {
|
||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param context
|
|
||||||
* @param attrs
|
|
||||||
*/
|
|
||||||
public ApnPreference(Context context, AttributeSet attrs) {
|
public ApnPreference(Context context, AttributeSet attrs) {
|
||||||
super(context, attrs);
|
this(context, attrs, R.style.ApnPreference);
|
||||||
init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param context
|
|
||||||
*/
|
|
||||||
public ApnPreference(Context context) {
|
public ApnPreference(Context context) {
|
||||||
super(context);
|
this(context, null);
|
||||||
init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String mSelectedKey = null;
|
private static String mSelectedKey = null;
|
||||||
@@ -99,10 +84,6 @@ public class ApnPreference extends Preference implements
|
|||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
|
||||||
setLayoutResource(R.layout.apn_preference_layout);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isChecked() {
|
public boolean isChecked() {
|
||||||
return getKey().equals(mSelectedKey);
|
return getKey().equals(mSelectedKey);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user