diff options
author | Amith Yamasani <yamasani@google.com> | 2010-08-18 13:59:28 -0700 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2010-08-18 22:59:33 -0700 |
commit | d79934731c8d33f6fc63b21c120b9ffba5d06f54 (patch) | |
tree | 2edb1cb461f5933faf26bdffc5522d9e00f9b808 /src/com/android/settings/ApplicationSettings.java | |
parent | 3a9cf0363618bfadeaa5df2460fa615922bd8c75 (diff) | |
download | packages_apps_settings-d79934731c8d33f6fc63b21c120b9ffba5d06f54.zip packages_apps_settings-d79934731c8d33f6fc63b21c120b9ffba5d06f54.tar.gz packages_apps_settings-d79934731c8d33f6fc63b21c120b9ffba5d06f54.tar.bz2 |
Refactor settings top level activities to use fragments.
Added a base class SettingsPreferenceFragment from which the settings activities should
be derived so that they can behave like fragments. It contains some commonly called
utility methods and dialog conversion to DialogFragment.
Some of the top-level activities can be launched directly without the left pane.
Settings.java acts as a proxy activity that contains just that settings fragment without
the left pane.
There are still a lot of second and third level activities that need to be fragmentized.
This is just the first pass to test the 2-pane layout.
Diffstat (limited to 'src/com/android/settings/ApplicationSettings.java')
-rw-r--r-- | src/com/android/settings/ApplicationSettings.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/settings/ApplicationSettings.java b/src/com/android/settings/ApplicationSettings.java index a919ae8..ed7c7a0 100644 --- a/src/com/android/settings/ApplicationSettings.java +++ b/src/com/android/settings/ApplicationSettings.java @@ -23,12 +23,11 @@ import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.Preference; -import android.preference.PreferenceActivity; import android.preference.PreferenceScreen; import android.preference.Preference.OnPreferenceChangeListener; import android.provider.Settings; -public class ApplicationSettings extends PreferenceActivity implements +public class ApplicationSettings extends SettingsPreferenceFragment implements DialogInterface.OnClickListener { private static final String KEY_TOGGLE_INSTALL_APPLICATIONS = "toggle_install_applications"; @@ -51,7 +50,7 @@ public class ApplicationSettings extends PreferenceActivity implements private DialogInterface mWarnInstallApps; @Override - protected void onCreate(Bundle icicle) { + public void onCreate(Bundle icicle) { super.onCreate(icicle); addPreferencesFromResource(R.xml.application_settings); @@ -102,7 +101,7 @@ public class ApplicationSettings extends PreferenceActivity implements } @Override - protected void onDestroy() { + public void onDestroy() { super.onDestroy(); if (mWarnInstallApps != null) { mWarnInstallApps.dismiss(); @@ -157,8 +156,9 @@ public class ApplicationSettings extends PreferenceActivity implements } private void warnAppInstallation() { - mWarnInstallApps = new AlertDialog.Builder(this) - .setTitle(getString(R.string.error_title)) + // TODO: DialogFragment? + mWarnInstallApps = new AlertDialog.Builder(getActivity()).setTitle( + getResources().getString(R.string.error_title)) .setIcon(com.android.internal.R.drawable.ic_dialog_alert) .setMessage(getResources().getString(R.string.install_all_warning)) .setPositiveButton(android.R.string.yes, this) |