You can use the following code to make each image in your custom view shine
the getView () function of the image adapter should look like this:
public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView; if (convertView == null) { imageView = new ImageView(mContext); imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(8, 8, 8, 8); } else { imageView = (ImageView) convertView; Bitmap Image=BitmapFactory.decodeResource(mContext.getResources(),mThumbIds[position]); Image=Image.copy(Bitmap.Config.ARGB_8888,true); Paint paint=new Paint(); paint.setDither(true); paint.setFilterBitmap(true); Bitmap glow=BitmapFactory.decodeResource(mContext.getResources(), R.drawable.glow_image); Bitmap bitmap=Bitmap.createBitmap(Image.getWidth(),Image.getHeight(), Config.ARGB_8888); Canvas canvas=new Canvas(bitmap); canvas.drawBitmap(glow, new Rect(0,0,glow.getWidth(),glow.getHeight()), new Rect(0,0,Image.getWidth(),Image.getHeight()),paint); canvas.drawBitmap(Image, new Rect(0,0,Image.getWidth(),Image.getHeight()), new Rect(0+5,0+5,Image.getWidth()-5,Image.getHeight()-5),paint); imageView.setImageBitmap(bitmap); return imageView; }
R.drawable.glow_image is a PNG image that you can use as a growth effect image
Glow.png
source share