NavigationView Ripple Lost In Support Library 23.1.0 Update - android

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

Related

Theme.MaterialComponents.Light.NoActionBar theme affects rendering elements in constraint layout

I used Theme.MaterialComponents.Light.NoActionBar theme and it seems to be affecting constrained layout which is some of elements(such as buttons) can not see in the "Design and Blueprint". But they are appearing properly when the app is running.
I tried the following steps but no use.
1) Try to clean the project
2) Try to invalidate and restart Android Studio
3) Try Rebuilding the project
I tried adding Base key word but it seems to be wrong.
<style name="AppTheme" parent="Base.Theme.MaterialComponents.Light.NoActionBar">
I'm currently using the latest dependency which is 'com.google.android.material:material:1.1.0-alpha07'
It seems to be ok with early dependency such as 'com.google.android.material:material:1.0.0' but I'm wondering why it is not working with the latest releases.
I could use different theme which do not have material components and overcome this problem as well, but it is not what I'm expecting.
Your answers and comments are highly appreciated.
This issue is directly related to the version of material design. I used the latest version of android studio with latest version material design in the constraint layout. The same issue happened when I dropped a button from the palette to layout, it made the layout vanish and I changed the theme to the default, it also worked fine. But as u said, I should use material design. When I used latest material design version( com.google.android.material:material:1.7.0), it didn't work but when I used com.google.android.material:material:1.5.0, it worked fine. That's why u can change the version to find the one which is compatible and not buggy.

Material Transitions in pre lollipop apps

I am trying to use the transitions which introduced in material design in pre - lollipop apps(Min API19). I was going through http://www.google.com/design/spec/animation/meaningful-transitions.html#meaningful-transitions-visual-continuity transitions. But couldn't find how to do these transition mainly the second one on click of list item it expands the details. Can anybody help me to do this.
Thanks
You cannot use the "Material transitions" (or shared content animations) in pre-Lollipop versions, whether you're using Appcompat or not.
Check this link Custom animations

Ripple effect on custom navigation drawer

I'm developing my first app providing to it the new material look. I'm a bit lost with this so I'm following some tutorials to implement things like Toolbar, Navigation Drawer, etc. I have to say that I'm doing it providing compatibility to pre-lollipop android versions, so I'm using support libraries.
What concers to my question, is that I have just implemented the Navigation Drawer following one of this tutorials and using the following libraries for compatibility:
support.v4.widget.DrawerLayout
support.v7.widget.RecyclerView
I think that the code implementation is too long to put it here, so I'll provide the link to this tutorial, I have done it exactly as is said here.
My problem is that, when I select one item from the navigation drawer's row, it perfectly opens it correspondant frament, but, it doesn't show any ripple effect, or simply any touch effect, when touching it. Something like this:
I have taken a look to some other tutorials, for example, to the one to which belongs the attached gif, to see if they use any method or implementation to provide that efect to the touch, but nothing is implemented to get that effect, just the onclick method.
So, what's wrong with this code, and how could I modify it, or what could I add to get that effect?
As you are using appcompat you can add this to the XML for your navigation drawer item android:background="?attr/selectableItemBackground".
This should provide the ripple effect on Lollipop devices and a fallback grey highlight for older devices.

How to change the style of SwipeRefreshLayout (Material design to progress bar)

I had my project on Eclipse, and when I implemented the SwipeRefreshLayout it was showing the progress bar style. The problem is that I recently imported my project to Android Studio, and now the SwipeRefreshLayout is like Material Design style... so ugly in my opinion..
How can I change it now?
Have I to change the compilation version?
Thank you..
if you just want to showing the progress bar, not a Material Design style, just use the elder support v4. I think you can find the links, or you can download the jar, then copy to your libs.

SwipeRefreshLayout from support21 force to old style

I just updated the support library - and the new SwipeRefreshLayout is not my taste. Is there a way to get the old style back? There are still the setColor methods - which is kind of strange - they seem to have no use anmore. I really hope to have the old style I do not have to stick to the old library.
I actually had to do this as well - I needed the "Holo" SwipeRefreshLayout with the top horizontal line indicator as opposed to the pull-down-rotating-arrow indicator.
You can actually just reference an older version of the android support library in your project if you want the old SwipeRefreshLayout; e.g.
compile 'com.android.support:support-v4:21.0.+'
I'm not sure if version 21 is old enough; you might have to go back to 20. The caveat here is of course if you need functionality from one of the newer support library versions you won't have access to that functionality.

Categories

Resources