React native Scrollview/flex layout behaves inconsistent after minimizing the app on Android - android-softkeyboard

I’m taking my first step in react native land and trying to understand the layouting in regards to the soft keyboard.
I’ve created a new react project via rect-native init and written the following component:
<ScrollView style={{flex: 1}} contentContainerStyle={{flex: 1, borderColor: 'green', borderWidth: 10}}>
<TextInput/>
<View style={{flex: 1, borderColor: 'blue', borderWidth: 10}} />
</ScrollView>
The result looks as expected and when I touch the input field the keyboard covers my view.
However, if I minimise the app by pressing the square/overview button and then choose the app again the view will adapt it’s height so the keyboard doesn’t cover the view.
My findings so far is that:
- This only happens on Android
This only happens if a scrollView is present
Playing around with android:windowSoftInputMode in the android manifest doesn’t seem to affect the issue.
I’ve tried react-native: 0.39.0 / react: 15.4.1 and react-native: 0.33.0 / react: ~15.3.0 and it’s present in both
It’s however not reproducible in rnplay (0.33) : https://rnplay.org/apps/kr-OQw
I’ve tried on a sony experia z5compact (android 6.0.1), nexus 5x and samsung galaxy s6 (android 6.0.1) and it’s present in all.
I assume the resizing after minimising is an bug or am I missing something here? Is there a workaround to this issue?

The default android:windowSoftInputMode is adjustUnspecified which causes this problem.
You can have the screen resize all the time if you set android:windowSoftInputMode:"adjustResize" (This is the desired way according to the docs).
You can also follow the bug I opened for react-native.

Related

Ionic / Capacitor flickering screen and refresher not working

I am developing an app, and it works 100% in android. In IOS I have 2 issues:
refresher does not work
<ion-refresher slot="fixed" #ionRefresh="doRefresh($event)">
there is a flicker when I touch the screen (may be related to background? I read some old posts about that)
ion-content.background{
--background: url(/bg.png) 0 0/100% 100% no-repeat;
}
I don't believe its relevant to this issue, but I am using vuejs.
I tested in various desktop browsers and it works as well.
So, we had 2 things here, and I thank #johnborges for following up
it was necessary to add the pullingIcon
link for Ionic docs
and the relevant paragraph
Using the iOS native ion-refresher requires setting the pullingIcon
property on ion-refresher-content to the value of one of the available
spinners. See the Spinner Documentation for accepted values. The
pullingIcon defaults to the lines spinner on iOS. The spinner tick
marks will be progressively shown as the user pulls down on the page.
the flicker, based on this link from stackoverflow I added a CSS DIV element instead of styling ion-content. It worked. I had to do a secodn CSS trick because one of my pages had fullpage slides and padding, but after that it worked

Unity WebGL Mobile browser workaround and keyboard input fix?

Hey everyone so I read that unity doesn't really support mobile browsers for WebGL games. im using 2020.1.4.And sure enough, the game gets a bit distorted by not being scaled properly. it's like the camera is bigger so it shows on the screen that blue color. I tried some things, setting width and height to auto or removing config.devicePixelRatio = 1; as suggested by a friend but nope! still looks horrible! And if that wasn't enough the keyboard doesn't show up when clicking on form fields. i tried this one
https://github.com/eforerog/keyboardMobileWebGLUnity
which displayed an error when pressed on and this one
https://github.com/dantasulisses/WebMobileInputFix which just didn't even compile!
Any ideas, please?
I did my research and tried every plugin I could find. I used Unity 2020.3.28f1 and tested both on Android-phone and iPhone.Here is my report.
These plugins don't work:
https://unitylist.com/p/f58/Unity-webgl-inputfield
https://github.com/eforerog/keyboardMobileWebGLUnity
https://github.com/dantasulisses/WebMobileInputFix
This plugin works, but you should use different settings for IOS and Android on same input field game object. If you use "prompt", it works for IOS only, and "overlay" works for Android only. Look for documentation in page:
https://github.com/unity3d-jp/WebGLNativeInputField
And this plugin works best at the moment. Yes, it is a bit ugly though, but it works.
https://github.com/kou-yeung/WebGLInput
And there is a fix for Unity 2021 for it:
https://github.com/kou-yeung/WebGLInput/releases/tag/1.0
There's a keyboard that overlays, when using it you just need to tap the notification to access it and then click the "back" button to hide it https://play.google.com/store/apps/details?id=com.fishstix.gameboard
I made this project that simply recreates a keyboard using buttons in unity.
I implemented it in a WebGL build successfully.
https://github.com/thetimeste/WebGL-Build-Keyboard-Unity.git
I would recommend using the native js window.prompt() fields as of writing. They have great cross-platform support, allow for extra features like special characters, emojis, copy and paste etc. and are pretty easy to set up. Once (or honestly if ever) Unity adds their own reliable implementation you can easily remove this lightweight implementation.
Create a .jslib file that has a function opening a window.prompt(description, currentText)
Return the result at the end of that function back to a unity object with a recipient script
Make a derivation from Unity's event system overwriting the OnApplicationFocus(bool focus) function (leaving it empty), to fix a sneaky Chrome Android bug.
That's it. The result should look something like in this demo: https://pop.demo.neoludic.games
If you want to save some development time on a feature that really should just be native in Unity, you can also check out my plugin based on the method above. https://neoludic-games.itch.io/pop-input
I also need to enable mobile virtual keyboard for running webgl on mobile device.
I've tried the code from your mentioned url. It gives you some idea on how to do
it, but the code are totally buggy and unusable. Now I am trying to implement it
by myself.

Customizing page transitions with Convertigo

I am currently building a cross-platform mobile application with Convertigo Studio, and the iOS default transition between pages does not fit well with the design : I would like the transitions between pages in the iOS app to be identical to the Android ones.
I have narrowed the problem to the Ionic navCtrl.push() call, probably made by the Convertigo PushPage component.
According to this blog post, it is possible to force transitions with the animation field of the call configuration object :
this.navCtrl.push(MyPageComponent, null, {animate: true, animation: "transition-android"});
Convertigo Studio allows me to edit the animate and duration fields, but not animation.
Without patching the Studio, is there a way to override the iOS default page transition ?
Yes in 7.5.7 version Convertigo studio does not expose the transition type property for push pages. This has been added in 7.6
Nevertheless, you can customize your template (The mobilebuildet_tpl_7_5_7 project in the workspace) the add a default transition into the app module this way :
in ionicTpl/src/app/app.module.ts
Change line
IonicModule.forRoot(MyApp, {}, deepLinkConfig)
to
IonicModule.forRoot(MyApp, {
pageTransition: 'ios-transition'
}, deepLinkConfig)
This way, all page transitions can be set to iOS or Android mode whatever the app runs on.
Do not forget to reload your project (Right click on project->Reload your project) to have the MobileBuilder to regenerate the Ionic project sources and re-execute the app viewer to rebuild the app.
Hope That Helps !

Sencha Touch 2 textfield's focus issue in iOS 7

I'm having an issue with textfields in Sencha Touch 2, this is only occurring in iOS 7 and working fine in iOS 6 and Android.
The issue is when you tap a field the keypad opens but the cursor disappears, it should be focus on selected textfield but it does not. You have to tap the textfield again to focus.
I have checked this issue on iOS 6 and android (on devices as well as on simulators), working fine but not on iOS 7 only.
Is anybody having this issue...?
Is this a bug in sencha or should i missing something, please advice.
Thank you..
I have found this to be directly related to two things:
centered: true
pack: 'center'
When I removed those lines, my app started playing nice. The challenge is to find an alternative way to center your panels.
I spent days figuring this out. Actually there is a problem with Sencha understanding the ViewPort height. In your index.html add a script block with the following code
if (window.device && parseFloat(window.device.version) == 7.0) {
document.body.style.paddingTop = "20px";
Ext.Viewport.setHeight(Ext.Viewport.getWindowHeight() - 20);
}
This does two things for you
It Provides enough space on Top to display the activity bar
It sets the Viewport height to be that of screen height, irrespective of the keyboard being present or not.
Also, If your app works in Portrait and Landscape mode, you will need to add these lines in your Viewport.js (or Main.js)
initialize: function(){
Ext.Viewport.on('orientationchange', 'handleOrientationChange', this, {buffer: 0 });
},
handleOrientationChange: function(){
try{
if (parseFloat(window.device.version) == 7.0) {
Ext.Viewport.setHeight(Ext.Viewport.getWindowHeight() - 20);
}else{
Ext.Viewport.setHeight(Ext.Viewport.getWindowHeight());
}
}catch(e){
// do nothing
}
},
And Yes, Make sure they Keyboard Bounce is TRUE in true (if you are using cordova). This will make sure your field does not get hidden.
Hope this works for you.
add height="device-height" in viewport meta tag, fixes the issue.
ios7 issues with webview focus when using keyboard html

Workaround for webkit bug on iOS5. Bug description: The content of an iframe which has a parent with -webkit-transform: scale(x), is scaled 2 times

I am having some trouble with a webkit bug [1]. Long story short, if an iframe has an ancestor with -webkit-transform: scale(x) the content of the iframe is scaled 2 times.
The platform on which this is happening is iOS5 (both in Safari and UIWebView). I have tested on iOS4, iOS6 and the latest nightly build of webkit and I can not reproduce it there. So the issue seems to be fixed in the newer releases.
I tried the workaround described in one of the bug comments [2] and it does not fix the problem completely. In order for it to work I had to first add -webkit-transform-style: preserve-3d and then inside a timeout add -webkit-transform: scale(x) to the same element. This would have been acceptable, but if any inherited property is changed in one of the iframe's ancestors, the workaround is nullified and the content scaled 2 times again.
Does anybody know any better way to work around this issue ?
Links:
[1] Link to bug : https://bugs.webkit.org/show_bug.cgi?id=15676
[2] Description of workaround : https://bugs.webkit.org/show_bug.cgi?id=15676#c10
I had the same issue and managed to resolve it this way:
webkit-transform: scale(x)
zoom: 1/x
Also you might want to have the same fix for scaling pretty much anything on Android 2.x
I still have an issue though on iOS5.1 that despite content is scaled correctly, if part of it was behind the visible viewport (under overflow: hidden), it still appears blank in scaled iframe.