minor fixes and updates here and there
This commit is contained in:
parent
162b2fb499
commit
5f728c9321
4 changed files with 22 additions and 27 deletions
|
|
@ -215,7 +215,7 @@ class ThreadActivity : SimpleActivity() {
|
|||
super.onActivityResult(requestCode, resultCode, resultData)
|
||||
if (resultCode != Activity.RESULT_OK) return
|
||||
|
||||
if (requestCode == TAKE_PHOTO_INTENT) {
|
||||
if (requestCode == TAKE_PHOTO_INTENT && capturedImageUri != null) {
|
||||
addAttachment(capturedImageUri!!)
|
||||
} else if (requestCode == PICK_ATTACHMENT_INTENT && resultData != null && resultData.data != null) {
|
||||
addAttachment(resultData.data!!)
|
||||
|
|
@ -224,15 +224,6 @@ class ThreadActivity : SimpleActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun onHomePressed() {
|
||||
hideKeyboard()
|
||||
Intent(this, MainActivity::class.java).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
startActivity(this)
|
||||
}
|
||||
finish()
|
||||
}
|
||||
|
||||
private fun setupCachedMessages(callback: () -> Unit) {
|
||||
ensureBackgroundThread {
|
||||
messages = try {
|
||||
|
|
@ -594,7 +585,11 @@ class ThreadActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
thread_select_sim_number.setTextColor(getProperTextColor().getContrastColor())
|
||||
thread_select_sim_number.text = (availableSIMCards[currentSIMCardIndex].id).toString()
|
||||
try {
|
||||
thread_select_sim_number.text = (availableSIMCards[currentSIMCardIndex].id).toString()
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,21 +39,21 @@ class DirectReplyReceiver : BroadcastReceiver() {
|
|||
val transaction = Transaction(context, settings)
|
||||
val message = com.klinker.android.send_message.Message(msg, address)
|
||||
|
||||
try {
|
||||
val smsSentIntent = Intent(context, SmsStatusSentReceiver::class.java)
|
||||
val deliveredIntent = Intent(context, SmsStatusDeliveredReceiver::class.java)
|
||||
|
||||
transaction.setExplicitBroadcastForSentSms(smsSentIntent)
|
||||
transaction.setExplicitBroadcastForDeliveredSms(deliveredIntent)
|
||||
|
||||
transaction.sendNewMessage(message)
|
||||
} catch (e: Exception) {
|
||||
context.showErrorToast(e)
|
||||
}
|
||||
|
||||
context.notificationManager.cancel(threadId.hashCode())
|
||||
|
||||
ensureBackgroundThread {
|
||||
try {
|
||||
val smsSentIntent = Intent(context, SmsStatusSentReceiver::class.java)
|
||||
val deliveredIntent = Intent(context, SmsStatusDeliveredReceiver::class.java)
|
||||
|
||||
transaction.setExplicitBroadcastForSentSms(smsSentIntent)
|
||||
transaction.setExplicitBroadcastForDeliveredSms(deliveredIntent)
|
||||
|
||||
transaction.sendNewMessage(message)
|
||||
} catch (e: Exception) {
|
||||
context.showErrorToast(e)
|
||||
}
|
||||
|
||||
context.notificationManager.cancel(threadId.hashCode())
|
||||
|
||||
context.markThreadMessagesRead(threadId)
|
||||
context.conversationsDB.markRead(threadId)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue