No action on tapping unsupported image

This commit is contained in:
Yedidya Kennard 2016-08-16 10:16:13 +03:00
parent d8454d2d57
commit 4adeff73b4
1 changed files with 6 additions and 2 deletions

View File

@ -195,14 +195,18 @@ public class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.StupidHo
// holder.supported = // holder.supported =
holder.image = images.get(position); holder.image = images.get(position);
boolean selected = (selectedUris.indexOf(holder.image.uri) + 1) > 0; boolean selected = (selectedUris.indexOf(holder.image.uri) + 1) > 0;
boolean supported = isSupported(holder.image); final boolean supported = isSupported(holder.image);
selectableImageView.setUnsupportedUIParams(overlayColor, unsupportedFinalImage, unsupportedText, unsupportedTextColor); selectableImageView.setUnsupportedUIParams(overlayColor, unsupportedFinalImage, unsupportedText, unsupportedTextColor);
selectableImageView.setDrawables(selectedDrawable, unselectedDrawable); selectableImageView.setDrawables(selectedDrawable, unselectedDrawable);
selectableImageView.bind(executor, selected, holder.image.id, supported); selectableImageView.bind(executor, selected, holder.image.id, supported);
selectableImageView.setOnClickListener(new View.OnClickListener() { selectableImageView.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if(supported) {
view.onTapImage(holder.image.uri); view.onTapImage(holder.image.uri);
} else {
//
}
} }
}); });
} }