StickerView icon indicating copy to clipboard operation
StickerView copied to clipboard

How can i add bringback to front and on second click front to back on hearticon click?

Open Surabhi3 opened this issue 7 years ago • 1 comments

public class HelloIconEvent implements StickerIconEvent{ @Override public void onActionDown(StickerView stickerView, MotionEvent event) {

}

@Override public void onActionMove(StickerView stickerView, MotionEvent event) { }

@Override public void onActionUp(StickerView stickerView, MotionEvent event) { stickerView.setBringToFrontCurrentSticker(true);

// Toast.makeText(stickerView.getContext(), "Hello World!", Toast.LENGTH_SHORT).show();

} }

Surabhi3 avatar Jul 15 '17 12:07 Surabhi3

Goto StickerView class , and remove final from bringToFrontCurrentSticker variable.

private final boolean bringToFrontCurrentSticker; To : private boolean bringToFrontCurrentSticker;

then make a method like this :

    public void bringToFrontCurrentSticker() {
         bringToFrontCurrentSticker = true;
    }

now in your activity

 @Override
     public void onStickerClicked(@NonNull Sticker sticker) {
          stickerView.bringToFrontCurrentSticker();
     }

Hitexroid avatar Aug 30 '17 14:08 Hitexroid