renaming parameters and properties to avoid clashing with kotlin/java8 keywords

This commit is contained in:
Adam Brown 2022-01-06 14:17:23 +00:00
parent 12abd3b019
commit 41f931e466
3 changed files with 11 additions and 11 deletions

View file

@ -42,14 +42,14 @@ abstract class BooleanFeatureItem : VectorEpoxyModel<BooleanFeatureItem.Holder>(
holder.optionsSpinner.apply {
val arrayAdapter = ArrayAdapter<String>(context, android.R.layout.simple_spinner_dropdown_item)
val options = listOf(
"DEFAULT - ${feature.default.toEmoji()}",
"DEFAULT - ${feature.featureDefault.toEmoji()}",
"",
""
)
arrayAdapter.addAll(options)
adapter = arrayAdapter
feature.override?.let {
feature.featureOverride?.let {
setSelection(options.indexOf(it.toEmoji()), false)
}

View file

@ -28,26 +28,26 @@ class DebugFeaturesStateFactory @Inject constructor(
return FeaturesState(listOf(
createEnumFeature(
label = "Onboarding variant",
override = debugFeatures.onboardingVariant(),
default = defaultFeatures.onboardingVariant()
featureOverride = debugFeatures.onboardingVariant(),
featureDefault = defaultFeatures.onboardingVariant()
),
Feature.BooleanFeature(
label = "FTUE Splash - I already have an account",
override = debugFeatures.isAlreadyHaveAccountSplashEnabled().takeIf {
featureOverride = debugFeatures.isAlreadyHaveAccountSplashEnabled().takeIf {
debugFeatures.hasOverride(DebugFeatureKeys.alreadyHaveAnAccount)
},
default = defaultFeatures.isAlreadyHaveAccountSplashEnabled(),
featureDefault = defaultFeatures.isAlreadyHaveAccountSplashEnabled(),
key = DebugFeatureKeys.alreadyHaveAnAccount
)
))
}
private inline fun <reified T : Enum<T>> createEnumFeature(label: String, override: T, default: T): Feature {
private inline fun <reified T : Enum<T>> createEnumFeature(label: String, featureOverride: T, featureDefault: T): Feature {
return Feature.EnumFeature(
label = label,
override = override.takeIf { debugFeatures.hasEnumOverride(T::class) },
default = default,
override = featureOverride.takeIf { debugFeatures.hasEnumOverride(T::class) },
default = featureDefault,
options = enumValues<T>().toList(),
type = T::class
)

View file

@ -37,8 +37,8 @@ sealed interface Feature {
data class BooleanFeature(
val label: String,
val override: Boolean?,
val default: Boolean,
val featureOverride: Boolean?,
val featureDefault: Boolean,
val key: Preferences.Key<Boolean>
) : Feature
}