diff options
Diffstat (limited to 'core/java/android/preference')
-rw-r--r-- | core/java/android/preference/PreferenceActivity.java | 21 | ||||
-rw-r--r-- | core/java/android/preference/PreferenceFrameLayout.java | 6 |
2 files changed, 14 insertions, 13 deletions
diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java index aedbfca..6172ce9 100644 --- a/core/java/android/preference/PreferenceActivity.java +++ b/core/java/android/preference/PreferenceActivity.java @@ -171,7 +171,7 @@ public abstract class PreferenceActivity extends ListActivity implements private FrameLayout mListFooter; - private View mPrefsContainer; + private ViewGroup mPrefsContainer; private FragmentBreadCrumbs mFragmentBreadCrumbs; @@ -491,7 +491,7 @@ public abstract class PreferenceActivity extends ListActivity implements setContentView(com.android.internal.R.layout.preference_list_content); mListFooter = (FrameLayout)findViewById(com.android.internal.R.id.list_footer); - mPrefsContainer = findViewById(com.android.internal.R.id.prefs); + mPrefsContainer = (ViewGroup) findViewById(com.android.internal.R.id.prefs_frame); boolean hidingHeaders = onIsHidingHeaders(); mSinglePane = hidingHeaders || !onIsMultiPane(); String initialFragment = getIntent().getStringExtra(EXTRA_SHOW_FRAGMENT); @@ -559,7 +559,7 @@ public abstract class PreferenceActivity extends ListActivity implements // of preferences" mode. setContentView(com.android.internal.R.layout.preference_list_content_single); mListFooter = (FrameLayout) findViewById(com.android.internal.R.id.list_footer); - mPrefsContainer = findViewById(com.android.internal.R.id.prefs); + mPrefsContainer = (ViewGroup) findViewById(com.android.internal.R.id.prefs); mPreferenceManager = new PreferenceManager(this, FIRST_REQUEST_CODE); mPreferenceManager.setOnPreferenceTreeClickListener(this); } @@ -990,13 +990,16 @@ public abstract class PreferenceActivity extends ListActivity implements */ public void showBreadCrumbs(CharSequence title, CharSequence shortTitle) { if (mFragmentBreadCrumbs == null) { - mFragmentBreadCrumbs = new FragmentBreadCrumbs(this); - mFragmentBreadCrumbs.setActivity(this); - - ActionBar actionBar = getActionBar(); - if (actionBar != null) { - actionBar.setCustomNavigationMode(mFragmentBreadCrumbs); + mFragmentBreadCrumbs = (FragmentBreadCrumbs) findViewById(android.R.id.title); + if (mFragmentBreadCrumbs == null) { + mFragmentBreadCrumbs = new FragmentBreadCrumbs(this); + ActionBar actionBar = getActionBar(); + if (actionBar != null) { + actionBar.setCustomNavigationMode(mFragmentBreadCrumbs); + } } + mFragmentBreadCrumbs.setMaxVisible(2); + mFragmentBreadCrumbs.setActivity(this); } mFragmentBreadCrumbs.setTitle(title, shortTitle); } diff --git a/core/java/android/preference/PreferenceFrameLayout.java b/core/java/android/preference/PreferenceFrameLayout.java index 4c737b5..75372aa 100644 --- a/core/java/android/preference/PreferenceFrameLayout.java +++ b/core/java/android/preference/PreferenceFrameLayout.java @@ -16,13 +16,12 @@ package android.preference; +import android.app.FragmentBreadCrumbs; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.view.View; -import android.view.ViewGroup.MarginLayoutParams; import android.widget.FrameLayout; -import android.widget.FrameLayout.LayoutParams; /** * @hide @@ -36,7 +35,7 @@ public class PreferenceFrameLayout extends FrameLayout { private final int mBorderBottom; private final int mBorderLeft; private final int mBorderRight; - private boolean mPaddingApplied = false; + private boolean mPaddingApplied; public PreferenceFrameLayout(Context context) { this(context, null); @@ -70,7 +69,6 @@ public class PreferenceFrameLayout extends FrameLayout { com.android.internal.R.styleable.PreferenceFrameLayout_borderRight, defaultRightPadding); - a.recycle(); } |