am a6ce0819: Merge "Fix bug 3381275 - Too much padding on the left of a custom nav bar" into honeycomb
* commit 'a6ce081970a78233ba6b9792149ee5f1390cba7b': Fix bug 3381275 - Too much padding on the left of a custom nav bar
This commit is contained in:
@@ -30,6 +30,7 @@ import android.content.pm.PackageManager;
|
|||||||
import android.content.pm.PackageManager.NameNotFoundException;
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.text.TextUtils.TruncateAt;
|
import android.text.TextUtils.TruncateAt;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@@ -351,6 +352,8 @@ public class ActionBarView extends ViewGroup {
|
|||||||
mTitle = title;
|
mTitle = title;
|
||||||
if (mTitleView != null) {
|
if (mTitleView != null) {
|
||||||
mTitleView.setText(title);
|
mTitleView.setText(title);
|
||||||
|
mTitleLayout.setVisibility(TextUtils.isEmpty(mTitle) && TextUtils.isEmpty(mSubtitle) ?
|
||||||
|
GONE : VISIBLE);
|
||||||
}
|
}
|
||||||
if (mLogoNavItem != null) {
|
if (mLogoNavItem != null) {
|
||||||
mLogoNavItem.setTitle(title);
|
mLogoNavItem.setTitle(title);
|
||||||
@@ -366,6 +369,8 @@ public class ActionBarView extends ViewGroup {
|
|||||||
if (mSubtitleView != null) {
|
if (mSubtitleView != null) {
|
||||||
mSubtitleView.setText(subtitle);
|
mSubtitleView.setText(subtitle);
|
||||||
mSubtitleView.setVisibility(subtitle != null ? VISIBLE : GONE);
|
mSubtitleView.setVisibility(subtitle != null ? VISIBLE : GONE);
|
||||||
|
mTitleLayout.setVisibility(TextUtils.isEmpty(mTitle) && TextUtils.isEmpty(mSubtitle) ?
|
||||||
|
GONE : VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -636,7 +641,7 @@ public class ActionBarView extends ViewGroup {
|
|||||||
rightOfCenter -= mMenuView.getMeasuredWidth();
|
rightOfCenter -= mMenuView.getMeasuredWidth();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean showTitle = mTitleLayout != null &&
|
boolean showTitle = mTitleLayout != null && mTitleLayout.getVisibility() != GONE &&
|
||||||
(mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0;
|
(mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0;
|
||||||
if (showTitle) {
|
if (showTitle) {
|
||||||
availableWidth = measureChildView(mTitleLayout, availableWidth, childSpecHeight, 0);
|
availableWidth = measureChildView(mTitleLayout, availableWidth, childSpecHeight, 0);
|
||||||
@@ -768,7 +773,7 @@ public class ActionBarView extends ViewGroup {
|
|||||||
x += positionChild(mHomeLayout, x, y, contentHeight);
|
x += positionChild(mHomeLayout, x, y, contentHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean showTitle = mTitleLayout != null &&
|
final boolean showTitle = mTitleLayout != null && mTitleLayout.getVisibility() != GONE &&
|
||||||
(mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0;
|
(mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0;
|
||||||
if (showTitle) {
|
if (showTitle) {
|
||||||
x += positionChild(mTitleLayout, x, y, contentHeight);
|
x += positionChild(mTitleLayout, x, y, contentHeight);
|
||||||
|
|||||||
Reference in New Issue
Block a user