Open nandukalidindi opened 6 years ago
What if you remove the extension after installing it? Still like you didn't install it? (normal?)
Yes, cordova plugin remove com.flyingsoftgames.xapkreader
removing the plugin brought it back to normal, as in the SoftKeyboard is resizing/pushing the content as expected.
Ok, I found something in plugin.xml.
<config-file target="AndroidManifest.xml" parent="application">
<activity android:name="com.flyingsoftgames.xapkreader.XAPKDownloaderActivity" android:label="@string/app_name" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
</activity>
Maybe something in these config changes is doing this...
But then again, you want the keyboard to be hidden when the downloader bar shows so I am not sure.
Earlier today I tried adding android:windowSoftInputMode="adjustResize"
to the XAPKDownloaderActivity
<activity android:label="@string/app_name" android:name="com.flyingsoftgames.xapkreader.XAPKDownloaderActivity" />
it still does not work.
Can you check to see if anything is changing in the meta headers in the generated html file maybe?
I guess try to see exactly what changes in the two different outputs.
I don't see any HTML files being generated during the installation. Could you please tell which one is it that you meant.
Well, when you create a package, generated stuff goes into a separate directory, right...?
These are the changed/added files. Would you be able to guess which could possibly cause this?
Maybe in the manifest xml? Or possibly the config.xml.
You mean when I do cordova build android
? I did not yet do that step yet, it's failing right here. Please excuse me if I am not providing you exact inputs, I am a total beginner with Cordova and Android.
config.xml
AndroidManifest.xml
android/res/xml/config.xml
I don't feel any of these caused that.
Have you ever faced this similar problem on one of your apps where you used your plugin?
I don't remember. I just set the meta tag so it does not resize.
Oh, I get it.... you need the opposite...
How about this? Try and see if you can get it to work... https://stackoverflow.com/questions/31407367/on-screen-keyboard-resizes-app-when-an-input-box-is-selected-apache-cordova-visu
But this is def. an issue that should be resolved somehow without it, probably.
Yeah, I can install another plugin, not at all a problem. Let me check it and get back to you tomorrow? Keyboard.shrinkView(true);
this addition hopefully resolves it temporarily.
Thank you so much for the discussion though.
Sure. Let me know how it goes!
So, I should add Keyboad.shrinkView
after the onload
in my JS file? Or is it somewhere in the Android app?
Unsure. Try both ways (after the onload and before you show the form) I guess...
Seems like the shrinkView
method is only supported in iOS
https://www.npmjs.com/package/cordova-plugin-keyboard#keyboardshrinkview
Unclear.... I dunno, there must be a way... maybe just meta tags.....
Could you please share the snippet where you add the <meta>
tag if possible? I will spend more time anyway, so will let you know if anything pans out.
check the options for the viewport meta tag.
@agamemnus
@Override public void onCreate (Bundle savedInstanceState) {
if (cordovaActivity != null) {
// <Workaround for Cordova/Crosswalk flickering status bar bug./>
// cordovaActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
// cordovaActivity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
// <Workaround for Cordova/Crosswalk flickering status bar bug./>
}
.
.
.
.
}
Commenting the workaround to be full screen in XAPKDownloaderActivity.java
in your source code did the trick and now it is working as expected. The SoftKeyboard is pushing the content up while typing.
Once again, thank you for the discussion and the awesome plugin. Cheers!
Well, I need to fix this somehow.
Can you clarify something for me?
You said: "However, recently I found out that after the installation of the plugin the SoftKeyboard that shows up while entering into textboxes is not resizing/pushing the content, rather the content just stays as is. This could be a problem for me because I would like the users to see what they are typing on the textbox."
So you are saying that you want the content to be resized and bigger, but your screenshots suggest you DON'T want the content to be resized. Was it a typo?
I want the user to be able to see what she/he is typing on the textbox. In my case the softkeyboard just blocks the textbox(AFTER INSTALLATION screenshot) without bringing the textbox to focus like in the BEFORE INSTALLATION screenshot. May be I should remove the resizing
word to avoid confusion.
But after installation, the app does seem to resize and bring something else to focus, and not the textbox that the user was typing in?
???????
The red rectangle is causing a lot of confusion for me.
What if you change the code to as follows:
if (cordovaActivity != null) {
// <Workaround for Cordova/Crosswalk flickering status bar bug./>
int original_FLAG_FULLSCREEN = WindowManager.LayoutParams.FLAG_FULLSCREEN
cordovaActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
cordovaActivity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, original_FLAG_FULLSCREEN);
// <Workaround for Cordova/Crosswalk flickering status bar bug./>
}
Red rectangle is just to hide some private content. But as you can see the login form starts right after the red rectangle which is supposed to be pushed up like in the first screenshot.
Before commenting out the code in XAPKDownloaderActivity.java
the view stays as is without moving, so I was not able to see what I was typing in the textbox. Sorry if this is too confusing. I am currently working on another laptop, let me try that and let you know in about 4 hours?
Great, thanks.
The snippet you provided 2 comments above did not work. I checked it a while back.
OK. I'll investigate further to see if I can solve this without commenting out that code. Thanks.
This is related to https://github.com/agamemnus/cordova-plugin-xapkreader/issues/117.
The resize behavior is connected to the visibility of the status bar. I can reproduce this by calling StatusBar.hide()
manually from the chrome dev tools remote device console. After the status bar is hidden, the app isn't resized anymore.
Edit: One can also see that @nandukalidindi 's screenshot after the installation of the plugin has no status bar.
I know this issue is old, but I ran into this same bug today, and I'm kicking myself for not checking here before spending the majority of the day tracking it down and fixing it.
So, @nandukalidindi was on the right track.
The setting android:windowSoftInputMode="adjustResize"
in the AndroidManifest.xml
file is what allows the keyboard to resize the view, so that it doesn't overlap the content. However, this setting is ignored if the app is in fullscreen mode.
The code that (s)he points out forces the app into fullscreen mode, but doesn't ever change it back if applicable, so it stays that way and thus breaks the soft keyboard setting. I was able to fix it by first checking/storing the current setting, and changing it back when the activity is finished, if it changed.
Here is the pull request: https://github.com/agamemnus/cordova-plugin-xapkreader/pull/139
My knowledge of Android development using Java is limited, so this should definitely be given some scrutiny. However, my own testing seems to show that it's working.
Okay. I also noticed you added another check. Thank you.
First off, that you for this wonderful plugin!
I successfully am able to get it working with the expansion files and published 2 apps thanks to this.
However, recently I found out that after the installation of the plugin the SoftKeyboard that shows up while entering into textboxes is not pushing the content, rather the content just stays as is. This could be a problem for me because I would like the users to see what they are typing on the textbox.
BEFORE INSTALLATION:
AFTER INSTALLATION
The textbox is infact behind the SoftKeyboard. The red rectangle is just some text. The white form starts right below the rectangle and that contains the textbox to be typed into.
I tried debugging it before and after the plugin installation and I am positive that this happens only after the installation.
Is there a chance that the resizing is deliberately disabled through the extension?
Thanks.