diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/CheckPassphraseStrengthFragment.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/CheckPassphraseStrengthFragment.kt index ad0642da83..284f3debd2 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/CheckPassphraseStrengthFragment.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/CheckPassphraseStrengthFragment.kt @@ -13,6 +13,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.inputmethod.EditorInfo +import androidx.core.content.ContextCompat import androidx.core.widget.addTextChangedListener import androidx.navigation.fragment.navArgs import com.flowcrypt.email.R @@ -51,8 +52,10 @@ class CheckPassphraseStrengthFragment : initPasswordStrengthViewModel() } - override fun onButtonContinueColorChanged(colorFilter: ColorFilter) { - binding?.btSetPassphrase?.background?.colorFilter = colorFilter + override fun onButtonContinueColorChanged(colorRes: Int) { + context?.let { + binding?.btSetPassphrase?.backgroundTintList = ContextCompat.getColorStateList(it, colorRes) + } } override fun onPassphraseQualityChanged(progress: Int) { diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/CreatePrivateKeyFirstFragment.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/CreatePrivateKeyFirstFragment.kt index 7dfdb50d63..a2e206336a 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/CreatePrivateKeyFirstFragment.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/CreatePrivateKeyFirstFragment.kt @@ -11,6 +11,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.inputmethod.EditorInfo +import androidx.core.content.ContextCompat import androidx.core.os.bundleOf import androidx.core.widget.addTextChangedListener import androidx.fragment.app.setFragmentResult @@ -47,8 +48,11 @@ class CreatePrivateKeyFirstFragment : subscribeToCreatePrivateKey() } - override fun onButtonContinueColorChanged(colorFilter: ColorFilter) { - binding?.buttonSetPassPhrase?.background?.colorFilter = colorFilter + override fun onButtonContinueColorChanged(colorRes: Int) { + context?.let { + binding?.buttonSetPassPhrase?.backgroundTintList = + ContextCompat.getColorStateList(it, colorRes) + } } override fun onPassphraseQualityChanged(progress: Int) { diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/base/BasePassphraseStrengthFragment.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/base/BasePassphraseStrengthFragment.kt index 72299c6266..4e4a561137 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/base/BasePassphraseStrengthFragment.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/ui/activity/fragment/base/BasePassphraseStrengthFragment.kt @@ -16,7 +16,7 @@ import android.text.style.ForegroundColorSpan import android.text.style.StyleSpan import android.view.View import android.widget.Toast -import androidx.core.content.ContextCompat +import androidx.annotation.ColorRes import androidx.core.graphics.BlendModeColorFilterCompat import androidx.core.graphics.BlendModeCompat import androidx.fragment.app.viewModels @@ -48,7 +48,7 @@ abstract class BasePassphraseStrengthFragment : BaseFragment protected val passwordStrengthViewModel: PasswordStrengthViewModel by viewModels() protected var pwdStrengthResult: PgpPwd.PwdStrengthResult? = null - abstract fun onButtonContinueColorChanged(colorFilter: ColorFilter) + abstract fun onButtonContinueColorChanged(@ColorRes colorRes: Int) abstract fun onPassphraseQualityChanged(progress: Int) abstract fun onPassphraseQualityProgressDrawableColorChanged(colorFilter: ColorFilter) abstract fun onPassphraseQualityTextChanged(charSequence: CharSequence) @@ -132,17 +132,11 @@ abstract class BasePassphraseStrengthFragment : BaseFragment when (word?.word) { Constants.PASSWORD_QUALITY_WEAK, Constants.PASSWORD_QUALITY_POOR -> { - val colorFilter = BlendModeColorFilterCompat.createBlendModeColorFilterCompat( - ContextCompat.getColor(requireContext(), R.color.silver), BlendModeCompat.MODULATE - ) - colorFilter?.let { onButtonContinueColorChanged(it) } + onButtonContinueColorChanged(R.color.silver) } else -> { - val colorFilter = BlendModeColorFilterCompat.createBlendModeColorFilterCompat( - ContextCompat.getColor(requireContext(), R.color.colorPrimary), BlendModeCompat.MODULATE - ) - colorFilter?.let { onButtonContinueColorChanged(it) } + onButtonContinueColorChanged(R.color.colorPrimary) } } diff --git a/FlowCrypt/src/main/res/drawable/ic_plus_white_24dp.xml b/FlowCrypt/src/main/res/drawable/ic_plus_white_24dp.xml new file mode 100644 index 0000000000..701e2f211f --- /dev/null +++ b/FlowCrypt/src/main/res/drawable/ic_plus_white_24dp.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/FlowCrypt/src/main/res/layout/action_item_switch.xml b/FlowCrypt/src/main/res/layout/action_item_switch.xml index 7f8e219d2a..f7f83a18ea 100644 --- a/FlowCrypt/src/main/res/layout/action_item_switch.xml +++ b/FlowCrypt/src/main/res/layout/action_item_switch.xml @@ -8,5 +8,4 @@ android:id="@+id/switchShowOnlyEncryptedMessages" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:theme="@style/AppWidget.Switch" tools:checked="true" /> diff --git a/FlowCrypt/src/main/res/layout/activity_create_message.xml b/FlowCrypt/src/main/res/layout/activity_create_message.xml index 17fb57abbb..50bd61192e 100644 --- a/FlowCrypt/src/main/res/layout/activity_create_message.xml +++ b/FlowCrypt/src/main/res/layout/activity_create_message.xml @@ -15,18 +15,16 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:animateLayoutChanges="true" - android:theme="@style/AppTheme.NoActionBar.AppBarOverlay" android:visibility="visible" app:layout_behavior="@string/appbar_scrolling_view_behavior" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> - + android:layout_height="wrap_content" /> diff --git a/FlowCrypt/src/main/res/layout/activity_main.xml b/FlowCrypt/src/main/res/layout/activity_main.xml index cada61ca7a..403db082e4 100644 --- a/FlowCrypt/src/main/res/layout/activity_main.xml +++ b/FlowCrypt/src/main/res/layout/activity_main.xml @@ -20,18 +20,15 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:animateLayoutChanges="true" - android:theme="@style/AppTheme.NoActionBar.AppBarOverlay" - android:visibility="visible" app:layout_behavior="@string/appbar_scrolling_view_behavior" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> - + android:layout_height="wrap_content" /> diff --git a/FlowCrypt/src/main/res/layout/fragment_add_other_account.xml b/FlowCrypt/src/main/res/layout/fragment_add_other_account.xml index a1216349c8..5518a95b2a 100644 --- a/FlowCrypt/src/main/res/layout/fragment_add_other_account.xml +++ b/FlowCrypt/src/main/res/layout/fragment_add_other_account.xml @@ -45,11 +45,10 @@