How to Utilize System API for Full-Screen Display: Difference between revisions

From wizarPOS
(Created page with "For hiding the status bar and navigation bar, the system provides the following API. Please notice that after calling that API, the status bar or navigation bar will hide or...")
 
(Replaced content with "{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/other-development/display-full-screen-api}}")
Tag: Replaced
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
For hiding the status bar and navigation bar, the system provides the following API.
{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/other-development/display-full-screen-api}}
 
Please notice that after calling that API, the status bar or navigation bar will hide or show not only in your app, but also in all the system.
== Permission ==
  android.permission.CLOUDPOS_HIDE_STATUS_BAR
The app declares the permission in the manifest.
 
== API Overview ==
=== <big>HideBars for hiding or showing the status/navigation bar</big> ===
  <syntaxhighlight lang="java">void hideBars(int state)</syntaxhighlight >
set status bar and navigation bar state
 
{|class="wizarpostable"
|-
! scope="row" colspan="2" | Parameters
|-
| state || '''int:''' 1 : hide status bar, 2 : hide navigation bar, 3: hide both, 0: show both.
|}
 
The follows are some snippet code:
<syntaxhighlight lang="java">
//hideBars:
Object service = getSystemService("statusbar");
Class statusBarManager = Class.forName("android.app.StatusBarManager");
Method method = statusBarManager.getMethod("hideBars", int.class);
method.invoke(service, 3);
 
</syntaxhighlight >
 
 
=== <big>GetBarsVisibility</big> ===
  <syntaxhighlight lang="java">int getBarsVisibility();</syntaxhighlight >
get state of status bar and navigation bar.
{|
|-
|}
{|class="wizarpostable"
|-
!  scope="row" colspan="2" | Returns
|-
|  int || The result , 1 : hide status bar, 2 : hide navigation bar, 3: hide both, 0: show both.
|}
 
The follows are some snippet code:
<syntaxhighlight lang="java">
//getBarsVisibility:
Object service = getSystemService("statusbar");
Class statusBarManager = Class.forName("android.app.StatusBarManager");
Method method = statusBarManager.getMethod("getBarsVisibility");
Object object = expand.invoke(service);
</syntaxhighlight >

Latest revision as of 03:24, 8 April 2024

Please visit new link of same subject:

https://smartpossdk.gitbook.io/cloudpossdk/faq/other-development/display-full-screen-api

We're making a move! Our site's content is migrating to a new URL, to provide you with an enhanced browsing experience. Please update your bookmarks accordingly. Thank you for your continuous support!