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:
@@ -184,16 +184,18 @@ public class SettingsBaseActivity extends FragmentActivity {
|
|||||||
public void setTitle(CharSequence title) {
|
public void setTitle(CharSequence title) {
|
||||||
if (mCollapsingToolbarLayout != null) {
|
if (mCollapsingToolbarLayout != null) {
|
||||||
mCollapsingToolbarLayout.setTitle(title);
|
mCollapsingToolbarLayout.setTitle(title);
|
||||||
|
} else {
|
||||||
|
super.setTitle(title);
|
||||||
}
|
}
|
||||||
super.setTitle(title);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTitle(int titleId) {
|
public void setTitle(int titleId) {
|
||||||
if (mCollapsingToolbarLayout != null) {
|
if (mCollapsingToolbarLayout != null) {
|
||||||
mCollapsingToolbarLayout.setTitle(getText(titleId));
|
mCollapsingToolbarLayout.setTitle(getText(titleId));
|
||||||
|
} else {
|
||||||
|
super.setTitle(titleId);
|
||||||
}
|
}
|
||||||
super.setTitle(titleId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user