I. Main Ideas
1. Use the GridView control to display the following information to implement screen lock thumbnail preview.
2. Read lock screen data from the settings. db database of the Data System
3. Use Image merging to display the Image Selection Effect
Effect
Ii. resource storage
Image: screen lock style preview thumbnails stored in drawable Resources
Data: Mainly reads the System table in the settings. db database.
Iii. Important data description
Integer array previewImage storage image resource ID
The integer array lockstyle_nameid stores the lock screen string.
PreviewBitmap
Image array previewSelectBitmap storage preview selected Image
String Array lockType stores the field names in the setting. db database table
ArrayList <HashMap <String, Object> listItems is an array list. Its list items are HashMap. Each HashMap stores two important data items: the image to be displayed, and the string corresponding to the image.
Iv. Important Methods
InitData ()
Main function: Initialize data. Initialize the original preview Image array, initialize the selected array, initialize the ArrayList array list, and obtain the currently selected items from the database.
Docomo (Bitmap src, Bitmap watermark)
Main function: combines the original preview image with the selected image and returns the final selected image.
Parameter: src: Original Image
Watermark: The image to be merged into the original image.
Returned value: Bitmap
InitSelectState ()
Main function: update the selected data to the selected data.
SaveSetting ()
Main function: Save settings to Database system
GetSetting ()
Main function: Get settings from the Database system
SaveSecureSetting ()
Main function: Save the settings to the Database Secure
GetSecureSettings ()
Main function: Get settings from Database Secure
V. system diagram
System diagram