我需要一些关于如何为Android操作滑动图像查看器的信息。完全像这样:http://www.photoswipe.com/latest/examples/jquery-mobile.html#&ui-state=dialog。我有一个listView,我希望每次点击listview项目时它都会打开一个新的全屏显示所选图像的窗口,当我在图像上选中时,显示左下方按钮的底部和图像上方的一些信息。在全屏模式下,我希望能够向左和向右滑动以及不同的图像显示起来。
知道如何做到这一点吗?非常感谢!
答案 0 :(得分:2)
在viewflipper中插入imageviews(此处称为optionsVF)
在你的onClick或其他东西:
Animation in = AnimationFactory.inFromRight();
in.setDuration(500);
optionsVF.setInAnimation(in);
Animation out = AnimationFactory.outToLeft();
out.setDuration(500);
optionsVF.setOutAnimation(out);
optionsVF.showNext();
我的课程:) AnimationFactory
/*
* Copyright 2011 Sherif
*/
public class AnimationFactory {
public static Animation inFromRight() {
Animation inFromLeft = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, 1.0f, Animation.RELATIVE_TO_PARENT, 0.0f,
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f
);
inFromLeft.setDuration(500);
inFromLeft.setInterpolator(new AccelerateInterpolator());
return inFromLeft;
}
public static Animation outToLeft() {
Animation inFromLeft = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, -1.0f,
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f
);
inFromLeft.setDuration(500);
inFromLeft.setInterpolator(new AccelerateInterpolator());
return inFromLeft;
}
}