Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(android) Added option to turn on/off fullscreen mode in Android #634

Merged
merged 3 commits into from
Mar 24, 2020

Conversation

PDLMobileApps
Copy link
Contributor

@PDLMobileApps PDLMobileApps commented Feb 27, 2020

Platforms affected

Android

Motivation and Context

Resolves #598 #526 #469

Link to the issue: #598

Description

This PR adds a new Android option to fix bug #598
The new option (fullscreen - yes/no) enables/disables the fullscreen WebView on Android. The default value is no.

Testing

Testing was done manually as I am not sure on how to automate it.

  1. Created a new Cordova test app using cordova-plugin-inappbrowser.
  2. Executed:
    cordova.InAppBrowser.open(url, "_blank", "");
    and verified the WebView is not opening in fullscreen mode.
  3. Executed:
    cordova.InAppBrowser.open(url, "_blank", "fullscreen=no");
    and verified the WebView is not opening in fullscreen mode.
  4. Executed:
    cordova.InAppBrowser.open(url, "_blank", "fullscreen=yes");
    and verified the WebView is opening in fullscreen mode.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

Copy link
Member

@timbru31 timbru31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your PR. Could you please revert all the version changes?

package.json Outdated Show resolved Hide resolved
src/android/InAppBrowser.java Outdated Show resolved Hide resolved
Copy link
Member

@timbru31 timbru31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quickly tested this with my Android device, changes work as expected.

@mosabab
Copy link
Contributor

mosabab commented Mar 23, 2020

Quickly tested this with my Android device, changes work as expected.

Hello,

I test this pull from my android studio emulator , but inappbrowser still in full screen mode !!!

I am using fullscreen=no

could you please tell me how to check this to make inappbrowser without full screen ?

@timbru31
Copy link
Member

timbru31 commented Mar 23, 2020

Exactly like you, with the fullscreen=no option. Can you double check that your project uses the git branch and not the npm release?

@mosabab
Copy link
Contributor

mosabab commented Mar 23, 2020

@timbru31 i am using the master version of inappbrowser plugin and i fork it and modify android code to using this for fullscreen
And in inappbrowser settings i set fullscreen=no

But inappbrowser still in full screen mode

(The master version of inappbrowser still not merged with this pull)

@timbru31
Copy link
Member

Yeah you've need to install the plugin from the forked repo:
cordova plugin add https://github.com/PDLMobileApps/cordova-plugin-inappbrowser.git\#bug-598

@mosabab
Copy link
Contributor

mosabab commented Mar 23, 2020

Yes i install the plugin from forked repo as you mentioned

But the problem still in full screen. (Status bar hidden)

Did you see the inappbrowser with status bar (not in full screen)

If yes
Could you please attach screenshot

Thanks

@timbru31
Copy link
Member

Sure:

cordova.InAppBrowser.open("https://google.com", "_blank")
Screenshot_20200323-174545_HelloWorld

cordova.InAppBrowser.open("https://google.com", "_blank", "fullscreen=no")
Screenshot_20200323-174603_HelloWorld

@mosabab
Copy link
Contributor

mosabab commented Mar 23, 2020

I set the option fullscreen to no
But this not work for me, the inappbrowser still in full screen even if i set to no

@mosabab
Copy link
Contributor

mosabab commented Mar 23, 2020

I will check again
Anyway
Thank you for help

Regards

@timbru31
Copy link
Member

Can you please remove the plugins and platforms folder and re-add the Android platform

@mosabab
Copy link
Contributor

mosabab commented Mar 23, 2020

I will try to remove platform and plugins folders and i will tell you if it work

Thanks

@timbru31
Copy link
Member

Did it work for you? @mosabab

@mosabab
Copy link
Contributor

mosabab commented Mar 24, 2020

Did it work for you? @mosabab

Thanks for asking, and sorry for late response.

EXACTLY: THANKS AGAIN

WORK AS EXPECTED.

What to do:

1- I remove the platform. 2- delete plugin folder 3- delete package.json file 4- add platform again.

Thanks

@timbru31 timbru31 merged commit e78ffe7 into apache:master Mar 24, 2020
@timbru31
Copy link
Member

Great, thanks for testing this. PR merged, thanks @PDLMobileApps for your contribution!

expertanswerz pushed a commit to expertanswerz/cordova-plugin-inappbrowser that referenced this pull request Apr 9, 2020
* master:
  docs: replaces outdated transition and presentation style links (apache#662)
  chore: remove deprecated orientation methods (apache#666)
  Fix incorrect TypeScript typings (apache#515)
  [apacheGH-652] add check for openInSystem postNotification (apache#654)
  ci: updates Node.js versions (apache#659)
  chore(npm): improve ignore list (apache#658)
  fix(android): Reset lefttoright if not set (apache#442)
  [android] Correcting the documentation regarding lefttoright opt… (apache#648)
  (android) Added option to turn on/off fullscreen mode in Android (apache#634)
  Android apacheGH-470 InAppBrowser: java.lang.IllegalArgumentException (apache#616)
  breaking(ios): remove UIWebView (apache#635)
  chore(release): 3.2.1-dev
rufiange pushed a commit to jalios/cordova-plugin-inappbrowser that referenced this pull request Apr 15, 2020
…che#634)

* (android) Added option to turn on/off fullscreen mode in Android

* (android) Reverted version changes as requested

* (android) Changing default option value to enabled as per request

Co-authored-by: Alessandro Basso <Alessandro.Basso@PeapodDigitalLabs.com>
@Bhagirath123
Copy link

ionic 3 fullscreen=no is not working i am getting Type '"no"' is not assignable to type '"yes"'.

inappbrowser version :- 3.2.0

@mosabab
Copy link
Contributor

mosabab commented Apr 30, 2020

@Bhagirath123

You should use the master version
Or wait for the next version to see the update of this feature

@jazib-m
Copy link

jazib-m commented May 1, 2020

@mosabab what do you mean use the master version?
I am also getting the same error as @Bhagirath123

@mosabab
Copy link
Contributor

mosabab commented May 1, 2020

@jazib-m

Master version mean the current and development version of the plugin.

So, you can choose the master version in your config.xml like so

<plugin name="cordova-plugin-inappbrowser" spec="https://github.com/apache/cordova-plugin-inappbrowser.git#master>

Where #master is the main and current version of the development.

#3.2.0 is the latest version without merged with fullscreen=no. So this feature not created when the latest version released.

Also, any new features could be found in the development version which is #master

Hope those information help!

Regards

@jazib-m
Copy link

jazib-m commented May 1, 2020

@mosabab It certainly did help, I was actually using ionic so I had to remove the plugin which was already installed

cordova plugin remove inappbrowser

and then reinstall from the specific branch

cordova plugin add https://github.com/apache/cordova-plugin-inappbrowser.git#master

and it worked thank you!
when do you think is the next release coming up ?

@mosabab
Copy link
Contributor

mosabab commented May 1, 2020

@jazib-m

Really i don't know the eaxtct time.

You can always keep updated from github notifications by email in your profile settings to check about new versions for this plugin or by visit the plugin page daily.

Regards

@rafasegat
Copy link

Hi, that's great. But now the statusbar is just black background. WOuld have a way to change the background or set to be light bg/dark content? I already tried StatusBar plugin but is not working...

@tehmaestro
Copy link

Hi, I have a problem. I'm using fullscreen no, but this is how it appears
Screenshot_20200619-134220_Dev

Any help? Thank you so much.

@mosabab
Copy link
Contributor

mosabab commented Jun 19, 2020

@tehmaestro

What is the version of this plugin you used?

Do you use v4.0.0 ?

@tehmaestro
Copy link

Yup, I'm on latest. I even installed from master to make sure.
The thing is, I have this in AndroidManifest

android:theme="@android:style/Theme.DeviceDefault.NoActionBar"

but other than that, I'm not using anything else that could affect the status bar. I do not use the statusbar plugin. I'm trying to find the issues, but I am definitely lost a bit :)

@sardapv
Copy link

sardapv commented Sep 9, 2020

it just colours black status bar..I change to blue, but this mode sets it to black

@mosabab
Copy link
Contributor

mosabab commented Sep 9, 2020

it just colours black status bar..I change to blue, but this mode sets it to black

Yes the background is always black even if you set to other colors, maybe someone with experience with java code can modify it to use custom colors instead of only black.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] Statusbar disappear after inappbrowser window opened (go in full screen)
9 participants