Android recyclerview v.23.2.0 & design library v.23.2.0 are broken
P

2

31

After update to v23.2.0 recyclerview items have strange behavior: very big with empty space. After update to design library 23.2.0 menu overflow icon became black (app has dark action bar).

UPDATE On my nexus 5 overflow icon & recycler view row are fixed, but on Galaxy Tab 4 overflow icon is still black.

UPDATE 2 If you have problems with empty spacing, fix layout parameters for your views (match_parent -> wrap_content), cause RecyclerView will now size itself based on the size of its contents. Read this blog http://android-developers.blogspot.am/2016/02/android-support-library-232.html

The RecyclerView widget provides an advanced and flexible base for creating lists and grids as well as supporting animations. This release brings an exciting new feature to the LayoutManager API: auto-measurement! This allows a RecyclerView to size itself based on the size of its contents. This means that previously unavailable scenarios, such as using WRAP_CONTENT for a dimension of the RecyclerView, are now possible. You’ll find all built in LayoutManagers now support auto-measurement.

Due to this change, make sure to double check the layout parameters of your item views: previously ignored layout parameters (such as MATCH_PARENT in the scroll direction) will now be fully respected.

UPDATE 3 Link to the issue that describes the problem with black icons in Action Bar Issue 201918

UPDATE 4 See my answer under post, icons problem is also solved

Periwinkle answered 25/2, 2016 at 7:47 Comment(13)
Change your adapter xml file.Wixted
add some screen explain well because its worked as expected at our endQuirt
Plz update support v4 and appcompat to 23.2.Unstriped
@DhawalSodhaParmar Please see update.Periwinkle
@tinysunlight all libs are updatedPeriwinkle
@android_dev: yes there is issue. current solution is https://mcmap.net/q/128737/-how-to-change-toolbar-home-icon-color w'll find appropriate solution update and you soonQuirt
for overflow menu https://mcmap.net/q/296919/-custom-appcompat-theme-not-changing-overflow-icon-on-older-devicesQuirt
@DhawalSodhaParmar ok, thanks, but before update to 23.2.0 that worked finePeriwinkle
@Periwinkle what did you do to fix Recyclerview items with empty space??Bloodsucker
@Bloodsucker my layout root's height was set to match_parent, changed it to wrap_contentPeriwinkle
I also have problems... back arrow in toolbar became black with 23.2 and one of tablayouts is not showing tab names...Ethelethelbert
It was fixed with 23.2.1. We no longer need set vectorDrawables.useSupportLibrary = true.Woehick
@Woehick Thanks for info, will give it a try!Periwinkle
H
20

The reason you are getting large open spaces is because of match_parent. It wasn't working correctly before, but now with the new release it is working differently. You just need to update to wrap_content instead of match_parent as that causes the layout to match the parent giving you the large spaces.

The RecyclerView widget provides an advanced and flexible base for creating lists and grids as well as supporting animations. This release brings an exciting new feature to the LayoutManager API: auto-measurement! This allows a RecyclerView to size itself based on the size of its contents. This means that previously unavailable scenarios, such as using WRAP_CONTENT for a dimension of the RecyclerView, are now possible. You’ll find all built in LayoutManagers now support auto-measurement.

http://android-developers.blogspot.co.uk/2016/02/android-support-library-232.html

Highlands answered 25/2, 2016 at 12:26 Comment(8)
Thanks for info, I have already fixed that. See my comment under original question :)Periwinkle
I actually have a new problem with recyclerviews inside swiperefresh layouts. Scrolling up isn't possible as it tries to refresh. The fun of support library updates :/Highlands
I came across that too. It seems to be a regressive of a bug fixed in 23.1.1. Hopefully Google will update these libraries asap.Highlands
Also I had an issue with RecyclerView scrolling. Its solved by recyclerView.setNestedScrollingEnabled(false)`.Weintrob
@Weintrob Thanks for that comment. I don't find setNestedScrollingEnabled helps with my scrolling issue :/Highlands
@JamesBritton I had different issue than yours. Finally I solved it (https://mcmap.net/q/471818/-recyclerview-with-inside-nested-scrollview).Weintrob
I would like to note that I had to use wrap_content on the items layout of the RecyclerView. Not on the RecyclerView itself. This fixed my issue.Victor
@RadoslavYordanov that is what I was originally referring to, the items not the recyclerview.Highlands
P
1

It seems that two new libraries, support-vector-drawable and support-animated-vector-drawable, are required, because appcompat-v7 uses vector drawables (Issue discussion). Just update your build.gradle with the following for adding in support for vector drawables and the problem with black icons will be solved.

build.gradle

Add following lines to your build gradle base on your gradle plugin version

// Gradle Plugin 2.0+

 android {  
   defaultConfig {  
     vectorDrawables.useSupportLibrary = true  
    }  
 }   

// Gradle Plugin 1.5

 android {  
   defaultConfig {  
     generatedDensities = []  
  }  

  // This is handled for you by the 2.0+ Gradle Plugin  
  aaptOptions {  
    additionalParameters "--no-version-vectors"  
  }  
 } 

UPDATE For AppCompat users, the flags for enabling support vector drawables described in the 23.2 blog post are no longer required for usage of AppCompat 23.2.1. However, you can still take advantage of the app:srcCompat attribute if you wish to use support vector drawables for your own resources.

Periwinkle answered 1/3, 2016 at 6:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.