The purpose of this example is to implement a photo selection function similar to QQ. After selecting a photo, use a Facebook page similar to the Sina Weibo blog.
First on:
The main techniques used in this example are:
1. Use ContentProvider to read all picture information of SD card.
2. To the picture obtained in 1, the image belongs to the parent folder to classify (similar to QQ).
3. Select the photo page and select the album page to switch between each other and do not go oncreate (switch very smooth), and set the page switch animation to enhance the user experience.
4. When loading the SD card picture, use LRUCache and set the initial compression ratio to reduce the memory consumption.
5. The use of the "square Layout" squarerelativelayout (a custom component that inherits from the Relativelayout, is self-adapting to keep itself as a square).
There's a lot of code, and it's not posted here. Interested please download the Source view (free points Oh!) ):
download.csdn.net/detail/books1958/8145321
Android: Imitation QQ photo selector (by album category display, multi-select Add)