am fb0784da: Merge "Fix bug 5521467 - Monkeys and ActionBar custom tab views" into ics-mr1

* commit 'fb0784da5f602bf6410ef914d625c3cedfa11e9f':
  Fix bug 5521467 - Monkeys and ActionBar custom tab views
This commit is contained in:
Adam Powell
2011-11-21 17:36:20 -08:00
committed by Android Git Automerger

View File

@@ -29,6 +29,7 @@ import android.text.TextUtils.TruncateAt;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.animation.DecelerateInterpolator;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
@@ -392,7 +393,11 @@ public class ScrollingTabContainerView extends HorizontalScrollView
final ActionBar.Tab tab = mTab;
final View custom = tab.getCustomView();
if (custom != null) {
addView(custom);
final ViewParent customParent = custom.getParent();
if (customParent != this) {
if (customParent != null) ((ViewGroup) customParent).removeView(custom);
addView(custom);
}
mCustomView = custom;
if (mTextView != null) mTextView.setVisibility(GONE);
if (mIconView != null) {