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

Cœur
  • 37,241
  • 25
  • 195
  • 267
android_dev
  • 3,886
  • 1
  • 33
  • 52

2 Answers2

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

James Britton
  • 412
  • 4
  • 13
  • 1
    Thanks for info, I have already fixed that. See my comment under original question :) – android_dev Feb 25 '16 at 12:50
  • 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 :/ – James Britton Feb 25 '16 at 13:32
  • 1
    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. – James Britton Feb 28 '16 at 22:24
  • Also I had an issue with `RecyclerView` scrolling. It`s solved by `recyclerView.setNestedScrollingEnabled(false)`. – mixel Mar 05 '16 at 17:28
  • @mixel Thanks for that comment. I don't find setNestedScrollingEnabled helps with my scrolling issue :/ – James Britton Mar 07 '16 at 12:47
  • @JamesBritton I had different issue than yours. Finally I solved it (http://stackoverflow.com/a/35865822/746347). – mixel Mar 08 '16 at 11:15
  • 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. – Radoslav Yordanov Apr 08 '16 at 16:50
  • @RadoslavYordanov that is what I was originally referring to, the items not the recyclerview. – James Britton Apr 13 '16 at 14:08
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.

android_dev
  • 3,886
  • 1
  • 33
  • 52