https://github.com/samlss/bubble
🎈To display a pretty bubble when touch in android.
https://github.com/samlss/bubble
android bubble bubbleview customview
Last synced: 5 months ago
JSON representation
🎈To display a pretty bubble when touch in android.
- Host: GitHub
- URL: https://github.com/samlss/bubble
- Owner: samlss
- License: apache-2.0
- Created: 2019-04-23T03:59:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-24T09:13:33.000Z (over 6 years ago)
- Last Synced: 2025-04-08T11:38:01.472Z (6 months ago)
- Topics: android, bubble, bubbleview, customview
- Language: Java
- Size: 8.68 MB
- Stars: 8
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://bintray.com/samlss/maven/bubble/1.0.0-snapshot/link) [](https://android-arsenal.com/api?level=11#l11) [](https://github.com/samlss/Bubble/blob/master/LICENSE)
Inspired by Ali Ant Forest.
灵感来源于阿里蚂蚁森林
### Screenshots
#### white bubbles

#### yellow bubbles

------
### Dependency#### Gradle
Add it in your module build.gradle at the end of repositories:
```java
dependencies {
implementation 'me.samlss:bubble:1.0.0-snapshot'
}
```#### Maven
```javame.samlss
bubble
1.0.0-snapshot
pom```
### Sample Usage
```java
Bubble bubble = new Bubble.Builder('activity' or 'viewgroup')
.setAlpha(0.5f) //Set the alpha of bubble
.setBubbleColor(Color.YELLOW) //Set the color of bubble
.setDuration(3000) //Set the duration of animation in millisecond
.setInterpolator(new LinearInterpolator()) //Set the interpolator of animation
.setBubbleRadius(30) //Set the radius of bubble
.build(); //To build a bubble obj//When you want to display the bubble when touch screen, you can call the below method like:
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
bubble.shoot((int) event.getX(), (int) event.getY());
}return super.onTouchEvent(event);
}//other methods
bubble.stop(); //Stop the bubble animations
bubble.destroy(); //Stop the bubble animations & Remove the bubble view so that you can not show bubbles anymore```
### License
```
Copyright 2019 samlssLicensed 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 athttp://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.
```