Last active
September 18, 2020 04:35
-
-
Save oscarito9410/7b7652d2befe61c1b855cb4e52946450 to your computer and use it in GitHub Desktop.
Feature config
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
package com.aboolean.sosmex.dependencies.feature | |
import com.aboolean.sosmex.ui.home.menu.MenuItem | |
import com.aboolean.sosmex.utils.di.Country | |
import java.util.* | |
interface FeatureConfig { | |
val appId: String | |
val defaultLocale: Locale | |
val isCountryChooseEnabled: Boolean | |
val defaultCountry: Country | |
val policeContact: PoliceContact | |
val availableOptions: MutableList<MenuItem> | |
val mediaConfig: MediaRecodingConfig | |
val enabledPremiumFeatures: Boolean | |
val enabledForceUpdate: Boolean | |
val maxContacts: Int | |
} | |
data class PoliceContact(val isEnabled: Boolean, | |
val displayName: String = "", | |
val phoneNumber: String = "") | |
data class MediaRecodingConfig(val storageMediaReference: String, | |
val secondsRecording: Long = 1000L) | |
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
class FeatureConfigImpl : FeatureConfig { | |
override val appId: String | |
get() = "core" | |
override val defaultLocale: Locale | |
get() = Locale.getDefault() | |
override val defaultCountry = Country.MEXICO | |
override val isCountryChooseEnabled = true | |
override val policeContact: PoliceContact | |
get() = PoliceContact(isEnabled = false) | |
override val availableOptions: MutableList<MenuItem> | |
get() = mutableListOf(MenuItem.SafePlaces, MenuItem.ConvertPremium, MenuItem.TestPanicButton, | |
MenuItem.DistressMessage, MenuItem.InviteFriend, MenuItem.Redeem, | |
MenuItem.Facebook, MenuItem.PrivacyPolicy, MenuItem.TechnicalSupport, MenuItem.SignOut) | |
override val mediaConfig: MediaRecodingConfig | |
get() = MediaRecodingConfig(storageMediaReference = appId, | |
secondsRecording = TimeUnit.SECONDS.toMillis(15)) | |
override val enabledPremiumFeatures: Boolean | |
get() = false | |
override val enabledForceUpdate: Boolean | |
get() = true | |
override val maxContacts: Int | |
get() = 3 | |
} |
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
class FeatureConfigImpl : FeatureConfig { | |
override val appId: String | |
get() = "venus" | |
override val defaultLocale: Locale get() = Locale("es", "MX") | |
override val defaultCountry = Country.MEXICO | |
override val isCountryChooseEnabled = false | |
override val policeContact: PoliceContact | |
get() = PoliceContact(isEnabled = true, phoneNumber = "valid phone number goes here", | |
displayName = "police contact") | |
override val availableOptions: MutableList<MenuItem> | |
get() = mutableListOf(MenuItem.SafePlaces, MenuItem.TestPanicButton, | |
MenuItem.DistressMessage, MenuItem.InviteFriend, MenuItem.PrivacyPolicy, | |
MenuItem.TechnicalSupport, MenuItem.SignOut) | |
override val mediaConfig: MediaRecodingConfig | |
get() = MediaRecodingConfig(storageMediaReference = appId, | |
secondsRecording = TimeUnit.SECONDS.toMillis(15)) | |
override val enabledPremiumFeatures: Boolean | |
get() = true | |
override val enabledForceUpdate: Boolean | |
get() = false | |
override val maxContacts: Int | |
get() = 6 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment