mattermost-mobile/share_extension
Amit Uttam 0f70af7b16 MM-15469 (Android) Alert if shared text is longer than message limit (#3264)
* MM-15469 Alert if shared text is longer than message limit

One can't manually enter text into the share extension's text box past 4000 characters (the default/defined text size limit). However, this restriction can still be circumvented by sharing a large item of text. In this latter case, the textarea displays just the first 4000 characters, but the value buffer still contains the entire shared text. On hitting "Send", the oversize text can still be shared.

This commit implements [MM-15469](https://mattermost.atlassian.net/browse/MM-15469) to better align the Android sharing user experience with the iOS experience.

Since a pre-existing i18n string was used, no additional translations are required.

Fixes https://github.com/mattermost/mattermost-server/issues/11431

* Add available characters remaining counter in Android Share textarea

Shows number of available characters remaining until textarea limit (default
= 4000). Similar to iOS experience.

**iOS (normal)**

![iOS (normal)](https://user-images.githubusercontent.com/887849/65007527-d6d1f700-d8dc-11e9-9382-7e4b3c6f4f5d.png)

**Android (normal)**

![Android (normal)](https://user-images.githubusercontent.com/887849/65007570-f2d59880-d8dc-11e9-9795-ed137e4dd506.jpg)

**iOS (past limit)**

![iOS (past limit)](https://user-images.githubusercontent.com/887849/65007638-2b757200-d8dd-11e9-987d-f5e89b2aa0d3.png)

**Android (past limit)**

![Android (past limit)](https://user-images.githubusercontent.com/887849/65007720-5e1f6a80-d8dd-11e9-97ba-370fa6c8db58.jpg)

* Don't limit size of Android Share extension text input box

Pasted shared text was getting cut off after hitting the `MAX_MESSAGE_LENGTH` for shared posts. Alert validation now checks this limit before allowing content to be posted, which made the `maxLength` limit redundant.

Context: https://github.com/mattermost/mattermost-mobile/pull/3264#issuecomment-540962933
2019-10-16 09:51:06 +03:00
..
android MM-15469 (Android) Alert if shared text is longer than message limit (#3264) 2019-10-16 09:51:06 +03:00
common Update mattermost-redux (#2775) 2019-05-07 15:52:11 -07:00