Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rich text editor EditText not resizing properly in full screen #7491

Merged
merged 3 commits into from Oct 31, 2022

Conversation

jmartinesp
Copy link
Contributor

@jmartinesp jmartinesp commented Oct 31, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Changed the EditTexts maxLines properties so they are unlimited in full screen mode and go back to 12 when collapsed. Also, improved the way the border for the EditTexts get updated.

Motivation and context

When on full screen, the rich text editor EditText height did not match its container because it had the maxLines = 12 constraint.

Screenshots / GIFs

Before After
Screenshot_1667210963 Screenshot_1667210867

Tests

  • Enable Rich text editor in Labs.
  • Open a DM / room.
  • Write > 12 lines in the composer.
  • Tap on full screen button.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 13

Checklist

@jmartinesp jmartinesp requested review from a team and ganfra and removed request for a team October 31, 2022 10:13
@jmartinesp jmartinesp self-assigned this Oct 31, 2022
@jmartinesp jmartinesp marked this pull request as ready for review October 31, 2022 10:13
@Florian14 Florian14 self-requested a review October 31, 2022 14:56
Copy link
Contributor

@Florian14 Florian14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok, only minor comments, not blocking

Comment on lines 262 to 263
views.richTextComposerEditText.maxLines = 12
views.plainTextComposerEditText.maxLines = 12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it would make sense having this magic number in a const

views.richTextComposerEditText.maxLines = Int.MAX_VALUE
views.plainTextComposerEditText.maxLines = Int.MAX_VALUE
// This is a workaround to fix incorrect scroll position when maximised
post {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like this kind of workaround because it can introduce crashes or weird glitches but I know it can be difficult to find a better solution... let's see

@jmartinesp jmartinesp merged commit 7ba1052 into resilience-rc Oct 31, 2022
@jmartinesp jmartinesp deleted the fix/full-screen-editext-max-lines branch October 31, 2022 15:43
@sonarcloud
Copy link

sonarcloud bot commented Oct 31, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

jmartinesp added a commit that referenced this pull request Nov 2, 2022
…7491)

* Fix rich text editor full screen mode

* Add changelog

* Address review comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants