GithubHelp home page GithubHelp logo

balloonperformer's Introduction

BalloonPerformer Android Arsenal

预览

https://raw.githubusercontent.com/Kyson/BalloonPerformer/master/art/bp_showcase.gif

这个开源项目是从之前做的一个内存清理应用抽取出来的,下载地址:点我下载TT内存清理

这个库是什么?

这是一个桌面悬浮窗工具,拉手下拉会出现气球动画。

用来做什么?

演示应用是一个小工具,用于清理内存,下拉拉手,等待气球飞行完毕就执行清理内存的工作。

你也可以在飞行完毕的回调中执行其他有趣的事情。

如何使用?

  • Gradle配置
dependencies {
    compile 'com.tt:balloonperformerlibrary:1.0.2'
}
  • 构造一个属性配置
Config.Builder builder = new Config.Builder(MainActivity.this);
Config config = builder.pullSensitivity(2.0f).lineLength(64).isOnlyDestop(false).flyDuration(3000).balloonCount(6).create();

BalloonPerformer可以配置一些属性,如下表

属性 类型 说明 默认值
BalloonCount int 气球个数 5
FlyDuration long 飞行时间 2500毫秒
LineLength int 拉线长度 72px
PullSensitivity float 下拉灵敏度 1.8f
isOnlyDestop boolean 是否仅在桌面显示 false
  • 初始化(携带该配置)
BalloonPerformer.getInstance().init(MainActivity.this, config);

如果没有配置Config属性的话会使用默认属性。

  • 显示悬浮窗
BalloonPerformer.getInstance().show(MainActivity.this, new BalloonGroup.OnBalloonFlyedListener() {
            @Override
            public void onBalloonFlyed() {
                //do something
            }
        });
  • 隐藏悬浮窗
BalloonPerformer.getInstance().gone(MainActivity.this);

鸣谢

更多

License

Copyright (c) 2015 Kyson

Licensed under the Apache License, Version 2.0

balloonperformer's People

Contributors

kyson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.