0

we are using the TouchImageView (https://github.com/MikeOrtiz/TouchImageView) in a layout where 2 images are shown on the screen, each on a layout that takes half the screen. Since the FIT_START and FIT_END scale types haven't been implemented in TouchImageView yet, we have been trying to explore other ways to align the left image to the end (right) of its layout and the right image to the beginning (left) of its layout so that the 2 images are exactly next to each other. So far, nothing has worked (mainly trying various XML attributes).

Has anyone gotten this to work? Essentially, we need the TouchImageView to emulate the FIT_START, FIT_END attributes since they are not yet implemented.

1 Answers1

0

A partial solution can be found from my fork at https://github.com/thintsa/TouchImageView. Patch: https://github.com/thintsa/TouchImageView/commit/58c7996dfc982fbd3b76515697c42eb8db9cdbd7.patch

Essentially the scale of the bitmap is the same as in FIT_CENTER and for FIT_START you move the image to top left corner matrix.postTranslate(0, 0); and for FIT_END you move it to bottom right matrix.postTranslate(redundantXSpace, redundantYSpace);. This patch applies only to left to right languages.

Timo Albert
  • 645
  • 1
  • 6
  • 17