Merge "Move the action buttons in installed app detail page in the preference xml."
diff --git a/res/xml/installed_app_details_ia.xml b/res/xml/installed_app_details_ia.xml
index 5b9bdc7..3e06e39 100644
--- a/res/xml/installed_app_details_ia.xml
+++ b/res/xml/installed_app_details_ia.xml
@@ -23,6 +23,12 @@
android:selectable="false"
android:order="-10000"/>
+ <com.android.settings.applications.LayoutPreference
+ android:key="action_buttons"
+ android:layout="@layout/app_action_buttons"
+ android:selectable="false"
+ android:order="-9999"/>
+
<Preference
android:key="notification_settings"
android:title="@string/notifications_label"
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index 0bd56d9..da6bbc0 100755
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -147,7 +147,7 @@
private static final int DLG_SPECIAL_DISABLE = DLG_BASE + 3;
private static final String KEY_HEADER = "header_view";
- private static final String KEY_FOOTER = "header_footer";
+ private static final String KEY_ACTION_BUTTONS = "action_buttons";
private static final String KEY_NOTIFICATION = "notification_settings";
private static final String KEY_STORAGE = "storage_settings";
private static final String KEY_PERMISSION = "permission_settings";
@@ -164,7 +164,7 @@
private boolean mInitialized;
private boolean mShowUninstalled;
private LayoutPreference mHeader;
- private LayoutPreference mFooter;
+ private LayoutPreference mActionButtons;
private Button mUninstallButton;
private boolean mUpdatedSysApp = false;
private Button mForceStopButton;
@@ -331,10 +331,6 @@
setHasOptionsMenu(true);
addPreferencesFromResource(R.xml.installed_app_details_ia);
addDynamicPrefs();
- mFooter = new LayoutPreference(getPrefContext(), R.layout.app_action_buttons);
- mFooter.setOrder(-9999);
- mFooter.setKey(KEY_FOOTER);
- getPreferenceScreen().addPreference(mFooter);
if (Utils.isBandwidthControlEnabled()) {
INetworkStatsService statsService = INetworkStatsService.Stub.asInterface(
ServiceManager.getService(Context.NETWORK_STATS_SERVICE));
@@ -393,6 +389,7 @@
}
final Activity activity = getActivity();
mHeader = (LayoutPreference) findPreference(KEY_HEADER);
+ mActionButtons = (LayoutPreference) findPreference(KEY_ACTION_BUTTONS);
FeatureFactory.getFactory(activity)
.getApplicationFeatureProvider(activity)
.newAppHeaderController(this, mHeader.findViewById(R.id.app_snippet))
@@ -455,9 +452,9 @@
}
private void prepareUninstallAndStop() {
- mForceStopButton = (Button) mFooter.findViewById(R.id.right_button);
+ mForceStopButton = (Button) mActionButtons.findViewById(R.id.right_button);
mForceStopButton.setText(R.string.force_stop);
- mUninstallButton = (Button) mFooter.findViewById(R.id.left_button);
+ mUninstallButton = (Button) mActionButtons.findViewById(R.id.left_button);
mForceStopButton.setEnabled(false);
}