updating commons

This commit is contained in:
tibbi
2022-02-07 11:45:59 +01:00
parent 47cba56e31
commit cc04594d31
7 changed files with 8 additions and 8 deletions

View File

@@ -62,7 +62,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:09e6c15f70' implementation 'com.github.SimpleMobileTools:Simple-Commons:332725a9fc'
implementation 'org.greenrobot:eventbus:3.2.0' implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.klinkerapps:android-smsmms:5.2.6' implementation 'com.klinkerapps:android-smsmms:5.2.6'
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61' implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'

View File

@@ -205,7 +205,7 @@ class MainActivity : SimpleActivity() {
} }
private fun getNewConversations(cachedConversations: ArrayList<Conversation>) { private fun getNewConversations(cachedConversations: ArrayList<Conversation>) {
val privateCursor = getMyContactsCursor(false, true)?.loadInBackground() val privateCursor = getMyContactsCursor(false, true)
ensureBackgroundThread { ensureBackgroundThread {
val privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor) val privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor)
val conversations = getConversations(privateContacts = privateContacts) val conversations = getConversations(privateContacts = privateContacts)

View File

@@ -173,7 +173,7 @@ class NewConversationActivity : SimpleActivity() {
} }
private fun fillSuggestedContacts(callback: () -> Unit) { private fun fillSuggestedContacts(callback: () -> Unit) {
val privateCursor = getMyContactsCursor(false, true)?.loadInBackground() val privateCursor = getMyContactsCursor(false, true)
ensureBackgroundThread { ensureBackgroundThread {
privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor) privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor)
val suggestions = getSuggestedContacts(privateContacts) val suggestions = getSuggestedContacts(privateContacts)

View File

@@ -232,7 +232,7 @@ class ThreadActivity : SimpleActivity() {
} }
private fun setupThread() { private fun setupThread() {
val privateCursor = getMyContactsCursor(false, true)?.loadInBackground() val privateCursor = getMyContactsCursor(false, true)
ensureBackgroundThread { ensureBackgroundThread {
privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor) privateContacts = MyContactsContentProvider.getSimpleContacts(this, privateCursor)

View File

@@ -669,7 +669,7 @@ fun Context.getThreadId(addresses: Set<String>): Long {
} }
fun Context.showReceivedMessageNotification(address: String, body: String, threadId: Long, bitmap: Bitmap?) { fun Context.showReceivedMessageNotification(address: String, body: String, threadId: Long, bitmap: Bitmap?) {
val privateCursor = getMyContactsCursor(false, true)?.loadInBackground() val privateCursor = getMyContactsCursor(false, true)
ensureBackgroundThread { ensureBackgroundThread {
val senderName = getNameFromAddress(address, privateCursor) val senderName = getNameFromAddress(address, privateCursor)
@@ -689,7 +689,7 @@ fun Context.getNameFromAddress(address: String, privateCursor: Cursor?): String
} }
fun Context.getContactFromAddress(address: String, callback: ((contact: SimpleContact?) -> Unit)) { fun Context.getContactFromAddress(address: String, callback: ((contact: SimpleContact?) -> Unit)) {
val privateCursor = getMyContactsCursor(false, true)?.loadInBackground() val privateCursor = getMyContactsCursor(false, true)
SimpleContactsHelper(this).getAvailableContacts(false) { SimpleContactsHelper(this).getAvailableContacts(false) {
val contact = it.firstOrNull { it.doesHavePhoneNumber(address) } val contact = it.firstOrNull { it.doesHavePhoneNumber(address) }
if (contact == null) { if (contact == null) {

View File

@@ -47,7 +47,7 @@ class SmsReceiver : BroadcastReceiver() {
val bitmap = getPhotoForNotification(address, context) val bitmap = getPhotoForNotification(address, context)
Handler(Looper.getMainLooper()).post { Handler(Looper.getMainLooper()).post {
val privateCursor = context.getMyContactsCursor(false, true)?.loadInBackground() val privateCursor = context.getMyContactsCursor(false, true)
if (!context.isNumberBlocked(address)) { if (!context.isNumberBlocked(address)) {
ensureBackgroundThread { ensureBackgroundThread {
val newMessageId = context.insertNewSMS(address, subject, body, date, read, threadId, type, subscriptionId) val newMessageId = context.insertNewSMS(address, subject, body, date, read, threadId, type, subscriptionId)

View File

@@ -51,7 +51,7 @@ class SmsStatusSentReceiver : SentReceiver() {
private fun showSendingFailedNotification(context: Context, messageId: Long) { private fun showSendingFailedNotification(context: Context, messageId: Long) {
Handler(Looper.getMainLooper()).post { Handler(Looper.getMainLooper()).post {
val privateCursor = context.getMyContactsCursor(false, true)?.loadInBackground() val privateCursor = context.getMyContactsCursor(false, true)
ensureBackgroundThread { ensureBackgroundThread {
val address = context.getMessageRecipientAddress(messageId) val address = context.getMessageRecipientAddress(messageId)
val threadId = context.getThreadId(address) val threadId = context.getThreadId(address)