diff --git a/app/src/main/java/org/mozilla/fenix/home/sessions/SessionsAdapter.kt b/app/src/main/java/org/mozilla/fenix/home/sessions/SessionsAdapter.kt index 56b9814c62..8982cde727 100644 --- a/app/src/main/java/org/mozilla/fenix/home/sessions/SessionsAdapter.kt +++ b/app/src/main/java/org/mozilla/fenix/home/sessions/SessionsAdapter.kt @@ -4,7 +4,8 @@ package org.mozilla.fenix.home.sessions -import android.graphics.PorterDuff +import android.graphics.Color +import android.graphics.LightingColorFilter import android.view.LayoutInflater import android.view.View import android.view.ViewGroup @@ -112,10 +113,8 @@ class SessionsAdapter( fun bind(session: ArchivedSession) { this.session = session val color = availableColors[(session.id % availableColors.size).toInt()] - - session_card_thumbnail.setColorFilter( - ContextCompat.getColor(itemView.context, color), - PorterDuff.Mode.MULTIPLY) + session_card_thumbnail.colorFilter = + LightingColorFilter(ContextCompat.getColor(itemView.context, color), Color.BLACK) session_card_timestamp.text = session.formattedSavedAt session_card_titles.text = session.titles session_card_extras.text = if (session.extrasLabel > 0) { @@ -124,9 +123,14 @@ class SessionsAdapter( } companion object { - private val availableColors = listOf( - R.color.photonBlue40, R.color.photonGreen50, R.color.photonYellow50, R.color.photonOrange50, - R.color.photonPurple50, R.color.photonInk70) + private val availableColors = + listOf( + R.color.session_placeholder_blue, + R.color.session_placeholder_green, + R.color.session_placeholder_orange, + R.color.session_placeholder_purple, + R.color.session_placeholder_pink + ) const val LAYOUT_ID = R.layout.session_item } } diff --git a/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarUIView.kt b/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarUIView.kt index 0187a910e0..7e49bed4e4 100644 --- a/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarUIView.kt +++ b/app/src/main/java/org/mozilla/fenix/search/awesomebar/AwesomeBarUIView.kt @@ -89,10 +89,17 @@ class AwesomeBarUIView( init { with(container.context) { + val draw = getDrawable(R.drawable.ic_link) + draw?.setColorFilter( + ContextCompat.getColor( + this, + DefaultThemeManager.resolveAttribute(R.attr.searchShortcutsTextColor, this) + ), PorterDuff.Mode.SRC_IN + ) clipboardSuggestionProvider = ClipboardSuggestionProvider( this, loadUrlUseCase, - getDrawable(R.drawable.ic_link)!!.toBitmap(), + draw!!.toBitmap(), getString(R.string.awesomebar_clipboard_title) ) diff --git a/app/src/main/java/org/mozilla/fenix/search/awesomebar/ShortcutEngineManager.kt b/app/src/main/java/org/mozilla/fenix/search/awesomebar/ShortcutEngineManager.kt index fb3553e655..870b8b307c 100644 --- a/app/src/main/java/org/mozilla/fenix/search/awesomebar/ShortcutEngineManager.kt +++ b/app/src/main/java/org/mozilla/fenix/search/awesomebar/ShortcutEngineManager.kt @@ -66,8 +66,6 @@ class ShortcutEngineManager( private fun showShortcutEnginePicker() { with(context) { - awesomeBarUIView.search_shortcuts_button.background = getDrawable(R.drawable.search_pill_background) - awesomeBarUIView.search_shortcuts_button.compoundDrawables[0].setTint(ContextCompat.getColor(this, DefaultThemeManager.resolveAttribute(R.attr.pillWrapperBackground, this))) @@ -81,9 +79,6 @@ class ShortcutEngineManager( private fun hideShortcutEnginePicker() { with(context) { - awesomeBarUIView.search_shortcuts_button.setBackgroundColor(ContextCompat.getColor(this, - DefaultThemeManager.resolveAttribute(R.attr.pillWrapperBackground, this))) - awesomeBarUIView.search_shortcuts_button.compoundDrawables[0].setTint(ContextCompat.getColor(this, DefaultThemeManager.resolveAttribute(R.attr.searchShortcutsTextColor, this))) diff --git a/app/src/main/java/org/mozilla/fenix/utils/ItsNotBrokenSnack.kt b/app/src/main/java/org/mozilla/fenix/utils/ItsNotBrokenSnack.kt index a77d0a7b15..4a6a340f62 100644 --- a/app/src/main/java/org/mozilla/fenix/utils/ItsNotBrokenSnack.kt +++ b/app/src/main/java/org/mozilla/fenix/utils/ItsNotBrokenSnack.kt @@ -6,22 +6,31 @@ package org.mozilla.fenix.utils import android.content.Context import android.view.View +import androidx.core.content.ContextCompat import com.google.android.material.snackbar.Snackbar +import org.mozilla.fenix.R import org.mozilla.fenix.ext.asActivity import org.mozilla.fenix.ext.components class ItsNotBrokenSnack(val context: Context) { fun showSnackbar(issueNumber: String) { - val rootView = context.asActivity()?.window?.decorView?.findViewById(android.R.id.content) + val rootView = + context.asActivity()?.window?.decorView?.findViewById(android.R.id.content) rootView?.let { - Snackbar.make(rootView, message.replace("%", issueNumber), Snackbar.LENGTH_SHORT).apply { - setAction("Add Tab to Issue") { - context.components.useCases.tabsUseCases.addTab - .invoke(issues + issueNumber) + Snackbar.make(rootView, message.replace("%", issueNumber), Snackbar.LENGTH_SHORT) + .apply { + setAction("Add Tab to Issue") { + context.components.useCases.tabsUseCases.addTab + .invoke(issues + issueNumber) + }.setActionTextColor( + ContextCompat.getColor( + context, + R.color.accent_bright_dark_theme + ) + ) + show() } - show() - } } } diff --git a/app/src/main/res/drawable/ic_link.xml b/app/src/main/res/drawable/ic_link.xml index d5ff00a3c1..41ca6720c1 100644 --- a/app/src/main/res/drawable/ic_link.xml +++ b/app/src/main/res/drawable/ic_link.xml @@ -10,7 +10,7 @@ diff --git a/app/src/main/res/drawable/ic_session_thumbnail_placeholder_blue.xml b/app/src/main/res/drawable/ic_session_thumbnail_placeholder_blue.xml deleted file mode 100644 index 97b3624724..0000000000 --- a/app/src/main/res/drawable/ic_session_thumbnail_placeholder_blue.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/app/src/main/res/drawable/ic_session_thumbnail_placeholder_greyscale.xml b/app/src/main/res/drawable/ic_session_thumbnail_placeholder_greyscale.xml new file mode 100644 index 0000000000..6938298e20 --- /dev/null +++ b/app/src/main/res/drawable/ic_session_thumbnail_placeholder_greyscale.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/app/src/main/res/drawable/search_pill_background_unselected.xml b/app/src/main/res/drawable/search_pill_background_unselected.xml new file mode 100644 index 0000000000..97c715896a --- /dev/null +++ b/app/src/main/res/drawable/search_pill_background_unselected.xml @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/app/src/main/res/drawable/search_pill_drawable_button_background.xml b/app/src/main/res/drawable/search_pill_drawable_button_background.xml new file mode 100644 index 0000000000..37f2eb4868 --- /dev/null +++ b/app/src/main/res/drawable/search_pill_drawable_button_background.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml index b1382f1fd3..5062c05b01 100644 --- a/app/src/main/res/layout/fragment_search.xml +++ b/app/src/main/res/layout/fragment_search.xml @@ -74,21 +74,21 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent"> -