summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-06-18 07:11:06 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-06-18 07:11:06 -0700
commit36c153f84f2728ffc67b7f30a1f326a7731c2088 (patch)
tree16b44a89cc508df012ecde309ff681fa7838431a
parentc14b9ccdf13163cae5ce5d21bcf377010b37594b (diff)
parentca74c90cf5c15f648abca77e12a91e1ce2b435e4 (diff)
downloadframeworks_base-36c153f84f2728ffc67b7f30a1f326a7731c2088.zip
frameworks_base-36c153f84f2728ffc67b7f30a1f326a7731c2088.tar.gz
frameworks_base-36c153f84f2728ffc67b7f30a1f326a7731c2088.tar.bz2
Merge change 4535 into donut
* changes: Add title to nested preference screens.
-rw-r--r--core/java/android/preference/PreferenceScreen.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/java/android/preference/PreferenceScreen.java b/core/java/android/preference/PreferenceScreen.java
index 5353b53..6ea2528 100644
--- a/core/java/android/preference/PreferenceScreen.java
+++ b/core/java/android/preference/PreferenceScreen.java
@@ -22,6 +22,7 @@ import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
+import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Adapter;
@@ -147,13 +148,20 @@ public final class PreferenceScreen extends PreferenceGroup implements AdapterVi
ListView listView = new ListView(context);
bind(listView);
- Dialog dialog = mDialog = new Dialog(context, com.android.internal.R.style.Theme_NoTitleBar);
+ // Set the title bar if title is available, else no title bar
+ final CharSequence title = getTitle();
+ Dialog dialog = mDialog = new Dialog(context, !TextUtils.isEmpty(title)
+ ? com.android.internal.R.style.Theme_NoTitleBar
+ : com.android.internal.R.style.Theme);
dialog.setContentView(listView);
+ if (!TextUtils.isEmpty(title)) {
+ dialog.setTitle(title);
+ }
dialog.setOnDismissListener(this);
if (state != null) {
dialog.onRestoreInstanceState(state);
}
-
+
// Add the screen to the list of preferences screens opened as dialogs
getPreferenceManager().addPreferencesScreen(dialog);