Skip to content

Ryanst/FloatingBall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FloatingBall

效果图

floatingball

使用方法

//rootView是必须的,其他的设置选项都有默认值
FloatBall floatBall = new FloatBall.Builder(this, rootView)
                .setBottomMargin(90)//悬浮球初始位置BottomMargin
                .setRightMargin(90)//悬浮球初始位置RightMargin
                .setHeight(180)//悬浮球高度
                .setWidth(180)//悬浮球宽度
                .setRes(R.drawable.ic_ball)//图片资源
                .setDuration(500)//靠边动画时间
                .setOnClickListener(new View.OnClickListener() {//悬浮球点击事件
                                    @Override
                                    public void onClick(View v) {
                                        Toast.makeText(MainActivity.this, "floating ball click", Toast.LENGTH_SHORT).show();
                                    }
                                })
                .setBall(new ImageView(this))//默认悬浮球是View,如需设置特定View则设置此项,反则无需设置
                .build();

导入方式

dependencies {
    compile 'com.zhengjt:floatingball:1.0.2'
}

License

Copyright 2016 zhengjt

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.

About

Android悬浮球

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages