- 浏览: 153369 次
- 性别:
- 来自: 深圳
最新评论
-
dawei1980:
请问,解压密码是多少?
Android本地APP集成Mui框架 -
牧羊之人:
Android本地APP集成Mui框架 -
还有也许:
貌似懂了一点。如果onCreate方法中创建了一个db,然后在 ...
Android线程模式(handler,thread,looper) -
chenshijun0101:
header里面怎么更改他的样式呢?急求
android Preference相关样式修改 -
qlraishui:
good
Binder机制分析【三】-service绑定Binder
Controls for system UI visibility
Since the early days of Android, the system has managed a UI component known as the status 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 the system bar for 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 the navigation 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 the FLAG_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 the STATUS_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 the STATUS_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 the navigation bar used by some handsets (it does not hide 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 calling setSystemUiVisibility() 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 a View.OnSystemUiVisibilityChangeListener to be notified when the visibility of the system bar or navigation bar changes.
See the OverscanActivity class for a demonstration of different system UI options.
控制导航栏的显示有两种修改方法:
1.临时修改,通过方法mView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION)方法设置。注意该方法必须放在setContentView(mView)之前,具体代码如下:
2.永久隐藏法。修改系统文件/framework/base/core/res/res/values/config.xml的变量config_showNavigationBar值。如果不起作用,那就是该值被android.content.res.Configuration类的变量navigationHidden所取代,需要修改此值(搜索SystemUI得知,显示导航栏与否是通过方法mWindowManagerService.hasNavigationBar()判断的,该方法的实现是在PhoneWindowManager类里面mHasNavigationBar设置的。)
Since the early days of Android, the system has managed a UI component known as the status 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 the system bar for 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 the navigation 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 the FLAG_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 the STATUS_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 the STATUS_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 the navigation bar used by some handsets (it does not hide 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 calling setSystemUiVisibility() 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 a View.OnSystemUiVisibilityChangeListener to be notified when the visibility of the system bar or navigation bar changes.
See the OverscanActivity class for a demonstration of different system UI options.
控制导航栏的显示有两种修改方法:
1.临时修改,通过方法mView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION)方法设置。注意该方法必须放在setContentView(mView)之前,具体代码如下:
public class HideTestActivity extends Activity implements OnClickListener{ View main ; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); main = getLayoutInflater().from(this).inflate(R.layout.main, null); main.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); main.setOnClickListener(this); setContentView(main); } @Override public void onClick(View v) { int i = main.getSystemUiVisibility(); if (i == View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) { main.setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); } else if (i == View.SYSTEM_UI_FLAG_VISIBLE){ main.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); } else if (i == View.SYSTEM_UI_FLAG_LOW_PROFILE) { main.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); } } }
2.永久隐藏法。修改系统文件/framework/base/core/res/res/values/config.xml的变量config_showNavigationBar值。如果不起作用,那就是该值被android.content.res.Configuration类的变量navigationHidden所取代,需要修改此值(搜索SystemUI得知,显示导航栏与否是通过方法mWindowManagerService.hasNavigationBar()判断的,该方法的实现是在PhoneWindowManager类里面mHasNavigationBar设置的。)
发表评论
-
判断图片是浅色还是深色
2020-03-04 13:23 710首先需要获取 WallpaperManager.FLAG_L ... -
如何将uri转成真实路径地址
2018-10-15 17:38 1122/** * 获取文件选择器选中的文 ... -
备用网址记录
2018-01-08 11:05 397各种开源下载 http://www.mvnjar.com/ ... -
android中touch事件,click事件,longclick事件分析
2016-08-03 15:51 1431针对屏幕上的一个View控件,Android如何区分应当触发o ... -
Android 快速开发系列 打造万能的ListView GridView 适配器
2016-06-27 17:21 633前往 http://blog.csdn.net/lmj6235 ... -
android中的Handler和AsyncTask如何防止内存泄露
2016-06-13 13:55 1583Handler泄露的关键点有两个: 1). 内部类 ... -
[转载]SharedPreferences 存储java对象,很实用
2016-04-14 16:36 1011public void putObject(String ke ... -
Android本地APP集成Mui框架
2016-01-26 14:41 30372.如何在安卓原生APP中 ... -
Android与设计模式浅谈
2015-04-27 10:42 1013Android作为新一代的操作系统,集合着Google ... -
从网页启动Activity
2015-03-24 11:28 1308正好Android SDK 给我们提供了解决方案,在网页中点击 ... -
[转]android shape的使用
2014-10-13 13:30 720shape用于设定形状,可以在selector,layout等 ... -
touch事件分发处理流程
2014-05-23 09:44 790Touch 事件发生时 Activity 的 dispatch ... -
修改标准GSensor相关,是重力感应游戏在平板都可以玩
2013-12-21 11:27 807为什么有些重力感应的游戏不能玩,有些可以玩,主要原因在于fra ... -
Android模拟按键
2013-10-14 14:27 2352如果想要实现类似iphone的悬浮框按钮,那就必须知道如何去模 ... -
android资源适配解析及资源适配优先级规则
2013-10-12 12:41 36361.sw的值是怎么计算得来 ... -
【转】解决Android与服务器交互大容量数据问题
2013-09-02 14:40 2001对于目前的状况来说, ... -
[转载]Android大图裁剪解决办法
2013-04-25 14:29 2052cropimage 可以调用手机自带的com.android ... -
反锯齿办法
2012-12-28 14:14 912在Android中,目前,我知道有两种出现锯齿的情况。 ① ... -
android线程的那些事
2012-11-17 15:36 2255有些时候Thread里面更新UI是可以成功的。 比如在Acti ... -
图像缩放和旋转
2012-11-16 11:20 1162在绘制bitmap时,都会涉及一个参数矩阵Matrix,Mat ...
相关推荐
0001-导航栏添加按钮隐藏虚拟按键,上滑调出虚拟按键
使用ADB命令控制安卓手机(虚拟按键、状态栏)显示隐藏,或者直接禁用。
此功能主要添加frameworks\base\services的功能在此目录下请搜索FEATURE_AUTO_HIDE_NAVIGATIONBAR,frameworks\base\packages\SystemUI下按键添加,需要...隐藏后需要显示导航栏请从下往上滑动,此功能只针对虚拟按键
Android 接口
有些时候,我们需要知道当前手机上是否显示了NavigationBar,也就是屏幕底部的虚拟按键。 比如截屏的时候,要获取屏幕的高度,必须包括NavigationBar的高度。 试过网上的多种方法,但是对那种可以通过手势来显示/...
rk3288 隐藏状态栏和虚拟按键的补丁
Android 4.4之后谷歌提供了沉浸式全屏体验, 在沉浸式全屏模式下, 状态栏、 虚拟按键动态隐藏, 应用可以使用完整的屏幕空间, 按照 Google 的说法, 给用户一种 身临其境 的体验。而Android 5.0之后谷歌又提出了...
应用开机启动,隐藏导航栏和下方虚拟按键,退出时需要输密确认才能退出应用。app 霸屏模式 和app 防卸载功能app。该资源简单有效,请放心下载
2.2.2 代码隐藏类 22 2.3 XAML中的属性和事件 24 2.3.1 简单属性与类型转换器 25 2.3.2 复杂属性 26 2.3.3 标记扩展 28 2.3.4 附加属性 29 2.3.5 嵌套元素 30 2.3.6 特殊字符与空白 32 2.3.7 事件 34 2.3.8 完整的...
这是一个安卓端的口算题卡项目源代码,可以实现以下功能 ①加减乘除四则运算; ②隐藏导航栏和虚拟按键; ③设置计算难度; ④保存和清空最高纪录; ⑤计算错误时出现正确答案提示;
0042 如何继承父类的方法 27 0043 如何实现函数重载 28 0044 类中多态的应用 28 0045 将函数作为参数进行调用 30 2.3 参数与指针 30 0046 通过指针读写数据 30 0047 在过程中使用常量参数 31 0048 在...
0042 如何继承父类的方法 27 0043 如何实现函数重载 28 0044 类中多态的应用 28 0045 将函数作为参数进行调用 30 2.3 参数与指针 30 0046 通过指针读写数据 30 0047 在过程中使用常量参数 31 0048 在...
不在任务栏显示在任务栏中隐藏菜单程序。 使用系统信息框弹出信息时,使用系统默认的信息框,而不使用程序提供的 Office 风格的信息框。 窗口菜单中隐藏“关于”项隐藏菜单窗口系统菜单中的关于菜单项。 ...
不在任务栏显示在任务栏中隐藏菜单程序。 使用系统信息框弹出信息时,使用系统默认的信息框,而不使用程序提供的 Office 风格的信息框。 窗口菜单中隐藏“关于”项隐藏菜单窗口系统菜单中的关于菜单项。 ...
2.2.2 代码隐藏类 22 2.3 XAML中的属性和事件 24 2.3.1 简单属性与类型转换器 25 2.3.2 复杂属性 26 2.3.3 标记扩展 28 2.3.4 附加属性 29 2.3.5 嵌套元素 30 2.3.6 特殊字符与空白 32 2.3.7 事件 34 2.3.8 完整的...
程序可以采用 JAVA 开发,但是因为它的虚拟机 (Virtual Machine) Dalvik ,是将 JAVA 的 bytecode 转成 自 己的格式,回避掉需要付给 SUN 有关 JAVA 的授权费用。 对手机制造者的影响 � Android 是款开源的移动计算...