Merge "Fix bug 5521467 - Monkeys and ActionBar custom tab views" into ics-mr1
This commit is contained in:
@@ -29,6 +29,7 @@ import android.text.TextUtils.TruncateAt;
|
|||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.ViewParent;
|
||||||
import android.view.animation.DecelerateInterpolator;
|
import android.view.animation.DecelerateInterpolator;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.BaseAdapter;
|
import android.widget.BaseAdapter;
|
||||||
@@ -392,7 +393,11 @@ public class ScrollingTabContainerView extends HorizontalScrollView
|
|||||||
final ActionBar.Tab tab = mTab;
|
final ActionBar.Tab tab = mTab;
|
||||||
final View custom = tab.getCustomView();
|
final View custom = tab.getCustomView();
|
||||||
if (custom != null) {
|
if (custom != null) {
|
||||||
|
final ViewParent customParent = custom.getParent();
|
||||||
|
if (customParent != this) {
|
||||||
|
if (customParent != null) ((ViewGroup) customParent).removeView(custom);
|
||||||
addView(custom);
|
addView(custom);
|
||||||
|
}
|
||||||
mCustomView = custom;
|
mCustomView = custom;
|
||||||
if (mTextView != null) mTextView.setVisibility(GONE);
|
if (mTextView != null) mTextView.setVisibility(GONE);
|
||||||
if (mIconView != null) {
|
if (mIconView != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user