NavigationView Ripple Lost In Support Library 23.1.0 Update

纵然是瞬间 提交于 2019-12-30 06:48:09

问题


Using the Design Support Library version 23.0.1, menu items within the NavigationView appear to, by the default, support the ripple animation when selected. However, when upgraded to Design Support Library version 23.1.0 the ripple animation appears to be lost. Is this a bug? Has anyone else noticed this as well and can replicate it? And, better yet, does anyone have a solution?

I first discovered this issue while utilizing the NavigationView via Design Support Library version 23.4.0 and noticed a lack of the ripple effect on menu items. However, it wasn't until I followed this NavigationView tutorial, provided by AndroidForDevs, that I was able to place blame on Design Support Library version 23.1.0.

To replicate and reproduce the issue, checkout this tutorial's sample code, which utilizes Design Support Library version 22.2.0, and bump the version to 23.1.0 in the app's build.gradle. You'll then notice the menu items do not ripple when selected. However, if you revert back to version 22.2.0 or 23.0.1 you'll notice the items ripple when selected.

For reference, here is a link to the Support Library change log. While it mentions an update allowing for custom views within the NavigationView I can't think of why this might have led to the removal of the ripple effect by default as it sounds unrelated. Here is change description word-for-word

Added support for custom views to the NavigationView class by using the app:actionLayout attribute or MenuItemCompat.setActionView() method.

Note: This issue is most easily visualized when the drawer is prevented from closing when a menu item is selected. This can be achieved by commenting this line

来源:https://stackoverflow.com/questions/37796870/navigationview-ripple-lost-in-support-library-23-1-0-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!