wordpress-mobile / AztecEditor-Android

A reusable native Android rich text editor component.
Mozilla Public License 2.0
673 stars 114 forks source link

Update compile sdk to 33 #1037

Closed irfano closed 1 year ago

irfano commented 1 year ago

Fix

This updates compileSdk to 33 and makes the required changes.

Test

Being able to build and basic smoke test should be enough. Updating LayoutParams.SOFT_INPUT_ADJUST_RESIZE may be worth a special test. To test:

  1. Run AztecDemo.
  2. Scroll down and find the HTML block (It's shown as "?", below "if (value == 5) printf(value)")
  3. Tap the HTML block and type a long text to increase the dialog size.
  4. Ensure "CANCEL", "SAVE" buttons are still visible and there is a margin between the keyboard and dialog.

Review

@ParaskP7

Make sure strings will be translated:

irfano commented 1 year ago

👋🏻 @khaykov! Can I know your comment about a feature you updated recently? You just commented and uncommented, but maybe you can still help.

WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE was deprecated. I want to update it in the recommended way as below.

This constant was deprecated in API level 30. Call Window#setDecorFitsSystemWindows(boolean) with false and install an OnApplyWindowInsetsListener on your root content view that fits insets of type [Type#ime()](https://developer.android.com/reference/android/view/WindowInsets.Type#ime()).

I want to test its effect to be sure it still works as expected, but I couldn't find what this line does exactly. It should resize the block editor position on the screen when the keyboard is shown up, so I removed this line and also removed windowSoftInputMode on AndroidManifest but couldn't see any behavior difference.

https://github.com/wordpress-mobile/AztecEditor-Android/blob/46a82a36a218cb78bcf1a12e8ed180e0fef8f68b/aztec/src/main/kotlin/org/wordpress/aztec/AztecText.kt#L2148

Do you know how I can test what this line does?

khaykov commented 1 year ago

Hey @irfano ! I remember that one :) I was testing updating compileSdk to see if it will fix an issue we had with Samsung devices (it didn't), and that line gave me some compile-time trouble, so I commented it out locally. It made it's way into the commit by accident so I just reverted it back. Sorry, I can't really help you with the setSoftInputMode, since I'm not familiar with block editor logic at all :)

irfano commented 1 year ago

Hey @irfano ! I remember that one :) I was testing updating compileSdk to see if it will fix an issue we had with Samsung devices (it didn't), and that line gave me some compile-time trouble, so I commented it out locally. It made it's way into the commit by accident so I just reverted it back. Sorry, I can't really help you with the setSoftInputMode, since I'm not familiar with block editor logic at all :)

Thank you @khaykov! I found out its function and explained it in the "Test" section.