Dan Ballard pushed to branch firefox-android-115.2.1-13.5-1 at The Tor Project / Applications / firefox-android
Commits:
-
19ec8acc
by Dan Ballard at 2023-11-16T20:39:11+00:00
3 changed files:
- fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
- fenix/app/src/main/java/org/mozilla/fenix/theme/ThemeManager.kt
- fenix/app/src/main/res/layout/fragment_home.xml
Changes:
... | ... | @@ -121,6 +121,8 @@ import org.mozilla.fenix.utils.Settings.Companion.TOP_SITES_PROVIDER_MAX_THRESHO |
121 | 121 | import org.mozilla.fenix.utils.allowUndo
|
122 | 122 | import org.mozilla.fenix.wallpapers.Wallpaper
|
123 | 123 | import java.lang.ref.WeakReference
|
124 | +import java.text.NumberFormat
|
|
125 | +import java.util.Locale
|
|
124 | 126 | import kotlin.math.min
|
125 | 127 | |
126 | 128 | @Suppress("TooManyFunctions", "LargeClass")
|
... | ... | @@ -478,6 +480,7 @@ class HomeFragment : Fragment() { |
478 | 480 | |
479 | 481 | fun controlYECDisplay() {
|
480 | 482 | val yec23show = ((activity as? HomeActivity)?.themeManager?.isYECActive ?: false) && ! this.hideYEC
|
483 | + val yec23matchingShow = ((activity as? HomeActivity)?.themeManager?.isYECPhase2Active ?: false) && ! this.hideYEC
|
|
481 | 484 | |
482 | 485 | // hude onion pattern during EOY event
|
483 | 486 | binding.onionPatternImage.apply {
|
... | ... | @@ -506,7 +509,15 @@ class HomeFragment : Fragment() { |
506 | 509 | }
|
507 | 510 | }
|
508 | 511 | |
509 | - |
|
512 | + // Hide EOY matching announcement before its time
|
|
513 | + binding.yecMatchingText.apply {
|
|
514 | + visibility = if (yec23matchingShow) {
|
|
515 | + View.VISIBLE
|
|
516 | + } else {
|
|
517 | + View.GONE
|
|
518 | + }
|
|
519 | + }
|
|
520 | + binding.yecMatchingText.text = binding.yecMatchingText.text.replace(Regex("%s"), NumberFormat.getNumberInstance(Locale.getDefault()).format(75000))
|
|
510 | 521 | |
511 | 522 | // Hide the EOY image before EOY event
|
512 | 523 | binding.yecIllustration.apply {
|
... | ... | @@ -29,6 +29,8 @@ abstract class ThemeManager { |
29 | 29 | // 1696118400000 // 2022 10 04 - testing
|
30 | 30 | // 1697414400000 // 2023 10 16
|
31 | 31 | private val yec2023LaunchDate = Date(1697414400000)
|
32 | + // 1700614800000 // 2023 11 22
|
|
33 | + private val yec2023Phase2 = Date(1700614800000)
|
|
32 | 34 | // 1704067200000 // 2024 01 01
|
33 | 35 | private val yec2023EndDate = Date(1704067200000)
|
34 | 36 | |
... | ... | @@ -36,6 +38,7 @@ abstract class ThemeManager { |
36 | 38 | abstract var currentTheme: BrowsingMode
|
37 | 39 | |
38 | 40 | val isYECActive get() = Date().after(yec2023LaunchDate) && Date().before(yec2023EndDate)
|
41 | + val isYECPhase2Active get() = Date().after(yec2023Phase2) && Date().before(yec2023EndDate)
|
|
39 | 42 | |
40 | 43 | /**
|
41 | 44 | * Returns the style resource corresponding to the [currentTheme].
|
... | ... | @@ -170,6 +170,21 @@ |
170 | 170 | |
171 | 171 | </androidx.constraintlayout.widget.ConstraintLayout>
|
172 | 172 | |
173 | + <TextView
|
|
174 | + android:id="@+id/yec_matching_text"
|
|
175 | + android:layout_width="wrap_content"
|
|
176 | + android:layout_height="wrap_content"
|
|
177 | + android:clickable="false"
|
|
178 | + android:focusable="false"
|
|
179 | + android:importantForAccessibility="no"
|
|
180 | + android:layout_marginTop="15dp"
|
|
181 | + android:text="@string/yec_2023_matched_donation"
|
|
182 | + android:textColor="#FFBD4F"
|
|
183 | + android:textSize="16sp"
|
|
184 | + android:lineSpacingExtra="5dp"
|
|
185 | + android:fontFamily="Roboto-Medium"
|
|
186 | + app:layout_scrollFlags="scroll" />
|
|
187 | + |
|
173 | 188 | <TextView
|
174 | 189 | android:id="@+id/yec_intro_text"
|
175 | 190 | android:layout_width="wrap_content"
|