view methods setX setTranslationX setTop animate().x() not working

Viewed 49

I have a relative layour and a imageview inside of it. I want to move the imageview to the touch position. I have tried these methods for X and Y

view.setX()
view.setTranslationX()
view.setTop()
view.animate().x()

none of them is working, nothing happens.

The code runs inside PagerAdapter. I have an imageview that takes all screen and i set onTouchListener for it, get touch coordinates and set them to another imageview, that is a red circle, to move it to the touch location, but it is not moving at all.

0 Answers
Related