You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an overlay with a few options: Share,Delete
I set onclick listener as below but the buttons dont respond to click. Instead, the options disappear from the screen as they would when you click on the Imageviewer.
// Inflate the layout for this
LayoutInflater inflater = LayoutInflater.from(mContext);
final View frescoView = inflater.inflate(R.layout.activity_image_options, null);
new StfalconImageViewer.Builder<>(mContext, imageList, new ImageLoader<Decode_images>() {
@Override
public void loadImage(ImageView imageView, Decode_images image) {
//Usage with picasso... you can use glide too
Picasso.get().load(URL_UploadPath+image.getResource_name()).into(imageView);
}
})
.withStartPosition(position)
.withOverlayView(frescoView)
.withImageChangeListener(new OnImageChangeListener() {
@Override
public void onImageChange(final int position) {
//Get actual pic name
pic_name=imageList.get(position).getResource_name();
pic_position=position;
//Set onclick listeners to the overlay buttons
make_cover = frescoView.findViewById(R.id.make_cover);
share_image = frescoView.findViewById(R.id.share_image);
delete_image = frescoView.findViewById(R.id.delete_image);
**make_cover.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Confirm alert
AlertDialog alertDialog = new AlertDialog.Builder(mContext).create();
alertDialog.setMessage("Make this image house cover image?");
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//
initialize_house_cover();
}
});
alertDialog.setButton(AlertDialog.BUTTON_NEGATIVE, "Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
});
alertDialog.show();
}
});**
The text was updated successfully, but these errors were encountered:
I just noticed that the onclick listener fails to register after clicking an image but after swiping to the next image, it works. Guess it fails to register the click on first load of Imageviewer
Solved the issue by defining the button click functions twice.
Once before the onImageChangeLister to handle the first image and
another inside the onImageChangeListener to handle the changing images
I have an overlay with a few options: Share,Delete
I set onclick listener as below but the buttons dont respond to click. Instead, the options disappear from the screen as they would when you click on the Imageviewer.
@OverRide
public void onClick(View view) {
The text was updated successfully, but these errors were encountered: