unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.76k stars 706 forks source link

[Android] `SoftInput.AdjustResize` Not Working like it should #9148

Open Soap-141 opened 2 years ago

Soap-141 commented 2 years ago

Current behavior

I'm trying to create a chat control but the Android SoftInput.AdjustResize behavior is only working the first time we open the keyboard.

Animation_42

Expected behavior

The layout should be resized every time the keyboard is open.

How to reproduce it (as minimally and precisely as possible)

  1. Download ChatPOC.zip
  2. Open the solution
  3. Start the application on Android
  4. Click on the TextBox at the bottom
  5. Notice the the correct behavior
  6. Close the keyboard
  7. Do step 4 again
  8. Notice the incorrect behavior

Workaround

No response

Works on UWP/WinUI

No response

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

Affected platforms

Android

IDE

Visual Studio 2022

IDE version

17.2.5

Relevant plugins

No response

Anything else we need to know?

No response

jeromelaban commented 2 years ago

Make sure to take a look first at this property, defined by default in uno apps: https://github.com/unoplatform/uno/blob/1cbc1340b62aa8f09128c12666f59d57ea3dc296/src/SolutionTemplate/UnoSolutionTemplate/Droid/MainActivity.cs#L12.

Soap-141 commented 2 years ago

@jeromelaban AdjustPan is not what I'm looking for because it will push my list and my command bar therefor it will hide my command bar. Also AdjustPan doesn't push my layout high enough. Animation_44

jeanplevesque commented 2 years ago

Here's a description of the ideal behavior that we're aiming for when the keyboard opens:

  1. The whole input area is visible (not cropped).
  2. The list of messages shows the latest messages (the bottom of the list).
  3. The top bar with the back button stays visible.

That's pretty much what other chat apps do (Discord, Messenger, etc.).