removing a helper context extension function
This commit is contained in:
parent
705f015a96
commit
bc5e40bef3
|
@ -3,7 +3,6 @@ package com.simplemobiletools.smsmessenger.extensions
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.ContentValues
|
import android.content.ContentValues
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
|
||||||
import android.database.Cursor
|
import android.database.Cursor
|
||||||
import android.provider.ContactsContract
|
import android.provider.ContactsContract
|
||||||
import android.provider.ContactsContract.CommonDataKinds
|
import android.provider.ContactsContract.CommonDataKinds
|
||||||
|
@ -12,21 +11,12 @@ import android.text.TextUtils
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.PERMISSION_READ_CONTACTS
|
import com.simplemobiletools.commons.helpers.PERMISSION_READ_CONTACTS
|
||||||
import com.simplemobiletools.commons.helpers.isMarshmallowPlus
|
import com.simplemobiletools.commons.helpers.isMarshmallowPlus
|
||||||
import com.simplemobiletools.smsmessenger.activities.ThreadActivity
|
|
||||||
import com.simplemobiletools.smsmessenger.helpers.Config
|
import com.simplemobiletools.smsmessenger.helpers.Config
|
||||||
import com.simplemobiletools.smsmessenger.helpers.THREAD_ID
|
|
||||||
import com.simplemobiletools.smsmessenger.models.Message
|
import com.simplemobiletools.smsmessenger.models.Message
|
||||||
import com.simplemobiletools.smsmessenger.models.MessagingThread
|
import com.simplemobiletools.smsmessenger.models.MessagingThread
|
||||||
|
|
||||||
val Context.config: Config get() = Config.newInstance(applicationContext)
|
val Context.config: Config get() = Config.newInstance(applicationContext)
|
||||||
|
|
||||||
fun Context.launchThreadActivity(id: Int) {
|
|
||||||
Intent(this, ThreadActivity::class.java).apply {
|
|
||||||
putExtra(THREAD_ID, id)
|
|
||||||
startActivity(this)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Context.getMessages(threadID: Int? = null): ArrayList<Message> {
|
fun Context.getMessages(threadID: Int? = null): ArrayList<Message> {
|
||||||
val messages = ArrayList<Message>()
|
val messages = ArrayList<Message>()
|
||||||
val hasContactsPermission = hasPermission(PERMISSION_READ_CONTACTS)
|
val hasContactsPermission = hasPermission(PERMISSION_READ_CONTACTS)
|
||||||
|
|
Loading…
Reference in New Issue