Giter Club home page Giter Club logo

floatwindow's Introduction

FloatWindow 安卓任意界面悬浮窗

效果演示

特性:

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

2.支持权限申请操作

3.支持桌面悬浮

集成:

第 1 步、在工程的 build.gradle 中添加:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

第 2 步、在应用的 build.gradle 中添加:

	dependencies {
	        
	}

使用:

0.声明权限

     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

1.基础使用

    // 自定义的View
    var view = LayoutInflater.from(context).inflate(R.layout.float_view, null)
    
    var float = FloatWindow.With(context, view)
                .setAutoAlign(true)  //是否自动贴边
                .setModality(false)
                .setMoveAble(true)   // 是否可拖动
                .setStartLocation(0, (getScreenHeight(context) * 0.7).toInt())
                .create()

2.TODO 指定界面显示

              .setFilter(true, A_Activity.class, C_Activity.class)

此方法表示 A_Activity、C_Activity 显示悬浮窗,其他界面隐藏。

              .setFilter(false, B_Activity.class)

floatwindow's People

Contributors

0wei avatar xuyingke 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.