I've seen countless topics about this, but as for now I cannot find anything working. I have portrait app with a form containing mostly input fields.
I've created a ScrollView and inside content I've added all necessary fields. I've added Vertical Layout Group and Content Size Fitter. Now, when I run the app, content moves nicely, but when I open keyboard it overlaps the content and I cannot see lower input fields when editing them. It doesn't look well. So, I'm looking for a script/plugin to enable this feature for both android and iOS. I've only seen iOS-specific solutions and universal, but none worked for me. I can link all the codes I've found, but I think it'll just create an unnecessary mess. Most of these topics are old and may have worked before, but doesn't work now.
Ideally, I'd prefer a global solution, which just shrinks whole app, when keyboard is opened and expands it back, when keyboard is closed.
Btw. I'm using Unity 2019.2.15f1 and running on Pixel 3XL with Android 10, if that matters.
edit:
I've created small demo project, where you can test Keyboard size script:
https://drive.google.com/file/d/1vj2WG2JA1OHPc3uI4PNyAeYHtuHTLUXh/view?usp=sharing
It contains 3 scripts: ScrollContent.cs - it attaches InputH.cs script to every input field programatically. InputH.cs - it handles starting (OnPointerClick) and ending (onEndEdit) of edit single input field by calling OpenKeyboard/CloseKeyboard from KeyboardSize script. KeyboardSize.cs - script from @Remy_rm, slightly modified (added some logs, IsKeyboardOpened method and my trial of adjust the keyboard scroll position).
The idea looks fine, but there are few issues:
1) "added" height seems to be working, however scrolled content should also be moved (my attempt to fix this is in the last line in GetKeyboard height method, but it doesn't work). It you scroll to the bottom Input Field and tap it, after keyboard is opened this field should be just above it.
2) when I tap second time on another input field, while first one is edited, it causes onEndEdit to be called and keyboard is closed.