hide the keyboard in some cases manually

This commit is contained in:
tibbi 2022-02-07 13:35:09 +01:00
parent 9f0e736ec3
commit bf0c11016f
3 changed files with 10 additions and 1 deletions

View File

@ -62,7 +62,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:332725a9fc'
implementation 'com.github.SimpleMobileTools:Simple-Commons:02a57ef98a'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.11.3'
implementation 'com.github.tibbi:IndicatorFastScroll:4524cd0b61'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'

View File

@ -90,11 +90,13 @@ class EditContactActivity : ContactActivity() {
initContact()
} else {
toast(R.string.no_contacts_permission)
hideKeyboard()
finish()
}
}
} else {
toast(R.string.no_contacts_permission)
hideKeyboard()
finish()
}
}
@ -140,6 +142,7 @@ class EditContactActivity : ContactActivity() {
contact = ContactsHelper(this).getContactWithId(contactId, intent.getBooleanExtra(IS_PRIVATE, false))
if (contact == null) {
toast(R.string.unknown_error_occurred)
hideKeyboard()
finish()
} else {
runOnUiThread {
@ -301,6 +304,7 @@ class EditContactActivity : ContactActivity() {
}
contact_toolbar.setNavigationOnClickListener {
hideKeyboard()
finish()
}
}
@ -1109,10 +1113,12 @@ class EditContactActivity : ContactActivity() {
contact!!.source = originalContactSource
ContactsHelper(this).deleteContact(contact!!, false) {
setResult(Activity.RESULT_OK)
hideKeyboard()
finish()
}
} else {
setResult(Activity.RESULT_OK)
hideKeyboard()
finish()
}
} else {
@ -1124,6 +1130,7 @@ class EditContactActivity : ContactActivity() {
isSaving = true
if (ContactsHelper(this@EditContactActivity).updateContact(contact!!, photoUpdateStatus)) {
setResult(Activity.RESULT_OK)
hideKeyboard()
finish()
} else {
toast(R.string.unknown_error_occurred)

View File

@ -3,12 +3,14 @@ package com.simplemobiletools.contacts.pro.fragments
import android.content.Context
import android.content.Intent
import android.util.AttributeSet
import com.simplemobiletools.commons.extensions.hideKeyboard
import com.simplemobiletools.contacts.pro.activities.EditContactActivity
import com.simplemobiletools.contacts.pro.activities.InsertOrEditContactActivity
import com.simplemobiletools.contacts.pro.activities.MainActivity
class ContactsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerFragment(context, attributeSet) {
override fun fabClicked() {
activity?.hideKeyboard()
Intent(context, EditContactActivity::class.java).apply {
context.startActivity(this)
}