悬浮窗权限android26,Android 下的悬浮窗权限兼容库

该博客介绍了如何针对Android 6.0及更高版本的手机,特别是小米、华为、魅族、三星等品牌,适配和请求浮动窗口权限。提供了详细代码示例和已适配机型的测试结果,包括小米、华为的部分机型,以及三星几乎全部机型的成功适配情况。同时,对于未列出的其他品牌和型号,也给出了相应的处理建议和联系方式。
摘要由CSDN通过智能技术生成

this repository is aimed to adapt android float window permission in most of phone models and how to request it at runtime

its result is as follows :

614aa50614342521f44f8accf56a5014.gif

if you want to see more,click here

from now on,the models below android M that have been adapted are :

xiaomi:v5,v6,v7,v8

huawei:partial

meizu:partial

360:partial

others:phones like samsung,sony or other model can directly show the float window, so there is no need to adapt,but if you find one that can not,contact me via my email(zhao_zepeng@hotmail.com) or leave a message on my

blog i mentioned above,thanks

more details about the models that have been adapted(thanks ruanqin0706 for help):

Usage

${latest.version} 是

1

添加依赖到你的 build.gradle 文件(If you are building with Gradle, simply add the following line to the dependencies section of your build.gradle file): compile 'com.linchaolong.android:floatingpermissioncompat:${latest.version}'复制代码

使用说明(Example): // 检测是否已授权悬浮窗权限(check floating window permission)

FloatingPermissionCompat.get().check(context)

// 判断是否已经兼容当前 ROM(check if supported current ROM)

FloatingPermissionCompat.get().isSupported()

// 打开授权界面(show the floating window permission activity)

FloatingPermissionCompat.get().apply(context);复制代码

更多细节请查看 app 模块的示例代码(more detail see the app module code)。

6.0/6.0+

most models are OK with this way of adaption except meizu:

fe634067bc5f33281d1b657edfa49e9c.png

34474d9ca6b26e4b6232b1feb2be388c.png

conclusion:

14d53849191d8c17afc32b0de1ec54e3.png until now(2016-11-21), this problem has been solved, we have made a special treatment to the ROM above 6.0 inclue 6.0 in meizu mobiles.

huawei

here is the test result for huawei mobiles:

088c8fdf64a96506146a5bdae126165e.png

conclusion:

165f0f103e23e01ee97d8b16b3388b29.png waiting for adapted...

xiaomi

most of xiaomi mobiles are adapted very well except some paticular models:

f5c07ddf65adb7da3dfdec6661b53baa.png

here is the conclusion:

95168ef86f4468d8422822fc98a9f4fa.png

samsung

almost 100% of the samsung mobiles are adapted very well:

f5a9e179e660c02098d1152ebd2e008b.png

here is the conclusion of samsung:

37977602381bef4099551210fd9f091a.png

oppo

and vivo

only test a small part of the mobiles and here is the result:

ec4563d4f4fbe967dd6fcf70c94fca86.png

conclusion:

8dabeca3180b85b2315779a162389530.png

others

we random pick some other models like HTC and Sony and here is the result:

1612da4b7b5471c5ed01b95fc014e242.png

conclusion:

6c9577d92a53d1f405d3d124c2d057fe.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值