Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android marshmallow listview scrolling gets blurry

I have an android application which is running on production for several years. Lately, I have discovered a problem with a ListView in the app, that gets blurry while scrolling. The problem only occurs under Android Marshmallow.

Here is a screenshot of the ListView while scrolling

enter image description here

Any help would be much appreciated.

Thanks!

like image 583
Moshe Ventura Avatar asked Jul 02 '16 18:07

Moshe Ventura


1 Answers

Preface: I posted a separate answer prior to this one, but that solution only worked on my MotoX. I later discovered it did not work for my Galaxy Tab A. The answer here seems to be more universal:

I was able to fix my scrolling blur by defining a separate ListView style for my application and specifying a different list divider. So, for my application theme I set this:

<item name="android:listViewStyle">@style/ListViewStyleNoBlur</item>

Where ListViewStyleNoBlur is defined as:

<style name="ListViewStyleNoBlur" parent="@android:style/Widget.ListView.White">
    <item name="android:divider">@android:drawable/divider_horizontal_bright</item>
</style>

I specified these in a values-v23 resources folder so the change doesn't affect pre-Marshmallow devices.

My application theme is based off of android:style/Theme.Light, which is why my list view style's parent is android:style/Widget.ListView.White. My app min SDK is 8, which is why I'm using such an "old" theme. I also noticed that if I use a "newer" theme, such as Holo, the blur does not exist.

like image 162
pathfinderelite Avatar answered Oct 27 '22 15:10

pathfinderelite