-
-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5179 from wikimedia/yirCard_design
Year-in-review Feed card.
- Loading branch information
Showing
10 changed files
with
93 additions
and
10 deletions.
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