Android 下的悬浮窗权限兼容库

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 :
《Android 下的悬浮窗权限兼容库》

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}《Android 下的悬浮窗权限兼容库》

添加依赖到你的 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: 《Android 下的悬浮窗权限兼容库》 《Android 下的悬浮窗权限兼容库》

conclusion: 《Android 下的悬浮窗权限兼容库》 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: 《Android 下的悬浮窗权限兼容库》

conclusion: 《Android 下的悬浮窗权限兼容库》 waiting for adapted…

xiaomi

most of xiaomi mobiles are adapted very well except some paticular models:
《Android 下的悬浮窗权限兼容库》

here is the conclusion: 《Android 下的悬浮窗权限兼容库》

samsung

almost 100% of the samsung mobiles are adapted very well: 《Android 下的悬浮窗权限兼容库》

here is the conclusion of samsung: 《Android 下的悬浮窗权限兼容库》

oppo and vivo

only test a small part of the mobiles and here is the result: 《Android 下的悬浮窗权限兼容库》

conclusion:
《Android 下的悬浮窗权限兼容库》

others

we random pick some other models like HTC and Sony and here is the result: 《Android 下的悬浮窗权限兼容库》

conclusion:
《Android 下的悬浮窗权限兼容库》

    原文作者:Android
    原文地址: https://juejin.im/entry/58f47d26ac502e006c393262
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞