updating commons, kotlin + add some keyboard hiding
This commit is contained in:
parent
54e02171f5
commit
8336ec0052
|
@ -62,7 +62,7 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:14033f9b50'
|
||||
implementation 'com.github.SimpleMobileTools:Simple-Commons:4d36cc84e9'
|
||||
implementation 'org.greenrobot:eventbus:3.2.0'
|
||||
implementation 'com.klinkerapps:android-smsmms:5.2.6'
|
||||
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
|
||||
|
|
|
@ -263,6 +263,7 @@ class MainActivity : SimpleActivity() {
|
|||
|
||||
val currAdapter = conversations_list.adapter
|
||||
if (currAdapter == null) {
|
||||
hideKeyboard()
|
||||
ConversationsAdapter(this, sortedConversations, conversations_list) {
|
||||
Intent(this, ThreadActivity::class.java).apply {
|
||||
putExtra(THREAD_ID, (it as Conversation).threadId)
|
||||
|
@ -291,6 +292,7 @@ class MainActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun launchNewConversation() {
|
||||
hideKeyboard()
|
||||
Intent(this, NewConversationActivity::class.java).apply {
|
||||
startActivity(this)
|
||||
}
|
||||
|
@ -329,10 +331,12 @@ class MainActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun launchSearch() {
|
||||
hideKeyboard()
|
||||
startActivity(Intent(applicationContext, SearchActivity::class.java))
|
||||
}
|
||||
|
||||
private fun launchSettings() {
|
||||
hideKeyboard()
|
||||
startActivity(Intent(applicationContext, SettingsActivity::class.java))
|
||||
}
|
||||
|
||||
|
|
|
@ -217,6 +217,7 @@ class NewConversationActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun launchThreadActivity(phoneNumber: String, name: String) {
|
||||
hideKeyboard()
|
||||
val text = intent.getStringExtra(Intent.EXTRA_TEXT) ?: ""
|
||||
val numbers = phoneNumber.split(";").toSet()
|
||||
val number = if (numbers.size == 1) phoneNumber else Gson().toJson(numbers)
|
||||
|
|
|
@ -129,6 +129,7 @@ class SearchActivity : SimpleActivity() {
|
|||
val currAdapter = search_results_list.adapter
|
||||
if (currAdapter == null) {
|
||||
SearchResultsAdapter(this, searchResults, search_results_list, searchedText) {
|
||||
hideKeyboard()
|
||||
Intent(this, ThreadActivity::class.java).apply {
|
||||
putExtra(THREAD_ID, (it as SearchResult).threadId)
|
||||
putExtra(THREAD_TITLE, it.title)
|
||||
|
|
|
@ -198,6 +198,7 @@ class ThreadActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun onHomePressed() {
|
||||
hideKeyboard()
|
||||
Intent(this, MainActivity::class.java).apply {
|
||||
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
startActivity(this)
|
||||
|
@ -376,6 +377,7 @@ class ThreadActivity : SimpleActivity() {
|
|||
|
||||
val newThreadId = getThreadId(numbers)
|
||||
if (threadId != newThreadId) {
|
||||
hideKeyboard()
|
||||
Intent(this, ThreadActivity::class.java).apply {
|
||||
putExtra(THREAD_ID, newThreadId)
|
||||
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
|
@ -645,6 +647,7 @@ class ThreadActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
private fun launchPickPhotoVideoIntent() {
|
||||
hideKeyboard()
|
||||
val mimeTypes = arrayOf("image/*", "video/*")
|
||||
Intent(Intent.ACTION_GET_CONTENT).apply {
|
||||
addCategory(Intent.CATEGORY_OPENABLE)
|
||||
|
@ -925,6 +928,7 @@ class ThreadActivity : SimpleActivity() {
|
|||
}
|
||||
|
||||
fun saveMMS(mimeType: String, path: String) {
|
||||
hideKeyboard()
|
||||
lastAttachmentUri = path
|
||||
Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
|
||||
type = mimeType
|
||||
|
|
|
@ -375,6 +375,7 @@ class ThreadAdapter(
|
|||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
|
||||
try {
|
||||
activity.hideKeyboard()
|
||||
activity.startActivity(this)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
val newMimetype = filename.getMimeType()
|
||||
|
|
|
@ -938,18 +938,3 @@ fun Context.getFileSizeFromUri(uri: Uri): Long {
|
|||
return FILE_SIZE_NONE
|
||||
}
|
||||
}
|
||||
|
||||
fun Context.dialNumber(phoneNumber: String, callback: (() -> Unit)? = null) {
|
||||
Intent(Intent.ACTION_DIAL).apply {
|
||||
data = Uri.fromParts("tel", phoneNumber, null)
|
||||
|
||||
try {
|
||||
startActivity(this)
|
||||
callback?.invoke()
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
toast(R.string.no_app_found)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.6.0'
|
||||
ext.kotlin_version = '1.6.10'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
|
Loading…
Reference in New Issue