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

* commit '516035f0923aad612932327546e780c7c241ceda':
  Fix bug 5521467 - Monkeys and ActionBar custom tab views
This commit is contained in:
Adam Powell
2011-11-21 21:08:40 -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) {