Android custom component to get local pictures and camera pictures
•
Android
There are encapsulated pictures in IOS. After long pressing, the animation deletion effect appears. The effect is as follows
Android hasn't found a third-party component with this effect for a long time. Finally, it's too lazy to find it. Let's realize this effect by ourselves
After selecting a picture, you can also clip the picture
Of course, there are still many imperfections in the code. I will continue to improve this component, which has been uploaded to the open source community. Welcome to star~
Demo source code: Portal
Some problems and solutions in design
1. How to display the plus sign image at the back of GridView
First, load the plus sign image when calling the gridadapter constructor
/** * 图片适配器 * @param context 上下文 * @param imagesum 最大可添加图片数 */ public GridAdapter(Context context,int imagesum) { this.context = context; this.imageSum = imagesum; // 加号图片 mAddBitmap = BitmapFactory.decodeResource(context.getResources(),R.drawable.ic_add_image); }
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码