minor fixes and updates here and there

This commit is contained in:
tibbi 2022-10-26 18:36:44 +02:00
parent 162b2fb499
commit 5f728c9321
4 changed files with 22 additions and 27 deletions

View File

@ -63,7 +63,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:78b27e9f16'
implementation 'com.github.SimpleMobileTools:Simple-Commons:0828fecd09'
implementation 'org.greenrobot:eventbus:3.3.1'
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
implementation 'com.github.tibbi:android-smsmms:875a46a9c4'

View File

@ -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)
}
}
}

View File

@ -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)
}

View File

@ -8,7 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong