|
|
(9 intermediate revisions by 3 users not shown) |
Line 1: |
Line 1: |
| To hide the status bar and navigation bar, the following APIs are provided.
| | {{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/other-development/display-full-screen-api}} |
| Note that after calling the API, the status bar or navigation bar is hidden or displayed not only in your application, but also throughout 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 >
| |