Fix regulatory information dialog appearance
Bug 7081675 Replace RegulatoryInfoFragment with a custom preference so that the info shows up properly in a dialog. DialogFragments do not appear as dialogs when instantiated from preference XML files. Change-Id: Icbdf73bd5b1d14f28a01d7b9cb0f37d90340eb46
This commit is contained in:
@@ -14,6 +14,8 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:adjustViewBounds="true"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
android:src="@drawable/regulatory_info"/>
|
android:src="@drawable/regulatory_info"/>
|
||||||
|
@@ -89,9 +89,8 @@
|
|||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<Preference android:key="regulatory_info"
|
<com.android.settings.RegulatoryInfoPreference android:key="regulatory_info"
|
||||||
android:title="@string/regulatory_information"
|
android:title="@string/regulatory_information" />
|
||||||
android:fragment="com.android.settings.RegulatoryInfoFragment"/>
|
|
||||||
|
|
||||||
<!-- Device hardware model -->
|
<!-- Device hardware model -->
|
||||||
<Preference android:key="device_model"
|
<Preference android:key="device_model"
|
||||||
|
@@ -16,24 +16,19 @@
|
|||||||
|
|
||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
import android.app.DialogFragment;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.preference.DialogPreference;
|
||||||
import android.view.LayoutInflater;
|
import android.util.AttributeSet;
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import com.android.settings.R;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link DialogFragment} that displays regulatory information.
|
* {@link DialogPreference} that displays regulatory information. "About phone"
|
||||||
* "About phone" will show a preference that displays this fragment when
|
* will show a "Regulatory information" preference if
|
||||||
* clicked if R.bool.config_show_regulatory_info is true.
|
* R.bool.config_show_regulatory_info is true.
|
||||||
*/
|
*/
|
||||||
public class RegulatoryInfoFragment extends DialogFragment {
|
public class RegulatoryInfoPreference extends DialogPreference {
|
||||||
|
|
||||||
@Override
|
public RegulatoryInfoPreference(Context context, AttributeSet attrs) {
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
super(context, attrs, com.android.internal.R.attr.preferenceStyle);
|
||||||
Bundle savedInstanceState) {
|
setDialogLayoutResource(R.layout.regulatory_info);
|
||||||
return inflater.inflate(R.layout.regulatory_info, container, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user