如何将 Floating Action Button 移出应用程序并使其 运行 成为可见、可移动和可点击的后台服务?

How do I bring the Floating Action Button outside the app and make it run as visible,moveable and clickable background service?

所以我需要我的应用程序有一个开关,当打开时,应该创建一个 FAB。在主要 activity/app 关闭后,这应该 运行 像后台服务一样,在所有其他应用程序之上。所以我触摸 FAB 的任何地方,它都应该是可点击的、可移动的,并且应该覆盖所有应用程序。

您需要 activity 在主题中设置透明 windows 背景,没有状态栏,没有工具栏,没有布局,只有 FAB。您不能将 FAB 绑定到您的后台服务。服务没有 GUI。当您的按钮显示时,您需要有一个 运行 activity。

看看以下项目

https://github.com/JustinScott/AppFloater

https://github.com/vickychijwani/BubbleNote

https://github.com/sezeryesiltas/chat-head-demo

https://github.com/callmekarthik/FBChatHeadExample