Coder Social home page Coder Social logo

floatview's Introduction

FloatView

特别感谢 持续更新中

效果图

悬浮按钮图

集成:

allprojects {
    repositories {      
        jcenter()
    }
}

Androidx:

	dependencies {
	        implementation 'org.zhx.common:floatView:0.3.0'
	}

注意:appcompat (未使用Androidx)引用: 在gradle.properties 添加:

android.useAndroidX=true
android.enableJetifier=true

代码:

   FloatWindow
                .with(getApplicationContext())
                .setView(imageView)
                .setWidth(Screen.width, 0.2f) //设置悬浮控件宽高
                .setHeight(Screen.width, 0.2f)
                .setX(Screen.width, 0.8f)
                .setY(Screen.height, 0.3f)
                .setMoveType(MoveType.slide, 0, 0)
                .setMoveStyle(500, new BounceInterpolator())
                .setFilter(true, A_Activity.class, C_Activity.class)
                .setViewStateListener(mViewStateListener)
                .setPermissionListener(mPermissionListener)
                //新增动画 显示和隐藏
//                .setAnimationStyle(R.style.windAnim)
                .setDesktopShow(true)
                .build();
		//  FloatWindow.get(TAG).show();
	       FloatWindow.get().show();

更新日志

v0.3.0

修复 application 实现了Application.ActivityLifecycleCallbacks 可能造成的bug

// 如果您的 application 实现了 Application.ActivityLifecycleCallbacks 接口 请先调用
 FloatWindow.init(this);// 0.3.0 版本新增  Application  onCreat()中调用 且 不要再调用 registerActivityLifecycleCallbacks

原著特性:

1.支持拖动,提供自动贴边等动画

2.内部自动进行权限申请操作

3.可自由指定要显示悬浮窗的界面

4.应用退到后台时,悬浮窗会自动隐藏

5.除小米外,4.4~7.0 无需权限申请

6.位置及宽高可设置百分比值,轻松适配各分辨率

7.支持权限申请结果、位置等状态监听

8.链式调用,简洁清爽

floatview's People

Contributors

zhoulinxue avatar

Stargazers

 avatar  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.