-
-
Notifications
You must be signed in to change notification settings - Fork 647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Year-in-review Feed card. #5179
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ea9e0dd
Year-in-review Feed card.
dbrant 97e4e33
Merge branch 'main' into yirCard_design
dbrant 51f7c47
qq.
dbrant 7b8cf2d
Merge branch 'main' into yirCard_design
dbrant 7feffa8
Add url.
dbrant c025a34
Merge branch 'main' into yirCard_design
dbrant 7daf9ac
Add list of excluded countries.
dbrant 32f0184
Merge branch 'main' into yirCard_design
dbrant 332b118
Merge branch 'main' into yirCard_design
dbrant a9a58c4
Merge branch 'main' into yirCard_design
dbrant 00b46c2
Merge branch 'main' into yirCard_design
dbrant 9322e5b
Extend date.
dbrant 7bffc28
Restrict to en.
dbrant 017239b
Make YiR strings not translatable.
dbrant 3aeac4e
Merge branch 'main' into yirCard_design
dbrant a1586a3
Merge branch 'main' into yirCard_design
cooltey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
app/src/main/java/org/wikipedia/feed/onboarding/YIROnboardingCard.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.wikipedia.feed.onboarding | ||
|
||
import org.wikipedia.R | ||
import org.wikipedia.WikipediaApp | ||
import org.wikipedia.feed.announcement.Announcement | ||
import org.wikipedia.feed.model.CardType | ||
import org.wikipedia.util.GeoUtil | ||
import java.time.LocalDate | ||
|
||
class YIROnboardingCard(announcement: Announcement) : OnboardingCard(announcement) { | ||
|
||
override fun type(): CardType { | ||
return CardType.YEAR_IN_REVIEW_ANNOUNCEMENT | ||
} | ||
|
||
override fun shouldShow(): Boolean { | ||
return super.shouldShow() && | ||
WikipediaApp.instance.appOrSystemLanguageCode == "en" && | ||
LocalDate.now() <= LocalDate.of(2025, 2, 28) && | ||
!excludedCountries.contains(GeoUtil.geoIPCountry) | ||
} | ||
|
||
override fun prefKey(): Int { | ||
return R.string.preference_key_feed_yir_onboarding_card_enabled | ||
} | ||
|
||
private val excludedCountries = setOf("RU", "IR", "CN", "HK", "MO", "SA", "CU", "MM", "BY", "EG", "PS", "GN", "PK", "KH", "VN", "SD", "AE", "SY", "JO", "VE", "AF") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I made these strings non-translatable on purpose, since this feature will be available for English only, therefore translators don't need to be bothered.)