diff --git a/FlowCrypt/build.gradle.kts b/FlowCrypt/build.gradle.kts index 068dc18d9b..3a244e8d78 100644 --- a/FlowCrypt/build.gradle.kts +++ b/FlowCrypt/build.gradle.kts @@ -487,7 +487,7 @@ dependencies { implementation("com.google.android.gms:play-services-base:18.7.2") implementation("com.google.android.gms:play-services-auth:21.4.0") - implementation("com.google.android.material:material:1.12.0") + implementation("com.google.android.material:material:1.13.0") implementation("com.google.android.flexbox:flexbox:3.0.0") implementation("com.google.code.gson:gson:2.13.1") implementation("com.google.api-client:google-api-client-android:2.8.1") diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/base/BaseTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/base/BaseTest.kt index a611fd38d7..df81ac88f2 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/base/BaseTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/base/BaseTest.kt @@ -403,6 +403,12 @@ abstract class BaseTest : BaseActivityTestImplementation { } } + protected fun getIdentifierByName(name: String): Int { + return getTargetContext() + .resources + .getIdentifier(name, "id", getTargetContext().packageName) + } + companion object{ const val NOTIFICATION_RESOURCES_NAME = "com.android.systemui:id/expandableNotificationRow" diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/AppBarLayoutBackgroundColorMatcher.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/AppBarLayoutBackgroundColorMatcher.kt index 1ade48bf60..49f730141c 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/AppBarLayoutBackgroundColorMatcher.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers/AppBarLayoutBackgroundColorMatcher.kt @@ -1,14 +1,14 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.matchers -import android.graphics.drawable.ColorDrawable import android.view.View import androidx.test.espresso.matcher.BoundedMatcher import com.google.android.material.appbar.AppBarLayout +import com.google.android.material.shape.MaterialShapeDrawable import org.hamcrest.Description /** @@ -17,9 +17,11 @@ import org.hamcrest.Description class AppBarLayoutBackgroundColorMatcher(val color: Int) : BoundedMatcher(AppBarLayout::class.java) { public override fun matchesSafely(appBarLayout: AppBarLayout): Boolean { - return if (appBarLayout.background is ColorDrawable) { - color == (appBarLayout.background as ColorDrawable).color - } else false + return if (appBarLayout.background is MaterialShapeDrawable) { + (appBarLayout.background as MaterialShapeDrawable).fillColor?.defaultColor == color + } else { + false + } } override fun describeTo(description: Description) { diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/RecipientsListFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/RecipientsListFlowTest.kt index 1dc2eab038..2358a71bac 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/RecipientsListFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/RecipientsListFlowTest.kt @@ -129,7 +129,7 @@ class RecipientsListFlowTest : BaseRecipientsListTest() { onView(withId(R.id.menuSearch)) .check(matches(isDisplayed())) .perform(click()) - onView(withId(com.google.android.material.R.id.search_src_text)) + onView(withId(getIdentifierByName("search_src_text"))) .perform(clearText(), replaceText("00")) .perform(pressKey(KeyEvent.KEYCODE_ENTER)) closeSoftKeyboard() diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/SelectRecipientsFragmentFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/SelectRecipientsFragmentFlowTest.kt index ec551ef15c..d46c422645 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/SelectRecipientsFragmentFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/SelectRecipientsFragmentFlowTest.kt @@ -1,6 +1,6 @@ /* * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com - * Contributors: DenBond7 + * Contributors: denbond7 */ package com.flowcrypt.email.ui @@ -115,7 +115,7 @@ class SelectRecipientsFragmentFlowTest : BaseTest() { onView(withId(R.id.menuSearch)) .check(matches(isDisplayed())) .perform(click()) - onView(withId(com.google.android.material.R.id.search_src_text)) + onView(withId(getIdentifierByName("search_src_text"))) .perform(clearText(), typeText("some email")) closeSoftKeyboard() onView(withId(R.id.tVEmpty)) @@ -123,7 +123,7 @@ class SelectRecipientsFragmentFlowTest : BaseTest() { } private fun checkIsTypedUserFound(viewId: Int, viewText: String) { - onView(withId(com.google.android.material.R.id.search_src_text)) + onView(withId(getIdentifierByName("search_src_text"))) .perform(clearText(), typeText(viewText)) closeSoftKeyboard() onView(withId(viewId)) diff --git a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/SearchMessagesGmailApiFlowTest.kt b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/SearchMessagesGmailApiFlowTest.kt index 9554f79e5a..06d1472858 100644 --- a/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/SearchMessagesGmailApiFlowTest.kt +++ b/FlowCrypt/src/androidTest/java/com/flowcrypt/email/ui/gmailapi/SearchMessagesGmailApiFlowTest.kt @@ -97,7 +97,7 @@ class SearchMessagesGmailApiFlowTest : BaseGmailApiTest() { onView(withId(R.id.menuSearch)) .check(matches(isDisplayed())) .perform(click()) - onView(withId(com.google.android.material.R.id.search_src_text)) + onView(withId(getIdentifierByName("search_src_text"))) .perform(click(), clearText(), replaceText(SUBJECT_EXISTING_STANDARD)) .perform(pressKey(KeyEvent.KEYCODE_ENTER)) @@ -114,4 +114,4 @@ class SearchMessagesGmailApiFlowTest : BaseGmailApiTest() { ) ) } -} \ No newline at end of file +}