可能使setSystemUiVisibility()影响整个系统,而不仅仅是你的应用程序? [英] Possible to make setSystemUiVisibility() affect the entire system, rather than just your app?

查看:3422
本文介绍了可能使setSystemUiVisibility()影响整个系统,而不仅仅是你的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望让这灰色软按钮,以圆点的Galaxy Nexus的一个应用程序,使用code从这回答。为了完整起见,这是code:

I was hoping to make an app which dimmed the soft buttons to dots on the Galaxy Nexus, using the code from this answer. For completeness, this is the code:

getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);

这里的问题,是有可能的应用,使该设置系统范围内的,而不是仅仅当应用程序具有焦点?因此,理想情况下,应用程序会在后台运行,并为它的运行将保持View.SYSTEM_UI_FLAG_LOW_PROFILE作为默认长,任何和每一个应用程序,打开(除非该应用程序明确覆盖它,我想)。这是可能的,或者做了什么一个Android应用程序有相应权限的领域之外,今年秋天?

Here's the question, is it possible for the app to make this setting system-wide rather than just while the app has focus? So ideally the app would run in the background and would keep View.SYSTEM_UI_FLAG_LOW_PROFILE as the default as long as it's running, for any and every app that you open (unless that app specifically overrides it, I suppose). Is this possible or does this fall outside the realm of what an Android app has permission to do?

一个样品的使用情况是这样的:我使用了屏幕过滤器应用程序,以减少亮度很多关于夜间电子书阅读或其它应用程序的用法,但软按钮仍然是非常光明的,分散注意力,所以我想使一个应用程序这将昏暗的软按钮全系统运行时(比如如何画面亮度降低运转时的屏幕亮度级系统),所以这不会是一个问题。

A sample use case is this: I use the "Screen Filter" app to reduce brightness a lot for nighttime ebook reading or misc app usage, but the soft buttons are still very bright and distracting, so I wanted to make an app that would dim the soft buttons system-wide while running (like how "Screen Brightness" reduces screen brightness system-wide while running) so this wouldn't be a problem.

推荐答案

由于CommonsWare状态,它的无法为应用程序更改此设置。这是基于环境的活动,必须为每一个活动进行设置,如果你想使它全屏,隐藏软键等。

As CommonsWare states, it's not possible for an application to change this setting. It's an Activity based setting, that must be set for every single Activity, if you want to make it fullscreen, hide the soft keys, etc.

另外值得指出的是,你应该在你的应用程序的所有活动停止使用。实际上它仅用于那些需要输入这个低调状态,游戏,视频播放器和其他应用程序。

It's also worth pointing out that you should probably refrain from using it in all your application activities. It's really only meant for games, video players and other applications that need to enter this "low profile" state.

随意接受CommonsWare的回答 - 我只是想我给你一点背景资料的主题

Feel free to accept CommonsWare's answer - I just thought I'd give you a bit of background info on the subject.

这篇关于可能使setSystemUiVisibility()影响整个系统,而不仅仅是你的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆