如何在右侧创建通知状态栏图标? [英] How to create a Notification status bar icon on the right side?
问题描述
好吧,我看到很多人只是通过说
Ok I saw a lot of people just dismiss this question by saying
它是为操作系统组件保留的"
"it's reserved for OS component "
它需要访问源代码"
好吧,我可以访问源代码,并且可以将我想要的任何应用程序或小部件设置为系统应用程序.那么现在我将如何让我的小部件在右侧显示其通知?
Well I have access to the source and I can set any app or widget I want as a system app. So now how would I go about making my widget show its notification on the right side?
好的,人们正朝着错误的方向前进,所以我在这里添加了上下文...看看你的手机...你一直在手机右侧看到Wi-Fi信号和电话信号.我希望我的信号也显示在那里...随着系统信号..我公司正在生产的平板电脑中有一个新的硬件芯片,我必须像电话信号一样不断显示其信号强度.它将被集成到平板电脑的 Android 源中.
ok ppl are going in the wrong direction so ill add come context here . . . look at ur phone . . . u see Wi-Fi signal and phone signal on the right side of the phone all the time right. I want my signal to be shown there aswell . . . along with the system signals . . I have a new hardware chip in the tablet my company is making and I have to display its signal strength constantly just like the phone signal. It is going to be integrated into the Android source of the tablet.
推荐答案
您可能需要参考 Android 手机状态栏源代码的代码,位于 https://android.googlesource.com/platform/frameworks/base/+/android-4.3_r3.1/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
You might need to refer to the code of Android source code of phone status bar, at https://android.googlesource.com/platform/frameworks/base/+/android-4.3_r3.1/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
看看像这样的方法
addIcon
updateIcon
removeIcon
这不是一件容易的事,因为你必须自己添加很多东西.
It is not easy task since you have to add lots of stuff by yourself.
这篇关于如何在右侧创建通知状态栏图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!