From 0cfc9fd1faf135b2ec5ba3a01faa30d047899f87 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 13 May 2023 11:22:31 +0200 Subject: [PATCH] mobile: enable calls preference (#2436) * ios: enable calls preference * android: enable calls preference --- .../java/chat/simplex/app/views/chat/ContactPreferences.kt | 3 +-- .../java/chat/simplex/app/views/usersettings/Preferences.kt | 3 +-- apps/ios/Shared/Views/Chat/ContactPreferencesView.swift | 4 ++-- apps/ios/Shared/Views/UserSettings/PreferencesView.swift | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/android/app/src/main/java/chat/simplex/app/views/chat/ContactPreferences.kt b/apps/android/app/src/main/java/chat/simplex/app/views/chat/ContactPreferences.kt index c5fa9daa57..006eb77151 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/views/chat/ContactPreferences.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/views/chat/ContactPreferences.kt @@ -139,7 +139,6 @@ private fun FeatureSection( ContactFeatureAllowed.values(userDefault).map { it to it.text }, allowFeature, icon = null, - enabled = remember { mutableStateOf(feature != ChatFeature.Calls) }, onSelected = onSelected ) InfoRow( @@ -147,7 +146,7 @@ private fun FeatureSection( pref.contactPreference.allow.text ) } - SectionTextFooter(feature.enabledDescription(enabled) + (if (feature == ChatFeature.Calls) generalGetString(R.string.available_in_v51) else "")) + SectionTextFooter(feature.enabledDescription(enabled)) } @Composable diff --git a/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/Preferences.kt b/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/Preferences.kt index ad0537331b..702156a948 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/Preferences.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/views/usersettings/Preferences.kt @@ -99,11 +99,10 @@ private fun FeatureSection(feature: ChatFeature, allowFeature: State some View { - (Text(feature.enabledDescription(enabled)) + (feature == .calls ? Text("\nAvailable in v5.1").bold() : Text(""))) + Text(feature.enabledDescription(enabled)) .frame(height: 36, alignment: .topLeading) } diff --git a/apps/ios/Shared/Views/UserSettings/PreferencesView.swift b/apps/ios/Shared/Views/UserSettings/PreferencesView.swift index 4869c3bde3..d78fe421d6 100644 --- a/apps/ios/Shared/Views/UserSettings/PreferencesView.swift +++ b/apps/ios/Shared/Views/UserSettings/PreferencesView.swift @@ -21,7 +21,7 @@ struct PreferencesView: View { timedMessagesFeatureSection($preferences.timedMessages.allow) featureSection(.fullDelete, $preferences.fullDelete.allow) featureSection(.voice, $preferences.voice.allow) - featureSection(.calls, $preferences.calls.allow).disabled(true) + featureSection(.calls, $preferences.calls.allow) Section { Button("Reset") { preferences = currentPreferences } @@ -61,7 +61,7 @@ struct PreferencesView: View { } private func featureFooter(_ feature: ChatFeature, _ allowFeature: Binding) -> some View { - (Text(feature.allowDescription(allowFeature.wrappedValue)) + (feature == .calls ? Text("\nAvailable in v5.1").bold() : Text(""))) + Text(feature.allowDescription(allowFeature.wrappedValue)) .frame(height: 36, alignment: .topLeading) }