From 41f931e4663ee3d58cbf5772b5bcee45de10015d Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Thu, 6 Jan 2022 14:17:23 +0000 Subject: [PATCH] renaming parameters and properties to avoid clashing with kotlin/java8 keywords --- .../features/debug/features/BooleanFeatureItem.kt | 4 ++-- .../debug/features/DebugFeaturesStateFactory.kt | 14 +++++++------- .../features/debug/features/FeaturesController.kt | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/vector/src/debug/java/im/vector/app/features/debug/features/BooleanFeatureItem.kt b/vector/src/debug/java/im/vector/app/features/debug/features/BooleanFeatureItem.kt index 53714cbd59..02c0aa82af 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/features/BooleanFeatureItem.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/features/BooleanFeatureItem.kt @@ -42,14 +42,14 @@ abstract class BooleanFeatureItem : VectorEpoxyModel( holder.optionsSpinner.apply { val arrayAdapter = ArrayAdapter(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) } diff --git a/vector/src/debug/java/im/vector/app/features/debug/features/DebugFeaturesStateFactory.kt b/vector/src/debug/java/im/vector/app/features/debug/features/DebugFeaturesStateFactory.kt index 335e1cc714..7ae7a53963 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/features/DebugFeaturesStateFactory.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/features/DebugFeaturesStateFactory.kt @@ -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 > createEnumFeature(label: String, override: T, default: T): Feature { + private inline fun > 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().toList(), type = T::class ) diff --git a/vector/src/debug/java/im/vector/app/features/debug/features/FeaturesController.kt b/vector/src/debug/java/im/vector/app/features/debug/features/FeaturesController.kt index cc4cf388d1..3a685314fd 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/features/FeaturesController.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/features/FeaturesController.kt @@ -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 ) : Feature }