Skip to content

Commit 07a047f

Browse files
committed
Fix bug 5220390 - action bar title metrics
Adjust action bar title layout metrics to match UX specs. Refresh new metrics properly after a config change. Change-Id: If19fad837ca2919193d4a3a8eb01c1caff68ca67
1 parent e7197a9 commit 07a047f

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

core/java/com/android/internal/widget/ActionBarView.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,17 @@ protected void onConfigurationChanged(Configuration newConfig) {
266266
if (mActionMenuPresenter != null) {
267267
mActionMenuPresenter.onConfigurationChanged(newConfig);
268268
}
269+
270+
mTitleView = null;
271+
mSubtitleView = null;
272+
mTitleUpView = null;
273+
if (mTitleLayout != null && mTitleLayout.getParent() == this) {
274+
removeView(mTitleLayout);
275+
}
276+
mTitleLayout = null;
277+
if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
278+
initTitle();
279+
}
269280
}
270281

271282
@Override

core/res/res/layout/action_bar_title_item.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
1818
android:layout_width="wrap_content"
19-
android:layout_height="match_parent"
19+
android:layout_height="wrap_content"
2020
android:orientation="horizontal"
2121
android:paddingRight="16dip"
2222
android:background="?android:attr/actionBarItemBackground"
@@ -41,6 +41,8 @@
4141
<TextView android:id="@+id/action_bar_subtitle"
4242
android:layout_width="wrap_content"
4343
android:layout_height="wrap_content"
44+
android:layout_marginTop="@dimen/action_bar_subtitle_top_margin"
45+
android:layout_marginBottom="@dimen/action_bar_subtitle_bottom_margin"
4446
android:singleLine="true"
4547
android:ellipsize="end"
4648
android:visibility="gone" />

core/res/res/values-land/dimens.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
<dimen name="action_bar_title_text_size">16dp</dimen>
3636
<!-- Text size for action bar subtitles -->
3737
<dimen name="action_bar_subtitle_text_size">12dp</dimen>
38+
<!-- Top margin for action bar subtitles -->
39+
<dimen name="action_bar_subtitle_top_margin">-2dp</dimen>
40+
<!-- Bottom margin for action bar subtitles -->
41+
<dimen name="action_bar_subtitle_bottom_margin">4dip</dimen>
3842

3943
<!-- Size of clock font in LockScreen on Unsecure unlock screen. -->
4044
<dimen name="keyguard_lockscreen_clock_font_size">70sp</dimen>

core/res/res/values-sw600dp/dimens.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
<dimen name="action_bar_title_text_size">18dp</dimen>
3838
<!-- Text size for action bar subtitles -->
3939
<dimen name="action_bar_subtitle_text_size">14dp</dimen>
40+
<!-- Top margin for action bar subtitles -->
41+
<dimen name="action_bar_subtitle_top_margin">-3dp</dimen>
42+
<!-- Bottom margin for action bar subtitles -->
43+
<dimen name="action_bar_subtitle_bottom_margin">9dip</dimen>
4044

4145
<!-- Size of clock font in LockScreen. -->
4246
<dimen name="keyguard_pattern_unlock_clock_font_size">98sp</dimen>

core/res/res/values/dimens.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@
146146
<dimen name="action_bar_title_text_size">18dp</dimen>
147147
<!-- Text size for action bar subtitles -->
148148
<dimen name="action_bar_subtitle_text_size">14dp</dimen>
149+
<!-- Top margin for action bar subtitles -->
150+
<dimen name="action_bar_subtitle_top_margin">-3dp</dimen>
151+
<!-- Bottom margin for action bar subtitles -->
152+
<dimen name="action_bar_subtitle_bottom_margin">5dip</dimen>
149153

150154
<!-- Size of clock font in LockScreen on Unsecure unlock screen. -->
151155
<dimen name="keyguard_lockscreen_clock_font_size">80sp</dimen>

0 commit comments

Comments
 (0)