feat: add conversation shortcuts (#280)
* Declare intent filter to open ThreadActivity from shortcut * Add SimpleContact utilities * Create the ShortcutHelper class * update shortcuts on sending message, notification received and when opening thread. * format code * Avoid error when getConversations is called from UI thread * Changed ranking of create new conversation shortcut to 0 * removed exception handling * Run shortcut registration in background * Changed shortcut creation and usage report * do not create shortcut on opening conversation * optimize imports * Delete shortcut with conversation * Show main activity if conversation does not exist * removed old intent filter * Specify Fossify thread activity in shortcut's intent * Avoid dismissing activity if it's a new conversation * Try to fix private contacts appearing as numbers * Removed intent sanitizer since activity isn't exported anymore * Update shortcut label and picture when changing conversation name * refactor: cleanup code * refactor: collapse empty tag --------- Co-authored-by: Naveen Singh <36371707+naveensingh@users.noreply.github.com> Co-authored-by: Naveen Singh <snaveen935@gmail.com>
This commit is contained in:
parent
0b7434568b
commit
857a1fd445
8 changed files with 265 additions and 5 deletions
|
|
@ -7,9 +7,12 @@ import android.widget.Toast.LENGTH_LONG
|
|||
import com.klinker.android.send_message.Settings
|
||||
import org.fossify.commons.extensions.showErrorToast
|
||||
import org.fossify.commons.extensions.toast
|
||||
import org.fossify.commons.helpers.ensureBackgroundThread
|
||||
import org.fossify.messages.R
|
||||
import org.fossify.messages.extensions.config
|
||||
import org.fossify.messages.extensions.getThreadId
|
||||
import org.fossify.messages.extensions.messagingUtils
|
||||
import org.fossify.messages.extensions.shortcutHelper
|
||||
import org.fossify.messages.messaging.SmsException.Companion.EMPTY_DESTINATION_ADDRESS
|
||||
import org.fossify.messages.messaging.SmsException.Companion.ERROR_PERSISTING_MESSAGE
|
||||
import org.fossify.messages.messaging.SmsException.Companion.ERROR_SENDING_MESSAGE
|
||||
|
|
@ -94,6 +97,10 @@ fun Context.sendMessageCompat(
|
|||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
ensureBackgroundThread {
|
||||
val threadId = getThreadId(addresses.toSet())
|
||||
shortcutHelper.reportSendMessageUsage(threadId)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue