刮奖效果库

来源:互联网 发布:linux目录树结构 编辑:程序博客网 时间:2024/04/27 18:11

https://github.com/cooltechworks/ScratchView

ScratchView

Intro

ScratchView repo is UX Design involving scratch cards like views which are scratched to reveal the information they conceal. There are two types of ScratchView

  • ScratchImageView

    • A Child of ImageView which conceals the image. Scratching over the view will reveal the hidden image.
  • ScratchTextView

    • A Child of TextView which conceals the text. Scratching over the view will reveal the hidden text.

Demo Screen

ScratchImageViewScratchTextViewScratchImageViewScratchTextView

Useful Methods

Both the views have following three methods which are useful to reveal or determine whether revealed and listener during revealing the hidden text/image.

  • isRevealed() - tells whether the text/image has been revealed.
  • reveal() - reveals the image/text if not revealed yet.
  • setRevealListener(IRevealListener) - a callback listener interface which gets called back when user reveals the text/image through onReveal() method.

0 0
原创粉丝点击