This is a android custom view , like a scratch card effect!

Related tags

UI/UX ScratchView
Overview

ScratchView

This is a android custom view , like a scratch card effect!

Last Update

Articles

Demo screen

ScratchView

Import

Gradle


dependencies {
    compile 'com.clock.scratch:Scratch:1.0.0'
}

Maven


<dependency>
  <groupId>com.clock.scratch</groupId>
  <artifactId>Scratch</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

How to use

  • Create a contains of content view and ScratchView FrameLayout,let ScratchView displayed in the top.
	 <FrameLayout
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="8dp">

		<!-- content view -->
        <ImageView
            android:layout_width="150dp"
            android:layout_height="150dp"
            android:layout_gravity="center"
            android:src="@mipmap/lufy" />

		<!-- scratch view -->
        <com.clock.scratch.ScratchView
            android:id="@+id/scratch_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </FrameLayout>
  • Key Properties and Java API
Properties Java API
scratch:maskColor setMaskColor(int color)
scratch:watermark setWatermark(int resId)
scratch:eraseSize setEraserSize(float eraserSize)
scratch:maxPercent setMaxPercent(int max)

More use , you need see the demo code...

License

Copyright 2016 D_clock爱吃葱花

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Simple and fantastic wheel view in realistic effect for android.
Simple and fantastic wheel view in realistic effect for android.

Overview ![Size](https://img.shields.io/badge/Size-17 KB-e91e63.svg) Contact Preview Demo WheelPicke.APK Include Compile compile 'cn.aigestudio.wheelp

Pop animation with circular dust effect for any view updation

Popview-Android Pop animation with circular dust effect for any view updation Getting Started In your build.gradle dependencies { compile 'rb.popv

Android Library to build a UI Card
Android Library to build a UI Card

Card Library Travis master: Travis dev: Card Library provides an easy way to display a UI Card using the Official Google CardView in your Android app.

💳 CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card.
💳 CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card.

CreditCard View CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card. Displaying and en

Android App to Teach the Card Counting Skill

card-counting Android App to Teach the Card Counting Skill. The skill can be used to make more informed decisions while playing games like Blackjack.

Simple card app for Udacity's Android Basics: User Interface course

just-because-card Simple card app for Udacity's Android Basics: User Interface c

Android Card-Library
Android Card-Library

Android Card-Library Technology Stack Android Studio Bumblebe

PCard  Add payment card screen made using JetPack Compose
PCard Add payment card screen made using JetPack Compose

PCard Add payment card screen made using JetPack Compose Find this repository useful? ❤️ Support it by joining stargazers for this repository. ⭐ And f

Card with swipe options in Jetpack Compose

SwipeableActionCard Card with swipe options in Jetpack Compose Tutorial: Click Here Import SwipeableActionCard library Add this in project level build

Comments
  • ACTION_MOVE的时候每次都调用erase()函数是不是太浪费系统资源了?

    ACTION_MOVE的时候每次都调用erase()函数是不是太浪费系统资源了?

    我觉得在ACTION_UP的时候去调用一下就好了。 我的理解是,erase()函数目的就是去判断一下刮奖有没有结束,完全可以只在ACTION_UP的时候去调用,而且在move的时候跳出了一个中奖结果用户体验也不太好,还是抬手后再判断比较好。

    我试了下,在我的测试机mate8中,刮5%的情况下。 原来的思路CPU要26S后才会计算完所有的东西,而新的思路是抬手后的两秒。 内存倒区别不大。 详情见下面两图: 1 ACTION_MOVE的时候每次都调用erase()函数 2 ACTION_UP的时候调用

    opened by DearZack 2
  • can't shape

    can't shape

    I can change it's shape when I use background attribute at that time it set the background as content. that's suck. so, Please give some solution. Thank you

    opened by vishalvanpariya 0
  • Changing the scratch view color (Mast Color)

    Changing the scratch view color (Mast Color)

    I am getting an issue, where changing the scratchview MASK COLOR, it is partially displaying the imageview behind it. How I can I hide it completely while setting the SCRATCH VIEW COLOR (i.e mask color )?

    opened by gauravarora90 0
  • scratchView onProgress always returns 0

    scratchView onProgress always returns 0

    private int getPercent(){
            perc = 0;
            scratchView.setEraseStatusListener(new ScratchView.EraseStatusListener() {
                @Override
                public void onProgress(int percent) {
                    perc = percent;
                }
    
                @Override
                public void onCompleted(View view) {
    
                }
            });
    
    
            return perc;
        }
    

    scratchView onProgress doesn't return the percent always returns 0 can you help me solve this

    bug question 
    opened by tao101 1
Owner
D_clock爱吃葱花
Just a man!
D_clock爱吃葱花
Created a Tinder like Card Deck & Captain Train like Toolbar

TinderView Created A Simple and Beautiful Tinder like card deck & Captain Train like toolbar. This is heavily based on AndroidSwipeableCardStack, wenc

Aradh Pillai 328 Jun 18, 2022
ScratchView 7.0 0.0 L4 Java repo is UX Design involving scratch cards like views which are scratched to reveal the information they conceal.

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

Harish Sridharan 1.1k Dec 24, 2022
ScratchView repo is UX Design involving scratch cards like views which are scratched to reveal the information they conceal.

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

Harish Sridharan 1.1k Dec 24, 2022
A Tinder-like Android library to create the swipe cards effect. You can swipe left or right to like or dislike the content.

Swipecards Travis master: A Tinder-like cards effect as of August 2014. You can swipe left or right to like or dislike the content. The library create

Dionysis Lorentzos 2.3k Dec 9, 2022
A tinder like swipeable card stack component

AndroidSwipeableCardStack Change log: provide option to infinitly swipe in a loop card rotation setting card gravity setting undo animation Thanks for

wenchao jiang 824 Nov 10, 2022
A simple implementation of swipe card like StreetView

A simple implementation of swipe card like StreetView!! DONATIONS This project needs you! If you would like to support this project's further developm

Michele Lacorte 831 Jan 4, 2023
Inspired by Heinrich Reimer Material Intro and developed with love from scratch

Android Material Intro Screen Material intro screen is inspired by Material Intro and developed with love from scratch. I decided to rewrite completel

Tango Agency 2.7k Dec 19, 2022
An Android custom view to display digits rendered as dots in a grid, with a style like a 1970s LED clock.

#DotMatrixView This is an Android library project providing a custom view that can display things on a grid of dots. When the displayed value changes,

Mark Roberts 48 Apr 21, 2022
View that imitates Ripple Effect on click which was introduced in Android L (for Android 2.3+)

RippleView View that imitates Ripple Effect on click which was introduced in Android L. Usage For a working implementation, Have a look at the Sample

Muthuramakrishnan Viswanathan 1.2k Dec 30, 2022
This is a picker view for android , support linkage effect, timepicker and optionspicker.(时间选择器、省市区三级联动)

Android-PickerView English Document 注意事项、详请使用方式、更新日志等,请查看 Wiki文档 Wiki文档,Wiki文档,Wiki文档 !~ 重要的事情说三遍 对于使用上有任何疑问或优化建议等,欢迎加入QQ群讨论交流技术问题。 交流群1: 387051294(推荐

Bigkoo 13.2k Jan 6, 2023