Make file build pass after copy it to another path.
1. androidx.core.content.res.TypedArrayUtils is not available in
another path, remove it from dependency.
2. Sync the xml with androidx preference_material.xml
Bug: 138618679
Test: build pass
Change-Id: I11df0ccab1289e83bc96cf9778ba58623714db54
diff --git a/packages/SettingsLib/RadioButtonPreference/res/layout/preference_radio.xml b/packages/SettingsLib/RadioButtonPreference/res/layout/preference_radio.xml
index dcb014d..b4b4c63 100644
--- a/packages/SettingsLib/RadioButtonPreference/res/layout/preference_radio.xml
+++ b/packages/SettingsLib/RadioButtonPreference/res/layout/preference_radio.xml
@@ -65,7 +65,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
- android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead"
+ android:textAppearance="?android:attr/textAppearanceListItem"
android:ellipsize="marquee"
android:fadingEdge="horizontal"/>
@@ -79,7 +79,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
+ android:textAppearance="?android:attr/textAppearanceSmall"
android:textAlignment="viewStart"
android:textColor="?android:attr/textColorSecondary"/>
@@ -88,7 +88,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:textAppearance="@android:style/TextAppearance.DeviceDefault.Small"
+ android:textAppearance="?android:attr/textAppearanceSmall"
android:textAlignment="viewEnd"
android:textColor="?android:attr/textColorSecondary"
android:maxLines="1"
diff --git a/packages/SettingsLib/RadioButtonPreference/src/com/android/settingslib/widget/RadioButtonPreference.java b/packages/SettingsLib/RadioButtonPreference/src/com/android/settingslib/widget/RadioButtonPreference.java
index 08287ac..05e008c 100644
--- a/packages/SettingsLib/RadioButtonPreference/src/com/android/settingslib/widget/RadioButtonPreference.java
+++ b/packages/SettingsLib/RadioButtonPreference/src/com/android/settingslib/widget/RadioButtonPreference.java
@@ -22,7 +22,6 @@
import android.view.View;
import android.widget.TextView;
-import androidx.core.content.res.TypedArrayUtils;
import androidx.preference.CheckBoxPreference;
import androidx.preference.PreferenceViewHolder;
@@ -58,32 +57,29 @@
/**
* Perform inflation from XML and apply a class-specific base style.
*
- * @param context The {@link Context} this is associated with, through which it can
- * access the current theme, resources, {@link SharedPreferences}, etc.
- * @param attrs The attributes of the XML tag that is inflating the preference
- * @param defStyleAttr An attribute in the current theme that contains a reference to a style
- * resource that supplies default values for the view. Can be 0 to not
- * look for defaults.
+ * @param context The {@link Context} this is associated with, through which it can
+ * access the current theme, resources, {@link SharedPreferences}, etc.
+ * @param attrs The attributes of the XML tag that is inflating the preference
+ * @param defStyle An attribute in the current theme that contains a reference to a style
+ * resource that supplies default values for the view. Can be 0 to not
+ * look for defaults.
*/
public RadioButtonPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
- setWidgetLayoutResource(R.layout.preference_widget_radiobutton);
- setLayoutResource(R.layout.preference_radio);
- setIconSpaceReserved(false);
+ init();
}
/**
* Perform inflation from XML and apply a class-specific base style.
*
- * @param context The {@link Context} this is associated with, through which it can
- * access the current theme, resources, {@link SharedPreferences}, etc.
- * @param attrs The attributes of the XML tag that is inflating the preference
+ * @param context The {@link Context} this is associated with, through which it can
+ * access the current theme, resources, {@link SharedPreferences}, etc.
+ * @param attrs The attributes of the XML tag that is inflating the preference
*/
public RadioButtonPreference(Context context, AttributeSet attrs) {
- this(context, attrs, TypedArrayUtils.getAttr(context,
- androidx.preference.R.attr.preferenceStyle,
- android.R.attr.preferenceStyle));
+ super(context, attrs);
+ init();
}
/**
@@ -158,4 +154,10 @@
}
mAppendixVisibility = visibility;
}
+
+ private void init() {
+ setWidgetLayoutResource(R.layout.preference_widget_radiobutton);
+ setLayoutResource(R.layout.preference_radio);
+ setIconSpaceReserved(false);
+ }
}