How do i add an orange line under the image before it's showed in the gallery?
I want to mark the picture so it sticks out from all the other.
I have tested all kinds of LayoutParams but need advice.
See loots of explanations how to do this in the xml only.
here is my getView
in the adapter
(UPDATE WITH WORKING SOLUTION IF ANYONE NEED IT)
The imageViewWithLine
is the custom imageView that has a boolean
to determent if line should be drawn or not
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null){
BitmapFactory.Options bf = new BitmapFactory.Options();
bf.inSampleSize = 8;
Bitmap bitmap = BitmapFactory.decodeFile(files.get(position).getImagePath(),bf);
ImageViewWithLine imageViewWithLine = new ImageViewWithLine(ctx, null);
BitmapDrawable b = new BitmapDrawable(getResources(),bitmap);
imageViewWithLine.setLayoutParams(new Gallery.LayoutParams(80, 70));
imageViewWithLine.setScaleType(ImageView.ScaleType.FIT_XY);
imageViewWithLine.setBackgroundResource(GalItemBg);
imageViewWithLine.setBackgroundDrawable(b);
convertView = imageViewWithLine;
}
if(files.get(position).addLine() == true){
((ImageViewWithLine)convertView).setLine(true);
}else
((ImageViewWithLine)convertView).setLine(false);
return convertView;
}
}