Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Finally I found the solution. </p> <ol> <li><code>setOverscrollFooter(null)</code> and <code>setOverscrollHeader(null)</code> does not work. At least on 2.3.*. Setting attributes from *.xml doesn't help too. </li> <li><code>setOverScrollMode(View.OVER_SCROLL_NEVER)</code> causes glitchy scrolling. At least on 2.3.*. </li> </ol> <p>The only solution that really works involves the use of Java Reflection. It works even with ugly custom Samsung listviews with bounce overscroll effect. Here is a snippet:</p> <pre><code>@Override protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) { //onOverScrolled method must be overrided, or we will see the background of the listview when overscroll fast. } private void removeOverscrollEffect() { try { Class&lt;?&gt; superClass = getClass().getSuperclass().getSuperclass(); Field field = superClass.getDeclaredField("mEdgeGlowTop"); field.setAccessible(true); Object edgeGlowTop = field.get(this); if (edgeGlowTop != null) { Class&lt;? extends Object&gt; edgeClass = edgeGlowTop.getClass(); Field edgeDrawable = edgeClass.getDeclaredField("mEdge"); edgeDrawable.setAccessible(true); edgeDrawable.set(edgeGlowTop, new ColorDrawable(Color.TRANSPARENT)); Field glowDrawable = edgeClass.getDeclaredField("mGlow"); glowDrawable.setAccessible(true); glowDrawable.set(edgeGlowTop, new ColorDrawable(Color.TRANSPARENT)); field.set(this, edgeGlowTop); } Field fieldBottom = superClass.getDeclaredField("mEdgeGlowBottom"); fieldBottom.setAccessible(true); Object edgeGlowBottom = fieldBottom.get(this); if (edgeGlowBottom != null) { Class&lt;? extends Object&gt; edgeClassBottom = edgeGlowBottom.getClass(); Field edgeDrawableBottom = edgeClassBottom.getDeclaredField("mEdge"); edgeDrawableBottom.setAccessible(true); edgeDrawableBottom.set(edgeGlowBottom, new ColorDrawable(Color.TRANSPARENT)); Field glowDrawableBottom = edgeClassBottom.getDeclaredField("mGlow"); glowDrawableBottom.setAccessible(true); glowDrawableBottom.set(edgeGlowBottom, new ColorDrawable(Color.TRANSPARENT)); fieldBottom.set(this, edgeGlowBottom); } } catch (Exception e) { Log.e(TAG, e.getMessage()); } } </code></pre> <p>I hope this helps. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload