Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Commit

Permalink
🔖 Released 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Flyge committed Dec 8, 2017
1 parent d875836 commit a968801
Show file tree
Hide file tree
Showing 36 changed files with 419 additions and 326 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ gen/

# Gradle files
.gradle/
build/
build/

*.iml
100 changes: 55 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
# ![Logo](https://github.com/xiaopansky/RubberView/raw/master/app/src/main/res/drawable-mdpi/ic_launcher.png) RubberView
# ![logo_image] ScratchAwardView

这是Android上的一个涂抹视图,用于实现刮奖效果
![Platform][platform_image]
[![API][min_api_image]][min_api_link]
[![Release Version][release_version_image]][release_version-link]

![Sample](https://github.com/xiaopansky/RubberView/raw/master/docs/sample.png)
这是一个刮刮卡组件,用于实现刮奖效果

![Sample](docs/sample.png)

## 开始使用

### 1. 导入 ScratchAwardView

在 app 的 build.gradle 文件的 dependencies 节点中加入依赖

```groovy
dependencies{
implementation 'me.panpf:scratch-award-view:$lastVersionName'
}
```

请自行替换 `$lastVersionName` 为最新的版本:[![Release Version][release_version_image]][release_version-link] `(不要v)`

最低支持 `Android 2.3`

### 2. 在布局中使用

你只需将 ScratchAwardView 覆盖在中奖提示语之上即可,这样的用法很灵活,因此你可以决定你的中奖提示语是一段文字或者一张图片,如下所示:

##Usage guide
你只需将RubberView覆盖在中奖提示语之上即可,这样的用法很灵活,因此你可以决定你的中奖提示语是一段文字或者一张图片,如下所示:
```xml
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
Expand All @@ -19,49 +41,37 @@
android:layout_height="100dp"
android:layout_gravity="center"/>

<me.xiaopan.android.widget.RubberView
android:id="@+id/rubberView_main"
<me.panpf.scratch.ScratchAwardView
android:id="@+id/scratch_main"
android:layout_width="200dp"
android:layout_height="100dp"
android:layout_gravity="center"/>
</FrameLayout>
```

扩展功能:
>* 调用setMaskImage()方法自定义遮罩图片,默认的是灰色
>* 调用setStrokeWidth()方法自定义画笔宽度
>* 调用enableAcrossMonitor()方法监听用户划过的区域,你可以指定一个隐藏在RubberView下面的视图,当用户划过这个视图的时候就会触发回调
##Downloads
>* [android-rubber-view-1.1.2.jar](https://github.com/xiaopansky/RubberView/raw/master/releases/android-rubber-view-1.1.2.jar)
>* [android-rubber-view-1.1.2-with-src.jar](https://github.com/xiaopansky/RubberView/raw/master/releases/android-rubber-view-1.1.2-with-src.jar)
##Change log

####1.1.2
>* 修复单击事件不灵敏的BUG
>* RubberView包名改为me.xiaopan.android.widget
####1.1.1
>* 修复当被ScrollView包括时,无法正常滑动的BUG
####1.1.0
>* 增加enableAcrossMonitor()方法,用于监听用户的滑动操作,实现滑过指定视图的时候触发回调
##License
```java
/*
* Copyright (C) 2013 Peng fei Pan <[email protected]>
*
* 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.
*/
```
* 调用 setMaskImage() 方法自定义遮罩图片,默认的是灰色
* 调用 setStrokeWidth() 方法自定义画笔宽度
* 调用 enableAcrossMonitor() 方法监听用户划过的区域,你可以指定一个隐藏在 ScratchAwardView 下面的视图,当用户划过这个视图的时候就会触发回调

## License
Copyright (C) 2017 Peng fei Pan <[email protected]>

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.

[logo_image]: sample/src/main/res/drawable-mdpi/ic_launcher.png
[platform_image]: https://img.shields.io/badge/Platform-Android-brightgreen.svg
[min_api_image]: https://img.shields.io/badge/API-10%2B-orange.svg
[min_api_link]: https://android-arsenal.com/api?level=10
[release_version_image]: https://img.shields.io/github/release/panpf/scratch-award-view.svg
[release_version-link]: https://github.com/panpf/scratch-award-view/releases
19 changes: 0 additions & 19 deletions RubberView.iml

This file was deleted.

66 changes: 0 additions & 66 deletions app/app.iml

This file was deleted.

24 changes: 0 additions & 24 deletions app/build.gradle

This file was deleted.

20 changes: 0 additions & 20 deletions app/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions app/src/main/res/layout/activity_main.xml

This file was deleted.

4 changes: 0 additions & 4 deletions app/src/main/res/values/strings.xml

This file was deleted.

8 changes: 0 additions & 8 deletions app/src/main/res/values/styles.xml

This file was deleted.

11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@

buildscript {
repositories {
mavenCentral()
jcenter()
maven { url 'https://dl.google.com/dl/android/maven2/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'

classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
mavenCentral()
jcenter()
maven { url 'https://dl.google.com/dl/android/maven2/' }
}
}
Binary file modified docs/sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,13 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true

COMPILE_SDK_VERSION=25
MIN_SDK_VERSION=10
TARGET_SDK_VERSION=22

VERSION_CODE=120
VERSION_NAME=1.2.0

ANDROID_SUPPORT_LIBRARY_VERSION=25.3.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-4.1-all.zip
Empty file modified gradlew
100644 → 100755
Empty file.
Binary file removed releases/android-rubber-view-1.1.2-with-src.jar
Binary file not shown.
Binary file removed releases/android-rubber-view-1.1.2.jar
Binary file not shown.
Loading

0 comments on commit a968801

Please sign in to comment.