commit 5650eb6b5c7e9c99b4416df5dcdcba21a6231c3f
parent 5a4bd014b71c3b6801f11a9b2367d874c94846fb
Author: Gabriel Luong <gabriel.luong@gmail.com>
Date: Wed, 10 Dec 2025 15:33:05 +0000
Bug 2004511 - Part 1: Migrate the swipe to refresh to use M3 color tokens r=android-reviewers,007
- Using the general mapping of layer2 -> surfaceContainerLowest that we have seen in migration.
Differential Revision: https://phabricator.services.mozilla.com/D275378
Diffstat:
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt
@@ -1360,8 +1360,10 @@ abstract class BaseBrowserFragment :
binding.swipeRefresh.isEnabled = shouldPullToRefreshBeEnabled(false)
if (binding.swipeRefresh.isEnabled) {
- val primaryTextColor = ThemeManager.resolveAttribute(R.attr.textPrimary, context)
- val primaryBackgroundColor = ThemeManager.resolveAttribute(R.attr.layer2, context)
+ val primaryTextColor =
+ ThemeManager.resolveAttribute(materialR.attr.colorOnSurface, context)
+ val primaryBackgroundColor =
+ ThemeManager.resolveAttribute(materialR.attr.colorSurfaceContainerLowest, context)
binding.swipeRefresh.apply {
setColorSchemeResources(primaryTextColor)
setProgressBackgroundColorSchemeResource(primaryBackgroundColor)
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/history/HistoryView.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/history/HistoryView.kt
@@ -22,6 +22,7 @@ import org.mozilla.fenix.databinding.ComponentHistoryBinding
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.library.LibraryPageView
import org.mozilla.fenix.theme.ThemeManager
+import com.google.android.material.R as materialR
/**
* View that contains and configures the History List
@@ -81,12 +82,14 @@ class HistoryView(
(itemAnimator as SimpleItemAnimator).supportsChangeAnimations = false
}
- val primaryTextColor = ThemeManager.resolveAttribute(R.attr.textPrimary, context)
- val primaryBackgroundColor = ThemeManager.resolveAttribute(R.attr.layer2, context)
+ val primaryTextColor = ThemeManager.resolveAttribute(materialR.attr.colorOnSurface, context)
+ val primaryBackgroundColor =
+ ThemeManager.resolveAttribute(materialR.attr.colorSurfaceContainerLowest, context)
binding.swipeRefresh.apply {
setColorSchemeResources(primaryTextColor)
setProgressBackgroundColorSchemeResource(primaryBackgroundColor)
}
+
binding.swipeRefresh.setOnRefreshListener {
store.dispatch(HistoryFragmentAction.StartSync)
scope.launch {