Prevent app bar title from drawing twice

Sometimes we could see a flick problem with app bar title. It appears to
draw the app bar title twice. This CL is to prevent app bar title from
rendering twice.

Bug: 182232144
Test: robotests and visual verified
1) Open Settings app
2) Click on any entrypoint
3) Observe and see if there's a flick problem on app bar title

Change-Id: I9f5b7cdd163f20dd7f85cf2f83b9ef01a473dd3c
This commit is contained in:
Mill Chen
2021-03-09 15:10:22 +08:00
parent 50527b1f63
commit db5ca4ee1a

View File

@@ -184,16 +184,18 @@ public class SettingsBaseActivity extends FragmentActivity {
public void setTitle(CharSequence title) {
if (mCollapsingToolbarLayout != null) {
mCollapsingToolbarLayout.setTitle(title);
} else {
super.setTitle(title);
}
super.setTitle(title);
}
@Override
public void setTitle(int titleId) {
if (mCollapsingToolbarLayout != null) {
mCollapsingToolbarLayout.setTitle(getText(titleId));
} else {
super.setTitle(titleId);
}
super.setTitle(titleId);
}
/**