From 8a2a0e7320a2f61fb37669ff0e3228f593fd6d25 Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Fri, 15 Oct 2010 15:49:40 -0400 Subject: Change the back button to INVISIBLE instead of GONE. The problem with setting it to GONE is that it does not get measured when determining the height. This means that if a crumb cannot go back and the back button is removed as a result, the BreadCrumbView will change its height, resulting in some jumpiness. Change-Id: I62b32dfb0b0b72fe462bf9ec8413372786c414ab --- src/com/android/browser/BreadCrumbView.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/com/android/browser') diff --git a/src/com/android/browser/BreadCrumbView.java b/src/com/android/browser/BreadCrumbView.java index 8e3acf7..e501703 100644 --- a/src/com/android/browser/BreadCrumbView.java +++ b/src/com/android/browser/BreadCrumbView.java @@ -146,7 +146,7 @@ public class BreadCrumbView extends LinearLayout implements OnClickListener { mBackButton.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT)); mBackButton.setOnClickListener(this); - mBackButton.setVisibility(View.GONE); + mBackButton.setVisibility(View.INVISIBLE); addView(mBackButton, 0); } @@ -157,7 +157,7 @@ public class BreadCrumbView extends LinearLayout implements OnClickListener { mCrumbs.add(crumb); addView(crumb.crumbView); if (mUseBackButton) { - mBackButton.setVisibility(crumb.canGoBack ? View.VISIBLE : View.GONE); + mBackButton.setVisibility(crumb.canGoBack ? View.VISIBLE : View.INVISIBLE); } crumb.crumbView.setOnClickListener(this); } @@ -181,10 +181,10 @@ public class BreadCrumbView extends LinearLayout implements OnClickListener { mCrumbs.remove(n - 1); if (mUseBackButton) { Crumb top = getTopCrumb(); - if (top != null) { - mBackButton.setVisibility(top.canGoBack ? View.VISIBLE : View.GONE); + if (top != null && top.canGoBack) { + mBackButton.setVisibility(View.VISIBLE); } else { - mBackButton.setVisibility(View.GONE); + mBackButton.setVisibility(View.INVISIBLE); } } if (notify) { -- cgit v1.1