зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1366648 - Fix reload button color problem r=sebastian
configuration: Nexus 5 + Android Hammerhead 5.1.1 LMY48M In CustomTabsActivity, the menu reload-button use a LevelListDrawable. On some configurations, icon's state won't be set to Enabled by system, hence the color of icon is incorrect. We have to enable it manually. MozReview-Commit-ID: JB9t35OyatY --HG-- extra : rebase_source : e0750f6b76ea25a6abcb5d1375aa1468522f0da4
This commit is contained in:
Родитель
e582e5f680
Коммит
f0fad4d644
|
@ -409,6 +409,12 @@ public class CustomTabsActivity extends SingleTabActivity implements Tabs.OnTabs
|
|||
}
|
||||
|
||||
menuItemControl = geckoMenu.findItem(R.id.custom_tabs_menu_control);
|
||||
// on some configurations(ie. Android 5.1.1 + Nexus 5), no idea why the state not be enabled
|
||||
// if the Drawable is a LevelListDrawable, then the icon color is incorrect.
|
||||
final Drawable icon = menuItemControl.getIcon();
|
||||
if (icon != null && !icon.isStateful()) {
|
||||
icon.setState(new int[]{android.R.attr.state_enabled});
|
||||
}
|
||||
|
||||
geckoMenu.addFooterView(
|
||||
getLayoutInflater().inflate(R.layout.customtabs_options_menu_footer, geckoMenu, false),
|
||||
|
|
Загрузка…
Ссылка в новой задаче