在Android中设置封面流程

时间:2011-04-13 21:11:18

标签: android coverflow adk

我创建了一个iphone应用程序,现在我被委托在android中执行相同的应用程序。我在github上使用了来自thefaj的OpenFlow https://github.com/thefaj/OpenFlow

然而,我还没有能够在android上找到一个有工作覆盖流的东西..

有没有人在Android中有这方面的经验或知道一个好的起点?

3 个答案:

答案 0 :(得分:3)

我在我的项目中使用了这段代码 http://www.inter-fuser.com/2010/02/android-coverflow-widget-v2.html

您可以调整它以从某些数据源加载内容,这不是一项艰苦的工作。

答案 1 :(得分:1)

刚刚遇到http://code.google.com/p/android-coverflow/这似乎是基于热熔器间代码并进行了一些优化

答案 2 :(得分:1)

扩展图库,并覆盖此方法:

   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;
}

显然,你可以用矩阵做更多的内容,而不仅仅是缩放,但这只是一个例子,说明它是多么容易。