All Projects → leotyndale → Enfloatingview

leotyndale / Enfloatingview

🔥应用内悬浮窗,无需一切权限,适配所有ROM和厂商,no permission floating view.

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Enfloatingview

Coordinatormenu
The library creates a floating menu like the app momo, vtcpay, wepay
Stars: ✭ 160 (-78.17%)
Mutual labels:  floating
smart borders
awesomewm full titlebar functionality without sacrificing space
Stars: ✭ 51 (-93.04%)
Mutual labels:  floating
FTerm.nvim
🔥 No-nonsense floating terminal plugin for neovim 🔥
Stars: ✭ 353 (-51.84%)
Mutual labels:  floating
Mnfloatbtn
iOS全局悬浮按钮,显示 / 切换当前API环境与版本 ,掌握和测试撕逼主动权~
Stars: ✭ 168 (-77.08%)
Mutual labels:  floating
MusicalYoutube
A Youtube floating PIP player for Android.
Stars: ✭ 52 (-92.91%)
Mutual labels:  floating
SocialOrbitLayout
Kotlin based custom view to show floating objects that can be used for social apps.
Stars: ✭ 28 (-96.18%)
Mutual labels:  floating
Easyfloat
🔥 EasyFloat:浮窗从未如此简单(Android可拖拽悬浮窗口,支持页面过滤、自定义动画,可设置单页面浮窗、前台浮窗、全局浮窗,浮窗权限按需自动申请...)
Stars: ✭ 2,201 (+200.27%)
Mutual labels:  floating
Icewm
A window manager designed for speed, usability, and consistency
Stars: ✭ 338 (-53.89%)
Mutual labels:  floating
react-native-floating-action-bar
A React Native floating action bar.
Stars: ✭ 39 (-94.68%)
Mutual labels:  floating
netlicensing.io
Labs64 NetLicensing - Innovative License Management Solution
Stars: ✭ 13 (-98.23%)
Mutual labels:  floating
Floatingkeyboard
A Draggable and Floating KeyboardView for android that several EditText's can register to use it.
Stars: ✭ 204 (-72.17%)
Mutual labels:  floating
react-native-floating-label-input
A customizable React Native TextInput with its placeholder always shown. Includes masks, global styles, character count, and a bunch else.
Stars: ✭ 206 (-71.9%)
Mutual labels:  floating
blackboxwm
A window manager for X11
Stars: ✭ 117 (-84.04%)
Mutual labels:  floating
Rhsidebuttons
Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app small side menu. 🌶
Stars: ✭ 164 (-77.63%)
Mutual labels:  floating
bootstrap-floating-label
Bootstrap 5 Floating Label
Stars: ✭ 24 (-96.73%)
Mutual labels:  floating
Flutteringlayout
🎈 一个直播间点赞桃心飘动效果的控件
Stars: ✭ 145 (-80.22%)
Mutual labels:  floating
floating-layout-android
Floating Layout library for Android
Stars: ✭ 55 (-92.5%)
Mutual labels:  floating
Xtoast
Android 悬浮窗框架,好用不解释
Stars: ✭ 493 (-32.74%)
Mutual labels:  floating
Fitgrd
.fitgrd is the lightweight & sexy looking responsive grid for your next awesome website.
Stars: ✭ 329 (-55.12%)
Mutual labels:  floating
TextInputLayout
The objective of this code is to guide you to create login screen with TextInputLayout in iOS app.
Stars: ✭ 30 (-95.91%)
Mutual labels:  floating

Logo

EnFloatingView

Jcenter Muxuan Website

《移动开发架构设计实战》

点击购买

豆瓣酱

==========================

English

无需一切权限,不受各种国产ROM限制,默认可以显示的应用内悬浮窗。

传统方案

对于传统悬浮窗和一些古老的“黑科技”悬浮窗的实现,想必已经有很多成熟的案例了,实现策略基本为以下两种:

  1. TYPE_SYSTEM_ALERT类型
mWindowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams()
layoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;

​ 需要权限:

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" ></uses>
  1. TYPE_TOAST / TYPE_PHONE 类型

​ 7.1.1以下不需要权限声明,在魅族、华为、小米等机型上默认隐藏,需要引导用户打开悬浮窗。

传统方案的问题

第一种方案因为存在各种限制,不能被众多开发采纳,故而比较流行的悬浮窗实现方式是第二种。

但是,我们有自己的原则:

  • 不能接受7.1.1以上机型,使用第二种方式实现悬浮窗仍需要用户主动授予权限的操作?
  • 不能接受在魅族、华为、小米等机型上默认隐藏,需要引导用户打开悬浮窗,就像这样

权限管理

功能

  • 应用内显示,无需申请任何权限
  • 应用内显示,所有机型都可以默认显示悬浮窗,无需引导用户做更多设置
  • 支持拖拽
  • 超出屏幕限制移动
  • 可自动吸附到屏幕边缘

基本使用规则

1.在gralde的dependencies中加入

    compile 'com.imuxuan:floatingview:1.6'

2.在基类Activity(注意必须是基类Activity)中的onStart和onStop(或者安卓原生ActivityLifeCycle监听)中添加如下代码

    @Override
    protected void onStart() {
        super.onStart();
        FloatingView.get().attach(this);
    }

    @Override
    protected void onStop() {
        super.onStop();
        FloatingView.get().detach(this);
    }

3.展示悬浮窗

    FloatingView.get().add();

扩展用法

1.销毁悬浮窗

    FloatingView.get().remove();

2.添加点击事件

    FloatingView.get().listener(new MagnetViewListener() {
         @Override
         public void onRemove(FloatingMagnetView magnetView) {
             Toast.makeText(TestActivity.this, "我没了", Toast.LENGTH_SHORT).show();
         }

         @Override
         public void onClick(FloatingMagnetView magnetView) {
             Toast.makeText(TestActivity.this, "点到我了", Toast.LENGTH_SHORT).show();
         }
     });

3.获得悬浮窗View

    FloatingView.get().getView();

4.设置悬浮窗icon

    FloatingView.get().icon(R.drawable.XXXXX);

5.设置悬浮窗View

    FloatingView.get().customView(new View());
    or
    FloatingView.get().customView(R.layout.XXXXX);

6.设置悬浮窗位置等布局参数

    FloatingView.get().layoutParams(new ViewGroup.LayoutParams());

效果图

预览图

更新记录

1.6

修复横竖屏切换错位 & 添加到布局时偶发崩溃

1.5

修复内存泄露问题

1.4

适配折叠屏

1.3

增加自定义layout等API

1.2

修复拖拽失效

1.1

点击监听问题处理

1.0

创建项目

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].