allow sharing attachments too
This commit is contained in:
parent
394a990e9c
commit
79f51e42d5
|
@ -10,7 +10,6 @@ import com.reddit.indicatorfastscroll.FastScrollItemIndicator
|
||||||
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.*
|
import com.simplemobiletools.commons.helpers.*
|
||||||
import com.simplemobiletools.commons.models.PhoneNumber
|
|
||||||
import com.simplemobiletools.commons.models.RadioItem
|
import com.simplemobiletools.commons.models.RadioItem
|
||||||
import com.simplemobiletools.commons.models.SimpleContact
|
import com.simplemobiletools.commons.models.SimpleContact
|
||||||
import com.simplemobiletools.smsmessenger.R
|
import com.simplemobiletools.smsmessenger.R
|
||||||
|
|
|
@ -69,7 +69,7 @@ class ThreadAdapter(
|
||||||
findItem(R.id.cab_copy_to_clipboard).isVisible = isOneItemSelected && hasText
|
findItem(R.id.cab_copy_to_clipboard).isVisible = isOneItemSelected && hasText
|
||||||
findItem(R.id.cab_save_as).isVisible = isOneItemSelected && selectedItem?.attachment?.attachments?.size == 1
|
findItem(R.id.cab_save_as).isVisible = isOneItemSelected && selectedItem?.attachment?.attachments?.size == 1
|
||||||
findItem(R.id.cab_share).isVisible = isOneItemSelected && hasText
|
findItem(R.id.cab_share).isVisible = isOneItemSelected && hasText
|
||||||
findItem(R.id.cab_forward_message).isVisible = isOneItemSelected && hasText
|
findItem(R.id.cab_forward_message).isVisible = isOneItemSelected
|
||||||
findItem(R.id.cab_select_text).isVisible = isOneItemSelected && hasText
|
findItem(R.id.cab_select_text).isVisible = isOneItemSelected && hasText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,9 +214,15 @@ class ThreadAdapter(
|
||||||
|
|
||||||
private fun forwardMessage() {
|
private fun forwardMessage() {
|
||||||
val message = getSelectedItems().firstOrNull() as? Message ?: return
|
val message = getSelectedItems().firstOrNull() as? Message ?: return
|
||||||
|
val attachment = message.attachment?.attachments?.firstOrNull()
|
||||||
Intent(activity, NewConversationActivity::class.java).apply {
|
Intent(activity, NewConversationActivity::class.java).apply {
|
||||||
action = Intent.ACTION_SEND
|
action = Intent.ACTION_SEND
|
||||||
putExtra(Intent.EXTRA_TEXT, message.body)
|
putExtra(Intent.EXTRA_TEXT, message.body)
|
||||||
|
|
||||||
|
if (attachment != null) {
|
||||||
|
putExtra(Intent.EXTRA_STREAM, attachment.getUri())
|
||||||
|
}
|
||||||
|
|
||||||
activity.startActivity(this)
|
activity.startActivity(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue