Controls for system UI visibility
Since the early days of Android, the system has managed a UI component known as thestatus bar, which resides at the top of handset devices to deliver information such as the carrier signal, time, notifications, and so on. Android 3.0 added thesystem
barfor tablet devices, which resides at the bottom of the screen to provide system navigation controls (Home, Back, and so forth) and also an interface for elements traditionally provided by the status bar. In Android 4.0, the system provides a new type
of system UI called thenavigation bar. You might consider the navigation bar a re-tuned version of the system bar designed for handsets—it provides navigation controls for devices that don’t have hardware counterparts for navigating the system, but
it leaves out the system bar's notification UI and setting controls. As such, a device that provides the navigation bar also has the status bar at the top.
To this day, you can hide the status bar on handsets using theFLAG_FULLSCREEN
flag.
In Android 4.0, the APIs that control the system bar’s visibility have been updated to better reflect the behavior of both the system bar and navigation bar:
-
The
SYSTEM_UI_FLAG_LOW_PROFILE
flag replaces
theSTATUS_BAR_HIDDEN
flag. When set, this flag enables “low profile" mode for the system bar or navigation bar. Navigation buttons dim and other elements in the system bar also
hide. Enabling this is useful for creating more immersive games without distraction for the system navigation buttons.
-
The
SYSTEM_UI_FLAG_VISIBLE
flag replaces theSTATUS_BAR_VISIBLE
flag
to request the system bar or navigation bar be visible.
-
The
SYSTEM_UI_FLAG_HIDE_NAVIGATION
is a new
flag that requests the navigation bar hide completely. Be aware that this works only for thenavigation barused by some handsets (it doesnothide the system bar on tablets). The navigation bar returns to view as soon as the system
receives user input. As such, this mode is useful primarily for video playback or other cases in which the whole screen is needed but user input is not required.
You can set each of these flags for the system bar and navigation bar by callingsetSystemUiVisibility()
on
any view in your activity. The window manager combines (OR-together) all flags from all views in your window and apply them to the system UI as long as your window has input focus. When your window loses input focus (the user navigates away from your app,
or a dialog appears), your flags cease to have effect. Similarly, if you remove those views from the view hierarchy their flags no longer apply.
To synchronize other events in your activity with visibility changes to the system UI (for example, hide the action bar or other UI controls when the system UI hides), you should register aView.OnSystemUiVisibilityChangeListener
to
be notified when the visibility of the system bar or navigation bar changes.
See theOverscanActivityclass for a demonstration of different system UI options.
分享到:
相关推荐
Android 4.0 ICS SystemUI浅析——StatusBar工作流程之时间日期设置文中涉及到的图片以及代码。 文章地址:http://blog.csdn.net/yihongyuelan
StatusBar流程梳理-F
Android 4.0 ICS SystemUI浅析——StatusBar结构分析中所涉及到的全部图片。
SystemUI:StatusBar,Notification,PowerUI,SettingsUI,Recents,RingtonePlayer..
AndroidP横屏项目,修改SystemUI下拉栏全屏显示,并覆盖NavigationBar导航栏之上,原博客 https://blog.csdn.net/shusuanly/article/details/115264404
Android5.1 SystemUI整体功能结构图, 代码结构,SystemUI类图; 执行流程: SystemUI启动; NavigationBar导航栏; RecentsActivity最近的APP; StatusBar加图标AddIcons;Icons排列规则; QuickSettingPanel快捷...
Android系统定制-SystemUI-下拉状态栏快捷设置新增选项(自动亮度&静音)_Patch 文章链接:https://blog.csdn.net/qq_33750826/article/details/122829104
前面AndroidQ SystemUI之启动 中分析了SystemUI启动过程中会加载一个config数组,里面定义了SystemUI的重要的类,之后遍历此数组,以此调用其Start方法,我们就从StatusBar.start方法开始分析锁屏相关的流程 Status...
Android 4.4 (KitKat) introduced translucent system UI styling for status bar, then Android 5.0 offers simple ways to enable translucency in Activity( android:windowTranslucentStatus) and tint color ...
icon_mobile_data_off" /> <com.android.systemui.statusbar.lonyii.MobileDataSettingButton android:textSize="1.0dip" android:textStyle="normal" android:textColor="#ffffffff" android:gravity="center_...
Android 8.1实现底部虚拟...frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
Part 4: Content Providers Part 5: Lists and Adapters Part 6: Broadcast Receivers Part 7: App Widgets Part 8: Networking and the Web (HTTP) Part 9: Live Wallpaper and Handlers Summary Chapter 7 Android...
Google’s Android operating-system has taken the industry by storm, going from its humble beginnings as a smartphone operating system to its current status as a platform for apps that run across a ...
StatusBar 和 NavigationBar。 颜色是通过使 SystemUI bar(s) 变成。 SystemUI 栏变为半透明,并在其后面显示彩色View ,使其看起来有色。 由于使用系统 API 来实现此功能,大多数情况都已被漂亮的混合动画和良好的...
本文实例讲述了Android编程实现禁止状态栏...路径:==/frameworks/base/packages/SystemUI//src/com/android/systemui/statusbar/phone/PhoneStatusBar.Java== 通过在PhoneStatusBar.java类中注册一个广播的方式来实现
发布博客文章:https://pspdfkit.com/blog/2016/clean-statusbar-with-systemui-and-quickdemo/要求Android SDK(API 25)Android Studio 2.2+ adb(用于安装应用程序并授予所需的权限)Android模拟器或运行棉花糖...
mt6572平台,内置mp4到内置T卡。\src\com\android\systemui\statusbar\phone
状态栏图标的布局文件在frameworks\base\packages\SystemUI\res\layout\status_bar.xml,主要包括通知,定位,蓝牙,信号,时间,电池等图标,只要在相应的布局文件中加入属性android:visibility=invisible 或者...
Android从4.4(KitKat) 开始进行了一些视觉上的改善和提升,其中包括让状态栏(Status Bar)和下方导航栏(Navigation Bar)进行半透明处理,可以使APP内容向上下延伸,使整个画面的利用度大幅度提升,本篇就来说说这个...
底部的BACK HOME 还有电池WIFI的那一条STATUS_BAR设置全屏后怎么也去不掉,查找资料后,发现一个比较好的方法,在此分享 第一种方式(程序代码): 在OnCreate里添加一行语句 代码如下:getWindow().getDecorView()....