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/DeviceInfoSettings.java | |
parent | 3a9cf0363618bfadeaa5df2460fa615922bd8c75 (diff) | |
download | packages_apps_Settings-d79934731c8d33f6fc63b21c120b9ffba5d06f54.tar.gz packages_apps_Settings-d79934731c8d33f6fc63b21c120b9ffba5d06f54.tar.bz2 packages_apps_Settings-d79934731c8d33f6fc63b21c120b9ffba5d06f54.zip |
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/DeviceInfoSettings.java')
-rw-r--r-- | src/com/android/settings/DeviceInfoSettings.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java index a2c22ab9e..7f9433879 100644 --- a/src/com/android/settings/DeviceInfoSettings.java +++ b/src/com/android/settings/DeviceInfoSettings.java @@ -16,16 +16,15 @@ package com.android.settings; +import android.app.Activity; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.os.SystemProperties; import android.preference.Preference; -import android.preference.PreferenceActivity; import android.preference.PreferenceGroup; import android.preference.PreferenceScreen; import android.util.Log; -import android.view.MotionEvent; import java.io.BufferedReader; import java.io.FileReader; @@ -33,7 +32,7 @@ import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; -public class DeviceInfoSettings extends PreferenceActivity { +public class DeviceInfoSettings extends SettingsPreferenceFragment { private static final String TAG = "DeviceInfoSettings"; private static final String KEY_CONTAINER = "container"; @@ -46,7 +45,7 @@ public class DeviceInfoSettings extends PreferenceActivity { private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal"; @Override - protected void onCreate(Bundle icicle) { + public void onCreate(Bundle icicle) { super.onCreate(icicle); addPreferencesFromResource(R.xml.device_info_settings); @@ -66,24 +65,24 @@ public class DeviceInfoSettings extends PreferenceActivity { * Settings is a generic app and should not contain any device-specific * info. */ - + final Activity act = getActivity(); // These are contained in the "container" preference group PreferenceGroup parentPreference = (PreferenceGroup) findPreference(KEY_CONTAINER); - Utils.updatePreferenceToSpecificActivityOrRemove(this, parentPreference, KEY_TERMS, + Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_TERMS, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY); - Utils.updatePreferenceToSpecificActivityOrRemove(this, parentPreference, KEY_LICENSE, + Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_LICENSE, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY); - Utils.updatePreferenceToSpecificActivityOrRemove(this, parentPreference, KEY_COPYRIGHT, + Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_COPYRIGHT, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY); - Utils.updatePreferenceToSpecificActivityOrRemove(this, parentPreference, KEY_TEAM, + Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_TEAM, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY); // These are contained by the root preference screen parentPreference = getPreferenceScreen(); - Utils.updatePreferenceToSpecificActivityOrRemove(this, parentPreference, + Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_SYSTEM_UPDATE_SETTINGS, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY); - Utils.updatePreferenceToSpecificActivityOrRemove(this, parentPreference, KEY_CONTRIBUTORS, + Utils.updatePreferenceToSpecificActivityOrRemove(act, parentPreference, KEY_CONTRIBUTORS, Utils.UPDATE_PREFERENCE_FLAG_SET_TITLE_TO_MATCHING_ACTIVITY); } |