0

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

Dragon warrior
  • 1,644
  • 2
  • 24
  • 37

1 Answers1

1

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.

Community
  • 1
  • 1
android developer
  • 114,585
  • 152
  • 739
  • 1,270
  • Thank you. It looks like I have to create the app in Androidd style. Do you know how to create gridview like "Google Drive"? – Dragon warrior Oct 07 '13 at 20:08
  • google drive has some sort of "cards" ui. anyway, don't let other UIs limit you. you can create your own unique UI and it might be better than both Android and IOS. it's only recommended by google to use its own UI, to make end users feel "at home". i suggest checking out the next websites for inspirations and help of custom UI: http://www.androidviews.net/ https://play.google.com/store/apps/details?id=com.inappsquared.devappsdirect https://play.google.com/store/apps/details?id=com.desarrollodroide.repos . for cards UI, you can find it in one of them (can't remember where). – android developer Oct 07 '13 at 21:26
  • for the grid, use a gridView , and for its items, you can create your own way of how to show them. in order to create an efficient implementation of the gridView , i strongly suggest you to watch the lecture "the world of listView": http://www.google.com/events/io/2010/sessions/world-of-listview-android.html . it's quite old, but many people make the same mistakes on such views. listview is very similar to gridView, only that it shows the items in a list manner. the tips are almost exactly the same for both – android developer Oct 07 '13 at 21:31
  • no problem. hope some day you will master android as you've mastered kung fu :) – android developer Oct 08 '13 at 14:51