-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement paywall on media feeds grid (#243)
* Extract premiumMembership check to ext function * Implement paywall on MediaFeedGrid
- Loading branch information
Showing
9 changed files
with
49 additions
and
5 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
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
6 changes: 6 additions & 0 deletions
6
app/src/main/kotlin/net/primal/android/premium/utils/PremiumUtils.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 |
---|---|---|
@@ -1,7 +1,13 @@ | ||
package net.primal.android.premium.utils | ||
|
||
import net.primal.android.premium.domain.PremiumMembership | ||
import net.primal.android.user.domain.UserAccount | ||
|
||
fun String?.isPrimalLegend() = this?.lowercase() == "primal legend" | ||
fun String?.isPremiumFree() = this?.lowercase() == "free" | ||
fun String?.isOriginAndroid() = this?.lowercase() == "android" | ||
fun String?.isOriginIOS() = this?.lowercase() == "ios" | ||
fun String?.isOriginWeb() = this?.lowercase() == "web" | ||
|
||
fun PremiumMembership.hasPremiumMembership() = !this.isExpired() | ||
fun UserAccount.hasPremiumMembership() = this.premiumMembership?.hasPremiumMembership() == true |
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