You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by kicktheken <gi...@git.apache.org> on 2015/04/24 00:00:09 UTC

[GitHub] cordova-android pull request: CB-8902: use immersive mode when ava...

GitHub user kicktheken opened a pull request:

    https://github.com/apache/cordova-android/pull/175

    CB-8902: use immersive mode when available and "fullscreen" is set to 'true'

    "Fullscreen" preference set to 'true' in the config.xml should hide the navigation bar on android devices that support immersive mode.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kicktheken/cordova-android master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-android/pull/175.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #175
    
----
commit 1efc05d3e81523750c74753efcbaf26aaac6b6f0
Author: Kenneth Chan <ke...@loqheart.com>
Date:   2015-04-23T21:40:37Z

    use immersive mode when available and "fullscreen" is set to 'true'

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-8902: use immersive mode when ava...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-android/pull/175


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-8902: use immersive mode when ava...

Posted by agrieve <gi...@git.apache.org>.
Github user agrieve commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/175#discussion_r29046516
  
    --- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
    @@ -115,8 +116,24 @@ public void onCreate(Bundle savedInstanceState) {
                 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                         WindowManager.LayoutParams.FLAG_FULLSCREEN);
             } else if (preferences.getBoolean("Fullscreen", false)) {
    -            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    +
    +            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
    +            {
    +                setSystemUiVisibilityMode(getWindow());
    +                getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
    --- End diff --
    
    I don't think this listener should be necessary. According to:
    https://developer.android.com/training/system-ui/immersive.html
    
    setting IMMERSIVE_STICKY should take care of re-entering fullscreen.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-8902: use immersive mode when ava...

Posted by kicktheken <gi...@git.apache.org>.
Github user kicktheken commented on the pull request:

    https://github.com/apache/cordova-android/pull/175#issuecomment-96905303
  
    I've gotten rid of the listener and used the suggested approach from the Android docs to keep immersive mode.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-8902: use immersive mode when ava...

Posted by agrieve <gi...@git.apache.org>.
Github user agrieve commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/175#discussion_r29046696
  
    --- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
    @@ -130,6 +147,18 @@ public void onCreate(Bundle savedInstanceState) {
                 cordovaInterface.restoreInstanceState(savedInstanceState);
             }
         }
    +
    +    private void setSystemUiVisibilityMode(Window window) {
    --- End diff --
    
    If you're going to pass in the window, then you should make this method static.
    If you're going to call it "set...Mode", then it should accept the mode as a parameter.
    Really though, hoping you don't need the listener so that you don't need a helper at all.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-8902: use immersive mode when ava...

Posted by pwnall <gi...@git.apache.org>.
Github user pwnall commented on the pull request:

    https://github.com/apache/cordova-android/pull/175#issuecomment-99301712
  
    I look forward to using this! :heart: 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-8902: use immersive mode when ava...

Posted by agrieve <gi...@git.apache.org>.
Github user agrieve commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/175#discussion_r29046647
  
    --- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
    @@ -115,8 +116,24 @@ public void onCreate(Bundle savedInstanceState) {
                 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    --- End diff --
    
    SetFullscreen is deprecated, but we shouldn't make it behave differently from "Fullscreen". How about changing this to:
    
        if (SetFullscreen) {
          Log();
          preferences.set("Fullscreen", true);
        }
        if (Fullscreen) {
          ...
        }


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-android pull request: CB-8902: use immersive mode when ava...

Posted by agrieve <gi...@git.apache.org>.
Github user agrieve commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/175#discussion_r29046326
  
    --- Diff: framework/src/org/apache/cordova/CordovaActivity.java ---
    @@ -130,6 +147,18 @@ public void onCreate(Bundle savedInstanceState) {
                 cordovaInterface.restoreInstanceState(savedInstanceState);
             }
         }
    +
    +    private void setSystemUiVisibilityMode(Window window) {
    +        final int uiOptions =
    +                    View.SYSTEM_UI_FLAG_LAYOUT_STABLE
    --- End diff --
    
    Are these LAYOUT flags really necessary? (if so, add a comment explaining why)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org