Use a different wallpaper fragment title from the preference item.

Change wallpaper list ordering to alphabetic.
Display battery level and charging status in Battery settings.

Change-Id: I8ead0fb0f018c79ed258bd1c1ca3f8ecaf32da83
This commit is contained in:
Amith Yamasani
2011-07-22 10:34:58 -07:00
parent 8374a2db64
commit a4379d6b38
9 changed files with 98 additions and 53 deletions

View File

@@ -23,7 +23,9 @@ import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceFragment;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
@@ -534,6 +536,17 @@ public class Settings extends PreferenceActivity implements ButtonBarHandler {
}
}
@Override
public boolean onPreferenceStartFragment(PreferenceFragment caller, Preference pref) {
// Override the fragment title for Wallpaper settings
CharSequence title = pref.getTitle();
if (pref.getFragment().equals(WallpaperTypeSettings.class.getName())) {
title = getString(R.string.wallpaper_settings_fragment_title);
}
startPreferencePanel(pref.getFragment(), pref.getExtras(), 0, title, null, 0);
return true;
}
@Override
public void setListAdapter(ListAdapter adapter) {
if (mHeaders == null) {