`
lijuanabc
  • 浏览: 125814 次
社区版块
存档分类
最新评论

Android4: Status bar or System UI

 
阅读更多

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_FULLSCREENflag. 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:

  • TheSYSTEM_UI_FLAG_LOW_PROFILEflag replaces theSTATUS_BAR_HIDDENflag. 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.
  • TheSYSTEM_UI_FLAG_VISIBLEflag replaces theSTATUS_BAR_VISIBLEflag to request the system bar or navigation bar be visible.
  • TheSYSTEM_UI_FLAG_HIDE_NAVIGATIONis 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.OnSystemUiVisibilityChangeListenerto be notified when the visibility of the system bar or navigation bar changes.

See theOverscanActivityclass for a demonstration of different system UI options.

分享到:
评论

相关推荐

    SystemUI StatusBar流程梳理

    SystemUI StatusBar流程梳理 SystemUI 中的 StatusBar 是一个重要的组件,负责显示系统状态信息和提供交互...通过对 StatusBar 的流程梳理,可以更好地理解 SystemUI 的内部机制,并更好地开发和维护 Android 系统。

    Android 4.0 ICS SystemUI浅析——StatusBar工作流程之时间日期设置

    在Android系统中,SystemUI是用户界面的重要组成部分,它包含了状态栏(StatusBar)、通知面板(Notification Panel)等关键元素。本文将重点解析Android 4.0 Ice Cream Sandwich (ICS) 系统下的SystemUI,特别是Status...

    android systemUI 学习资料

    在 Tablet 或 TV 设备中,SystemUI 还包括 CombinedBar,which combines the StatusBar and NavigationBar. SystemUI 的启动流程可以分为以下几个步骤: 1. 启动流程代码路径:frameworks/base/packages/SystemUI...

    SystemUI_StatusBar分析图片

    在Android系统中,SystemUI是用户界面的重要组成部分,它包含了状态栏(StatusBar)、通知面板(Notification Panel)等关键元素。本篇文章将详细分析Android 4.0冰淇淋三明治(Ice Cream Sandwich,简称ICS)中的SystemUI...

    Android8.1 SystemUI源码

    在Android系统中,SystemUI是用户界面的核心组成部分,它负责管理状态栏、通知中心、快速设置等关键功能。本文将深入探讨Android 8.1版本的SystemUI源码,介绍其结构、工作原理以及如何利用提供的gradle配置进行开发...

    如何隐藏Android4.0及以上版本的ActionBar、NotificationBar、StatusBar、SystemBar、TitleBar

    ### 如何隐藏Android 4.0及以上版本的ActionBar、NotificationBar、StatusBar、SystemBar、TitleBar 在Android应用开发过程中,有时为了实现特定的设计效果或界面需求,开发者可能需要隐藏某些系统组件,如...

    android 禁用statusBar demo

    在Android 6.0(API级别23)及以上版本,应用需要在运行时请求敏感权限,例如SYSTEM_ALERT_WINDOW,这使得在不获取该权限的情况下禁用statusBar变得更具挑战性。但是,我们可以通过创建一个透明或半透明的悬浮窗来...

    android 7.0 SystemUI

    Android 7.0 SystemUI是Android操作系统用户界面的重要组成部分,主要负责系统级别的UI元素和交互。在Android系统架构中,SystemUI位于应用层与系统服务层之间,它提供了通知中心、状态栏、快速设置面板、锁屏界面...

    原生android SystemUI源码

    1. **StatusBar**: 状态栏是Android手机屏幕顶部的一条横条,显示时间、电池状态、网络信号等信息,并提供滑动打开通知中心的入口。状态栏的源码中包含了对各种图标、指示器以及下拉菜单的管理。 2. **...

    android原生systemUI源码4.2.2

    在Android系统中,SystemUI是用户界面的重要组成部分,它包含了状态栏、通知栏、快速设置面板等关键元素的实现。Android 4.2.2版本的SystemUI源码为我们提供了深入理解Android UI系统工作原理的宝贵资料。接下来,...

    SystemUI状态栏和导航栏的讲解

    2. `NotificationIconContainer`(`com.android.systemui.statusbar.phone.NotificationIconContainer.java`)是通知图标的容器,它包含所有待显示的通知图标。 3. `StatusIconContainer`(`...

    android403隐藏statusbar.doc

    在Android开发中,隐藏状态栏(StatusBar)是一个常见的需求,特别是在全屏应用或者特定界面设计中。`android403隐藏statusbar.doc`这个文档似乎描述了如何在Android系统中实现这一功能。以下是对相关知识点的详细...

    SystemUI学习笔记

    SystemUI之StatusBar和Notification文档详细阐述了如何设计和实现状态栏,包括图标的设计规范、动态更新、以及与应用交互的机制。状态栏图标的添加更新及删除.png图片可能展示了如何在代码中添加、修改和移除状态栏...

    Android 4.4 SystemUI

    Android 4.4 SystemUI是Android操作系统用户界面的关键组成部分,主要负责系统级别的通知栏、状态栏、快速设置面板等核心交互界面的实现。这个源码是Android 4.4(KitKat)版本的原始代码,对于开发者来说,它是深入...

    自定义下拉菜单界面仿systemui的下拉菜单

    4. **集成到SystemUI**:将自定义Behavior集成到SystemUI的相应部分。这可能涉及修改布局文件、添加新视图以及更新事件处理逻辑。 5. **编译和测试**:编译修改后的源码,并在模拟器或真实设备上进行测试。 6. **...

    SystemUI-1:Android SystemUI源代码SystemUI源码分析

    1. **SystemUI组成**:SystemUI由多个组件构成,如StatusBar(状态栏)、NotificationPanel(通知面板)、QuickSettings(快速设置)等。这些组件通过Binder机制与其他系统服务进行通信,实现对用户界面的控制。 2....

    Android 13 SystemUI 源码

    在Android系统中,SystemUI是用户界面的重要组成部分,它包含了状态栏、通知面板、快速设置等关键组件。Android 13的SystemUI源码为我们提供了深入理解系统UI工作原理的机会,这对于开发者来说是一份宝贵的资源,有...

    SystemUI QuickSettings流程梳理

    super_notification_shade.xml 中包含 status_bar_expanded.xml,status_bar_expanded.xml 中包含 qs_panel.xml,qs_panel.xml 即为 SystemUI 上的快捷设置区域控件id(</com.android.systemui.qs.QSContainerImpl>...

    AndroidP_SystemUI下拉栏全屏覆盖NavigationBar导航栏

    AndroidP横屏项目,修改SystemUI下拉栏全屏显示,并覆盖NavigationBar导航栏之上,原博客 https://blog.csdn.net/shusuanly/article/details/115264404

    SystemUI(导入到Eclipse,可以正常运行)

    2. SystemUI组件:SystemUI包含了各种UI组件,如Status Bar、Notification Panel、Quick Settings Tiles等,它们提供了系统级别的通知、控制和状态显示。 3. Eclipse集成开发环境:Eclipse是Android早期常用的开发...

Global site tag (gtag.js) - Google Analytics