In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
The main content of this article is to explain "what is the method to achieve Android Camera screen drop-down box and navigation bar", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the method to achieve Android Camera screen drop-down box and navigation bar?"
In the process of development, you may sometimes need a daze-proof feature to prevent users from missing return keys, home keys, drop-down boxes, and so on. Next we need to block these buttons. First look at the code:
/ * hide virtual key * / public static void hideNavigation (Activity context) {if ((Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB)) {Logger.get () .d ("myth hideNavigation" + context.getClass () .getSimpleName ()) Context.getWindow () .getDecorView () .setSystemUiVisibility (View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | | View.SYSTEM_UI_FLAG_IMMERSIVE) | }} / * hide virtual key * / public static void hideNavigation (View view) {if ((Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB)) {Logger.get () .d ("myth hideNavigation" + view.getClass () .getSimpleName ()) / / | View.SYSTEM_UI_FLAG_FULLSCREEN view.setSystemUiVisibility (View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE) }} / * Show virtual key * / public static void showNavigation (View view) {if ((Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB)) {Logger.get () .d ("myth hideNavigation" + view.getClass (). GetSimpleName ()); view.setSystemUiVisibility (View.SYSTEM_UI_FLAG_VISIBLE);}
The above code may be a way, but this method is not very stable, it is easy to show it again, and then find a way to implement it. The code is as follows:
/ * hideNavigation * / public static void hideNavigation (Activity context) {statusBarManager = (StatusBarManager) context.getSystemService ("statusbar"); int flag = StatusBarManager.DISABLE_HOME | StatusBarManager.DISABLE_BACK | StatusBarManager.DISABLE_SEARCH | StatusBarManager.DISABLE_EXPAND; statusBarManager.disable (flag);} public static void showNavigation () {if (statusBarManager! = null) statusBarManager.disable (StatusBarManager.DISABLE_NONE);}
It is estimated that the class StatusBarManager cannot be found. If you compile with Android source code, you can ok the import package:
Import android.app,StatusBarManager
If you are not compiling the android source code, you can use the reflection mechanism to do this, as follows:
Private void disableStatusBars () {Object service = getSystemService ("statusbar"); try {Class statusBarManager = Class.forName ("android.app.StatusBarManager"); Method expand = statusBarManager.getMethod ("disable", int.class); expand.invoke (service, 0x00010000);} catch (Exception e) {e.printStackTrace () }} at this point, I believe you have a deeper understanding of "what is the way to achieve Android Camera screen drop-down box and navigation bar". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.