|
|
@ -207,15 +207,14 @@ class ComposeActivity : BaseActivity(), |
|
|
|
if (action != null && action == Intent.ACTION_SEND) { |
|
|
|
if (action != null && action == Intent.ACTION_SEND) { |
|
|
|
val subject = intent.getStringExtra(Intent.EXTRA_SUBJECT) |
|
|
|
val subject = intent.getStringExtra(Intent.EXTRA_SUBJECT) |
|
|
|
val text = intent.getStringExtra(Intent.EXTRA_TEXT) |
|
|
|
val text = intent.getStringExtra(Intent.EXTRA_TEXT) |
|
|
|
val shareBody = if (subject != null && text != null) { |
|
|
|
val shareBody = text ?: subject |
|
|
|
if (subject != text && !text.contains(subject)) { |
|
|
|
|
|
|
|
String.format("%s\n%s", subject, text) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
text |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else text ?: subject |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (shareBody != null) { |
|
|
|
if (shareBody != null) { |
|
|
|
|
|
|
|
if (!subject.isNullOrBlank() && subject !in shareBody) { |
|
|
|
|
|
|
|
composeContentWarningField.setText(subject) |
|
|
|
|
|
|
|
viewModel.showContentWarning.value = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val start = composeEditField.selectionStart.coerceAtLeast(0) |
|
|
|
val start = composeEditField.selectionStart.coerceAtLeast(0) |
|
|
|
val end = composeEditField.selectionEnd.coerceAtLeast(0) |
|
|
|
val end = composeEditField.selectionEnd.coerceAtLeast(0) |
|
|
|
val left = min(start, end) |
|
|
|
val left = min(start, end) |
|
|
|