Merge change 9035 into donut
* changes: Fix the TabWidget to display custom views for the tabs better when the tabs have different sizes.
This commit is contained in:
@@ -277,7 +277,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
|
||||
if (child.getLayoutParams() == null) {
|
||||
final LinearLayout.LayoutParams lp = new LayoutParams(
|
||||
0,
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT, 1);
|
||||
ViewGroup.LayoutParams.FILL_PARENT, 1.0f);
|
||||
lp.setMargins(0, 0, 0, 0);
|
||||
child.setLayoutParams(lp);
|
||||
}
|
||||
@@ -289,10 +289,10 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener {
|
||||
// If we have dividers between the tabs and we already have at least one
|
||||
// tab, then add a divider before adding the next tab.
|
||||
if (mDividerDrawable != null && getTabCount() > 0) {
|
||||
View divider = new View(mContext);
|
||||
ImageView divider = new ImageView(mContext);
|
||||
final LinearLayout.LayoutParams lp = new LayoutParams(
|
||||
mDividerDrawable.getIntrinsicWidth(),
|
||||
mDividerDrawable.getIntrinsicHeight());
|
||||
LayoutParams.FILL_PARENT);
|
||||
lp.setMargins(0, 0, 0, 0);
|
||||
divider.setLayoutParams(lp);
|
||||
divider.setBackgroundDrawable(mDividerDrawable);
|
||||
|
||||
Reference in New Issue
Block a user