diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-18 07:13:49 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-06-18 07:13:49 -0700 |
commit | 3fa058a5a97096632e14024aeca5e36d3dd95f02 (patch) | |
tree | 7ba36a68217b249539f243652139b98d26c419dd /core/java/android/preference | |
parent | abb01dba70fa52b3576fa9f6a175f3840b959fde (diff) | |
parent | 36c153f84f2728ffc67b7f30a1f326a7731c2088 (diff) | |
download | frameworks_base-3fa058a5a97096632e14024aeca5e36d3dd95f02.zip frameworks_base-3fa058a5a97096632e14024aeca5e36d3dd95f02.tar.gz frameworks_base-3fa058a5a97096632e14024aeca5e36d3dd95f02.tar.bz2 |
am 36c153f8: Merge change 4535 into donut
Merge commit '36c153f84f2728ffc67b7f30a1f326a7731c2088'
* commit '36c153f84f2728ffc67b7f30a1f326a7731c2088':
Add title to nested preference screens.
Diffstat (limited to 'core/java/android/preference')
-rw-r--r-- | core/java/android/preference/PreferenceScreen.java | 12 |
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); |