List of usage examples for android.widget GridView smoothScrollBy
public void smoothScrollBy(int distance, int duration)
From source file:Main.java
public static boolean gridViewSmoothScrollCaculate(int position, int beforepostion, int[] beforeFirstAndLastVible, boolean isGridViewUp, int popHeight, GridView movieGv) { boolean isSameContent = position >= beforeFirstAndLastVible[0] && position <= beforeFirstAndLastVible[1]; if (position >= 5 && !isSameContent) { if (beforepostion >= beforeFirstAndLastVible[0] && beforepostion <= beforeFirstAndLastVible[0] + 4) { if (isGridViewUp) { movieGv.smoothScrollBy(-popHeight, 1000); return true; }/*from ww w. j a v a2s . c om*/ } else { if (!isGridViewUp) { movieGv.smoothScrollBy(popHeight, 1000 * 2); return true; } } } return false; }