0

I am trying to generate a view pager swipe layout, where instead of a set of images, I want to use only one enlarged image. When users swipes, the layout should display portions of images from the single image.

To be acheived view

I know how to use view pager to show different images. But I need help with the above UI spec.

[Edited] I don't want to implement ViewPager anymore. I have a big image as shown above. I want to display parts of that image on some event. For example there are 5 actions, and I want to divide this image into five parts and display it based on the action choosen dynamically. I used the Bitmap files to recreate the part of image from large Image but it has very low performance. (UI gets freezed). Although I create my 5 different Bitmaps initially before the activity is completely loaded, setting those bitmaps as background when user performs an event freezes the UI. Please let me know if there is an alternate way to show parts of image without using bitmap

crazy_coder
  • 1,039
  • 2
  • 8
  • 18
  • Would it be an option to simply use a horizontal ScrollView? You wouldn't have the locking in effect but apart from that it would be doing exactly what you want. – wkarl Oct 03 '15 at 07:47
  • I'm not sure that this would work. For a single image to be large enough to exist across multiple view pager views it would likely exceed the maximum image size. My suggestion, if you need to do this, would be to segment the image and display each segment in each "page" of the view pager – Marcus Hooper Oct 03 '15 at 07:51
  • It is not mandatory to have an effect of a ViewPager. The layout contains a slider and upon moving the slider above image effect should be achieved. – crazy_coder Oct 03 '15 at 08:04
  • The only thing I need to achieve is to allow show parts of the big image on some event. I have tried doing it using Bitmap, createBitmap to set the beginning position, which seems to work. But, bitmap occasionally gives OOM. I am looking for another way to create parts of image programmatically – crazy_coder Oct 04 '15 at 19:58

0 Answers0