Question

I am developing an Android app.

I want to create GridView like Album in iOS(image shown below), and implement the following features.

  1. Stack layout for the folder level
  2. Pinch out to expand the photos
  3. Pinch in to go back to folder level
  4. Enter edit mode after long press (Shaking with delete button on the top-left corner)

I am looking for the tutorial, example, or third part library.

Can someone help me?

enter image description here

Was it helpful?

Solution

I don't say it's impossible, but I think it will be quite hard to achieve using the normal tools on Android.

The reason is that it has a lot of images that can be shown and need to be loaded this way, and so you will have to be very cheap on memory usage. remember that even on the newest android version, devices can still give you a max of 16 MB of heap memory . it's rare these days but sadly still possible.

I also think there is no way there is a library that has all the things you've written.

anyway, here are my comments on each of your points:

  1. Stack layout for the folder level - make a custom FrameLayout that holds multiple ImageViews, each with a different rotation as you wish, according to rules you decide on.

  2. Pinch out to expand the photos - use the gestures tutorials for this. for specific gestures, you will need to check the distance between the 2 touches from the beginning of the touch. surely there are links for this, for example this one

  3. Pinch in to go back to folder level - same as #2 .

  4. Enter edit mode after long press (Shaking with delete button on the top-left corner) - long pressing is easy using setOnItemClickListener . the delete button should be avoided as it's truly against the android guidelines to have buttons there. instead it should be on the right, using a proper action bar. i don't understand the shaking part though.

as a side note , please don't try to mimic IOS too much. google recommends it too, and your app will have less chance of ever getting featured on the play store if it looks too similar to other OSs instead of the Android style.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top