Take the 2-minute tour ×

I'm using android coverflow, and it works fine on most of devices, but it seems that in Android 4.0.3 it does not put the center image back to the center once that you slide back and forth.

They remain "stuck" and under the wrong angle.

Did anyone had similar issues? What could cause this behavior?

So middle image on the attached image should be centered and not angled as it is.

CowerFlow Issue

share|improve this question

3 Answers 3

I just added



final int childCenter = getCenterOfView(child); in getChildStaticTransformation(View child, Transformation t) 

so it becomes

protected boolean getChildStaticTransformation(View child, Transformation t) {

    final int childCenter = getCenterOfView(child);
    final int childWidth = child.getWidth();
    int rotationAngle = 0;
share|improve this answer
This also solves the problem of non rotating image views. Thanks. –  Gunhan Nov 26 '13 at 12:24
I wish I can +1 more than once. fast solution (y) 1st search, 1st search result and from 1st code edit. Worked. –  hasan83 Dec 19 '13 at 10:38
Is there a better way then call "invalidate()". In my Coverflow there are already a bunch of Images and thus its hurting my performance. –  ggm Mar 14 at 21:38

Are you using Neil Davies Coverflow Widget V2?

If yes, I found out the problem. If no, I am sorry, I can't help you.

The problem is in the function getCenterOfView. More accurate, it is a problem about view.getLeft(). <-- please tell me if anyone know why it is different after 4.0

The value return from view.getLeft() is different at every time. So this will affect another function getChildStaticTransformation, it can't find which imageview is the center.

My solution, a dirty fix, is give a range for it to detect its center.

if (childCenter <= mCoveflowCenter + 125
            && childCenter >= mCoveflowCenter - 125) {
        transformImageBitmap((ImageView) child, t, 0);

Please let me know if anyone has a better solution on this.

share|improve this answer
It is Neils coverflow widget. I did not compare codes so I'm not sure if it is V2 or V1 :) I'll take a look at it, but as far as I remember I've tried to fix it in similar way to "expand" center to take +- 5 PX on both left and right, so it became a bit less smooth, but kind a work better. Will check this too. Tnx. –  Balkyto Nov 6 '12 at 15:33
I run into same problem and use range as workaround for first time as well, but there is bad centering - depending on range value, so child in the middle is closer to the one of other childs and could overlap them after some scrolling. Now Im using invalidating as Shantur suggest and it works nice (i have only few items in coverflow, so invalidating does not hurt the performance) –  Hruskozrout Dec 28 '12 at 22:59

I resolved following this code

private int offsetChildrenLeftAndRight() {
    int offset = 0;
    for (int i = getChildCount() - 1; i >= 0; i--) {


        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN)
    return offset;

final int childCenter = getCenterOfView(child) + offsetChildrenLeftAndRight();
share|improve this answer
Works! Thanks ! –  androidika Jan 7 '13 at 13:41

Your Answer


