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.
This commit is contained in:
Amith Yamasani
2010-08-18 13:59:28 -07:00
parent 3a9cf03636
commit d79934731c
31 changed files with 1088 additions and 338 deletions

View File

@@ -31,7 +31,6 @@ import android.content.res.XmlResourceParser;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceCategory;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
@@ -49,7 +48,7 @@ import java.util.List;
/**
* Settings screen for voice input/output.
*/
public class VoiceInputOutputSettings extends PreferenceActivity
public class VoiceInputOutputSettings extends SettingsPreferenceFragment
implements OnPreferenceChangeListener {
private static final String TAG = "VoiceInputOutputSettings";
@@ -67,7 +66,7 @@ public class VoiceInputOutputSettings extends PreferenceActivity
private HashMap<String, ResolveInfo> mAvailableRecognizersMap;
@Override
protected void onCreate(Bundle icicle) {
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.voice_input_output_settings);