Skip to content Skip to sidebar Skip to footer

Setting Up A Cover Flow In Android

I created an iphone application, and now I am consigned to do the same application in android. I used the OpenFlow from thefaj on github https://github.com/thefaj/OpenFlow however

Solution 1:

I used this code on my project http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html

You can adapt it to load the contents from some datasource, it's not a hard work.


Solution 2:

Just came across http://code.google.com/p/android-coverflow/ which seems to be based in the inter-fuser code with some optimisations


Solution 3:

Extend Gallery, and override this method as so:

   protected boolean getChildStaticTransformation(View child, Transformation t) {
    t.clear();
    t.setTransformationType(Transformation.TYPE_MATRIX);
    final Matrix matrix = t.getMatrix();
    float childCenterPos = child.getLeft() + (child.getWidth() / 2f);
    float center = getWidth() / 2;
    float diff = Math.abs(center - childCenterPos);
    float scale = diff / getWidth();

    matrix.setScale(1 - (scale), 1 - (scale));

    return true;
}

Obviously you can do more interresting stuff with the matrix than just scaling, but this just as an example of how easy it can be done.


Post a Comment for "Setting Up A Cover Flow In Android"