Skip to content

Commit

Permalink
Bump lifecycle-livedata-ktx from 2.3.1 to 2.4.0 (#1527)
Browse files Browse the repository at this point in the history
* Bump lifecycle-livedata-ktx from 2.3.1 to 2.4.0

Bumps lifecycle-livedata-ktx from 2.3.1 to 2.4.0.

---
updated-dependencies:
- dependency-name: androidx.lifecycle:lifecycle-livedata-ktx
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Fixed dependency PR.| #1527

* Fixed some test.| #1527

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: DenBond7 <[email protected]>
  • Loading branch information
dependabot[bot] and DenBond7 authored Nov 24, 2021
1 parent e752c09 commit 48ec0e1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion FlowCrypt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ dependencies {
implementation "androidx.test.espresso:espresso-idling-resource:${rootProject.ext.espressoVersion}"
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:${rootProject.ext.lifecycleVersion}"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0"
implementation "androidx.room:room-runtime:$roomVersion"
implementation "androidx.room:room-ktx:$roomVersion"
implementation "androidx.paging:paging-runtime-ktx:$pagingVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class ContactsViewModel(application: Application) : AccountViewModel(application
try {
for (email in emails) {
if (GeneralUtil.isEmailValid(email)) {
val emailLowerCase = email.toLowerCase(Locale.getDefault())
val emailLowerCase = email.lowercase(Locale.getDefault())
var cachedContactEntity =
roomDatabase.contactsDao().getContactByEmailSuspend(emailLowerCase)

Expand Down Expand Up @@ -263,15 +263,15 @@ class ContactsViewModel(application: Application) : AccountViewModel(application
roomDatabase.contactsDao().updateSuspend(
contactEntityFromPrimaryPgpContact.copy(
id = contactEntity.id,
email = contactEntity.email.toLowerCase(Locale.US),
email = contactEntity.email.lowercase(Locale.US),
client = ContactEntity.CLIENT_PGP,
)
)
}
}
}

fun filterContacts(searchPattern: String?) {
fun filterContacts(searchPattern: String) {
searchPatternLiveData.value = searchPattern
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class SelectContactsActivity : BaseBackStackActivity(),
private var emptyView: View? = null
private val contactsRecyclerViewAdapter: ContactsRecyclerViewAdapter =
ContactsRecyclerViewAdapter(false)
private var searchPattern: String? = null
private var searchPattern: String = ""
private val contactsViewModel: ContactsViewModel by viewModels()

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ class BackupKeysFragment : BaseFragment(), ProgressBehaviour {

override fun onAccountInfoRefreshed(accountEntity: AccountEntity?) {
super.onAccountInfoRefreshed(accountEntity)
if (accountEntity?.isRuleExist(OrgRules.DomainRule.NO_PRV_BACKUP) == true) {
binding?.btBackup?.gone()
}
updateBackupButtonVisibility(accountEntity)
}

private fun initViews() {
Expand All @@ -128,11 +126,13 @@ class BackupKeysFragment : BaseFragment(), ProgressBehaviour {
R.id.rBEmailOption -> {
binding?.tVHint?.text = getString(R.string.backup_as_email_hint)
binding?.btBackup?.text = getString(R.string.backup_as_email)
updateBackupButtonVisibility(account)
}

R.id.rBDownloadOption -> {
binding?.tVHint?.text = getString(R.string.backup_as_download_hint)
binding?.btBackup?.text = getString(R.string.backup_as_a_file)
updateBackupButtonVisibility(account)
}
}
}
Expand Down Expand Up @@ -373,6 +373,12 @@ class BackupKeysFragment : BaseFragment(), ProgressBehaviour {
}
}

private fun updateBackupButtonVisibility(accountEntity: AccountEntity?) {
if (accountEntity?.isRuleExist(OrgRules.DomainRule.NO_PRV_BACKUP) == true) {
binding?.btBackup?.gone()
}
}

companion object {
private const val REQUEST_CODE_GET_URI_FOR_SAVING_PRIVATE_KEY = 10
}
Expand Down

0 comments on commit 48ec0e1

Please sign in to comment.