This repository has been archived by the owner on May 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Flyge
committed
Dec 8, 2017
1 parent
d875836
commit a968801
Showing
36 changed files
with
419 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,6 @@ gen/ | |
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
build/ | ||
|
||
*.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
@@ -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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
app/src/main/java/me/xiaopan/android/rubberview/sample/MainActivity.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Oops, something went wrong.