Skip to content

Commit e24154b

Browse files
malmsteinCDRussell
authored andcommitted
Tile experiment text edge case (#5999)
Task/Issue URL: https://app.asana.com/1/137249556945/project/488551667048375/task/1210140687033716 ### Description This PR fixes and edge case where only 1 tracker has been blocked and we display the tile animation. This only applies to English, other languages in this edge case will see the english text. Instructions - [instructions.mp4](https://app.asana.com/app/asana/-/get_asset?asset_id=1210103609702441) Install apk and open Settings / Experimental UI Settings Enable any of the O-10 Experiments. Restart the app to ensure it works as expected. Note: This is not compatible with the O-A Experiment, please disable it for proper testing ### Steps to test this PR _1 tracker blocked_ - [ ] Fresh install and enable the Variant 2 in the O-10 experiment - [ ] Visit a site that blocks 1 tracker - [ ] Open the Tab Manager screen - [ ] Tile should read “1 tracker blocked in the last 7 days" ### UI changes | Before | After | | ------ | ----- | ![Screenshot_20250502_143738](https://github.com/user-attachments/assets/ff030e9a-adcc-4643-ba16-ba6098ad6ddf)|![Screenshot_20250502_144324](https://github.com/user-attachments/assets/0c3349f8-75b5-4de6-882c-1d5cb461bd40)|
1 parent 4527f4e commit e24154b

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

app/src/main/java/com/duckduckgo/app/tabs/ui/TabSwitcherAdapter.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,15 @@ class TabSwitcherAdapter(
152152
is TabSwitcherViewHolder.TrackerAnimationInfoPanelViewHolder -> {
153153
val trackerAnimationInfoPanel = list[position] as TabSwitcherItem.TrackerAnimationInfoPanel
154154

155+
val stringRes = if (trackerAnimationInfoPanel.trackerCount == 1) {
156+
R.string.trackerBlockedInTheLast7days
157+
} else {
158+
R.string.trackersBlockedInTheLast7days
159+
}
160+
155161
trackerCountAnimator.animateTrackersBlockedCountView(
156162
context = holder.binding.root.context,
157-
stringRes = R.string.trackersBlockedInTheLast7days,
163+
stringRes = stringRes,
158164
totalTrackerCount = trackerAnimationInfoPanel.trackerCount,
159165
trackerTextView = holder.binding.infoPanelText,
160166
)

app/src/main/res/values/donottranslate.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@
5454
<!-- Skip Onboarding (not user-facing) -->
5555
<string name="skipOnboarding">Skip Onboarding</string>"
5656

57+
<!-- Trackers blocked animation-->
58+
<string name="trackerBlockedInTheLast7days" instruction="Placeholder is 1 tracker blocked" >&lt;b&gt;%1$s tracker blocked &lt;/b&gt; in the last 7 days</string>
5759
</resources>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
<string name="tabSwitcherGridViewMenu">Grid view</string>
119119

120120
<!--Tab Switcher Animation-->
121-
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;%1$s trackers blocked &lt;/b&gt; in the last 7 days</string>
121+
<string name="trackersBlockedInTheLast7days" instruction="Placeholder is the number of trackers blocked > 1">&lt;b&gt;%1$s trackers blocked &lt;/b&gt; in the last 7 days</string>
122122
<string name="trackersBlocked" instruction="Placeholder is the number of trackers blocked">&lt;b&gt;%1$s trackers blocked &lt;/b&gt;</string>
123123
<string name="inTheLast7Days">in the last 7 days</string>
124124

0 commit comments

Comments
 (0)