File tree Expand file tree Collapse file tree
FlowCrypt/src/androidTest/java/com/flowcrypt/email/matchers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
22 * © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com
3- * Contributors: DenBond7
3+ * Contributors: denbond7
44 */
55
66package com.flowcrypt.email.matchers
77
8- import android.graphics.drawable.ColorDrawable
98import android.view.View
109import androidx.test.espresso.matcher.BoundedMatcher
1110import com.google.android.material.appbar.AppBarLayout
11+ import com.google.android.material.shape.MaterialShapeDrawable
1212import org.hamcrest.Description
1313
1414/* *
@@ -17,9 +17,11 @@ import org.hamcrest.Description
1717class AppBarLayoutBackgroundColorMatcher (val color : Int ) :
1818 BoundedMatcher <View , AppBarLayout >(AppBarLayout ::class .java) {
1919 public override fun matchesSafely (appBarLayout : AppBarLayout ): Boolean {
20- return if (appBarLayout.background is ColorDrawable ) {
21- color == (appBarLayout.background as ColorDrawable ).color
22- } else false
20+ return if (appBarLayout.background is MaterialShapeDrawable ) {
21+ (appBarLayout.background as MaterialShapeDrawable ).fillColor?.defaultColor == color
22+ } else {
23+ false
24+ }
2325 }
2426
2527 override fun describeTo (description : Description ) {
You can’t perform that action at this time.
0 commit comments