mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Added setting to disable phone account linking + hide menu for non sip.linphone.org accounts
This commit is contained in:
parent
483443fd60
commit
11f36dcb63
4 changed files with 21 additions and 6 deletions
|
|
@ -23,6 +23,7 @@ import android.os.Bundle
|
|||
import android.view.View
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||
import org.linphone.LinphoneApplication.Companion.corePreferences
|
||||
import org.linphone.R
|
||||
import org.linphone.activities.GenericFragment
|
||||
import org.linphone.activities.assistant.AssistantActivity
|
||||
|
|
@ -54,11 +55,15 @@ class EmailAccountValidationFragment : GenericFragment<AssistantEmailAccountVali
|
|||
it.consume {
|
||||
coreContext.newAccountConfigured(true)
|
||||
|
||||
val args = Bundle()
|
||||
args.putBoolean("AllowSkip", true)
|
||||
args.putString("Username", viewModel.accountCreator.username)
|
||||
args.putString("Password", viewModel.accountCreator.password)
|
||||
navigateToAccountLinking(args)
|
||||
if (!corePreferences.hideLinkPhoneNumber) {
|
||||
val args = Bundle()
|
||||
args.putBoolean("AllowSkip", true)
|
||||
args.putString("Username", viewModel.accountCreator.username)
|
||||
args.putString("Password", viewModel.accountCreator.password)
|
||||
navigateToAccountLinking(args)
|
||||
} else {
|
||||
requireActivity().finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -406,6 +406,7 @@ class AccountSettingsViewModel(val account: Account) : GenericSettingsViewModel(
|
|||
}
|
||||
}
|
||||
val linkPhoneNumberEvent = MutableLiveData<Event<Boolean>>()
|
||||
val hideLinkPhoneNumber = MutableLiveData<Boolean>()
|
||||
|
||||
val conferenceFactoryUriListener = object : SettingListenerStub() {
|
||||
override fun onTextValueChanged(newValue: String) {
|
||||
|
|
@ -495,6 +496,8 @@ class AccountSettingsViewModel(val account: Account) : GenericSettingsViewModel(
|
|||
conferenceFactoryUri.value = params.conferenceFactoryUri
|
||||
audioVideoConferenceFactoryUri.value = params.audioVideoConferenceFactoryAddress?.asStringUriOnly()
|
||||
limeServerUrl.value = params.limeServerUrl
|
||||
|
||||
hideLinkPhoneNumber.value = corePreferences.hideLinkPhoneNumber || params.identityAddress?.domain != corePreferences.defaultDomain
|
||||
}
|
||||
|
||||
private fun initTransportList() {
|
||||
|
|
|
|||
|
|
@ -379,6 +379,12 @@ class CorePreferences constructor(private val context: Context) {
|
|||
config.setString("assistant", "xmlrpc_url", value)
|
||||
}
|
||||
|
||||
var hideLinkPhoneNumber: Boolean
|
||||
get() = config.getBool("app", "hide_link_phone_number", false)
|
||||
set(value) {
|
||||
config.setBool("app", "hide_link_phone_number", value)
|
||||
}
|
||||
|
||||
/* Dialog related */
|
||||
|
||||
var limeSecurityPopupEnabled: Boolean
|
||||
|
|
|
|||
|
|
@ -130,7 +130,8 @@
|
|||
<include
|
||||
layout="@layout/settings_widget_basic"
|
||||
linphone:title="@{@string/account_settings_link_phone_number_title}"
|
||||
linphone:listener="@{viewModel.linkPhoneNumberListener}"/>
|
||||
linphone:listener="@{viewModel.linkPhoneNumberListener}"
|
||||
android:visibility="@{viewModel.hideLinkPhoneNumber ? View.GONE : View.VISIBLE}"/>
|
||||
|
||||
<include
|
||||
layout="@layout/settings_widget_basic"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue