1

Moving a view I try to hide all parts of view that cross some vertical line, so view starts to loose its width to 0. The image describes better what I want. I mean not just shrink a width with scaleX but hide, because this command compresses the photo horizontally, and I need to hide it without distortion.

How can I do it?

enter image description here

On the image a photo started to move left with translationX hiding line by line left side of the photo during this movement. Also, the photo is not at left edge of screen - it's on the center

Alexey Simchenko
  • 333
  • 3
  • 15

1 Answers1

0

View has left(and x) attribute in its LayoutParams.

How can I dynamically set the position of view in Android?

When left attribute is negative, it is hidden under the parent view.

If you want an animation, here is the document!

https://developer.android.com/develop/ui/views/animations/reposition-view

Jaewoo Pyo
  • 156
  • 6