Can a panorama viewer effect be done with TranslateAnimation?

梦想的初衷 提交于 2019-12-06 12:25:16

问题


I made an Image Viewer with TouchImageView that I forked to my needs. In particular, you can fit the image vertically in the screen, and then drag the image from left to right. This is nice for a panorama, for example, that you can drag and see it all.

Now I want to do exactly this with panoramas without touching the screen, that is, an automatic constant drag.

I tried to implement this through a TranslateAnimation, but failed miserably: TranslateAnimation "moves the view", and the image is slowly being replaced with a growing black strip instead of more image.

Of course I can move the image 1 pixel, wait 1/100s, move again and so on, but there should be an easier way (and consuming less resources).

Is there some option in TranslateAnimation that allows to do this? How would you do it?

Thanks!!

来源:https://stackoverflow.com/questions/13963836/can-a-panorama-viewer-effect-be-done-with-translateanimation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!