Added display name fields in assistant for linphone account creation / log in
This commit is contained in:
parent
ed03a721a5
commit
ee5af2b462
7 changed files with 60 additions and 0 deletions
|
@ -17,6 +17,7 @@ Group changes to describe their impact on the project, as follows:
|
||||||
- Group calls directly from group chat rooms
|
- Group calls directly from group chat rooms
|
||||||
- Chat rooms can be individually muted (no notification when receiving a chat message)
|
- Chat rooms can be individually muted (no notification when receiving a chat message)
|
||||||
- Image & Video in-app viewers allow for full-screen display
|
- Image & Video in-app viewers allow for full-screen display
|
||||||
|
- Display name can be set during assistant when creating / logging in a sip.linphone.org account
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- In-call views have been re-designed
|
- In-call views have been re-designed
|
||||||
|
@ -33,6 +34,7 @@ Group changes to describe their impact on the project, as follows:
|
||||||
- One to one chat room creation process waiting indefinitely if chat room already exists
|
- One to one chat room creation process waiting indefinitely if chat room already exists
|
||||||
- "Blinking" in some views when presence is being received
|
- "Blinking" in some views when presence is being received
|
||||||
- Trying to keep the preferred driver (OpenSLES / AAudio) when switching device
|
- Trying to keep the preferred driver (OpenSLES / AAudio) when switching device
|
||||||
|
- Issues when storing presence in native contacts + potentially duplicated SIP addresses in contact details
|
||||||
|
|
||||||
## [4.6.10] - 2022-06-07
|
## [4.6.10] - 2022-06-07
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,8 @@ class AccountLoginViewModel(accountCreator: AccountCreator) : AbstractPhoneViewM
|
||||||
|
|
||||||
val waitForServerAnswer = MutableLiveData<Boolean>()
|
val waitForServerAnswer = MutableLiveData<Boolean>()
|
||||||
|
|
||||||
|
val displayName = MutableLiveData<String>()
|
||||||
|
|
||||||
val leaveAssistantEvent: MutableLiveData<Event<Boolean>> by lazy {
|
val leaveAssistantEvent: MutableLiveData<Event<Boolean>> by lazy {
|
||||||
MutableLiveData<Event<Boolean>>()
|
MutableLiveData<Event<Boolean>>()
|
||||||
}
|
}
|
||||||
|
@ -151,6 +153,8 @@ class AccountLoginViewModel(accountCreator: AccountCreator) : AbstractPhoneViewM
|
||||||
}
|
}
|
||||||
|
|
||||||
fun login() {
|
fun login() {
|
||||||
|
accountCreator.displayName = displayName.value
|
||||||
|
|
||||||
if (loginWithUsernamePassword.value == true) {
|
if (loginWithUsernamePassword.value == true) {
|
||||||
val result = accountCreator.setUsername(username.value)
|
val result = accountCreator.setUsername(username.value)
|
||||||
if (result != AccountCreator.UsernameStatus.Ok) {
|
if (result != AccountCreator.UsernameStatus.Ok) {
|
||||||
|
|
|
@ -52,6 +52,8 @@ class EmailAccountCreationViewModel(val accountCreator: AccountCreator) : ViewMo
|
||||||
val passwordConfirmation = MutableLiveData<String>()
|
val passwordConfirmation = MutableLiveData<String>()
|
||||||
val passwordConfirmationError = MutableLiveData<String>()
|
val passwordConfirmationError = MutableLiveData<String>()
|
||||||
|
|
||||||
|
val displayName = MutableLiveData<String>()
|
||||||
|
|
||||||
val createEnabled: MediatorLiveData<Boolean> = MediatorLiveData()
|
val createEnabled: MediatorLiveData<Boolean> = MediatorLiveData()
|
||||||
|
|
||||||
val waitForServerAnswer = MutableLiveData<Boolean>()
|
val waitForServerAnswer = MutableLiveData<Boolean>()
|
||||||
|
@ -146,6 +148,7 @@ class EmailAccountCreationViewModel(val accountCreator: AccountCreator) : ViewMo
|
||||||
accountCreator.username = username.value
|
accountCreator.username = username.value
|
||||||
accountCreator.password = password.value
|
accountCreator.password = password.value
|
||||||
accountCreator.email = email.value
|
accountCreator.email = email.value
|
||||||
|
accountCreator.displayName = displayName.value
|
||||||
|
|
||||||
waitForServerAnswer.value = true
|
waitForServerAnswer.value = true
|
||||||
val status = accountCreator.isAccountExist
|
val status = accountCreator.isAccountExist
|
||||||
|
|
|
@ -46,6 +46,8 @@ class PhoneAccountCreationViewModel(accountCreator: AccountCreator) : AbstractPh
|
||||||
val useUsername = MutableLiveData<Boolean>()
|
val useUsername = MutableLiveData<Boolean>()
|
||||||
val usernameError = MutableLiveData<String>()
|
val usernameError = MutableLiveData<String>()
|
||||||
|
|
||||||
|
val displayName = MutableLiveData<String>()
|
||||||
|
|
||||||
val createEnabled: MediatorLiveData<Boolean> = MediatorLiveData()
|
val createEnabled: MediatorLiveData<Boolean> = MediatorLiveData()
|
||||||
|
|
||||||
val waitForServerAnswer = MutableLiveData<Boolean>()
|
val waitForServerAnswer = MutableLiveData<Boolean>()
|
||||||
|
@ -141,6 +143,7 @@ class PhoneAccountCreationViewModel(accountCreator: AccountCreator) : AbstractPh
|
||||||
}
|
}
|
||||||
|
|
||||||
fun create() {
|
fun create() {
|
||||||
|
accountCreator.displayName = displayName.value
|
||||||
accountCreator.setPhoneNumber(phoneNumber.value, prefix.value)
|
accountCreator.setPhoneNumber(phoneNumber.value, prefix.value)
|
||||||
if (useUsername.value == true) {
|
if (useUsername.value == true) {
|
||||||
accountCreator.username = username.value
|
accountCreator.username = username.value
|
||||||
|
|
|
@ -238,6 +238,22 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/assistant_display_name_optional">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:text="@={viewModel.displayName}"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:inputType="textPersonName"
|
||||||
|
android:background="@color/transparent_color"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:onClick="@{() -> viewModel.login()}"
|
android:onClick="@{() -> viewModel.login()}"
|
||||||
android:enabled="@{viewModel.loginEnabled, default=false}"
|
android:enabled="@{viewModel.loginEnabled, default=false}"
|
||||||
|
|
|
@ -127,6 +127,22 @@
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/assistant_display_name_optional">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:text="@={viewModel.displayName}"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:inputType="textPersonName"
|
||||||
|
android:background="@color/transparent_color"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:onClick="@{() -> viewModel.create()}"
|
android:onClick="@{() -> viewModel.create()}"
|
||||||
android:enabled="@{viewModel.createEnabled, default=false}"
|
android:enabled="@{viewModel.createEnabled, default=false}"
|
||||||
|
|
|
@ -184,6 +184,22 @@
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/assistant_display_name_optional">
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
|
android:text="@={viewModel.displayName}"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:inputType="textPersonName"
|
||||||
|
android:background="@color/transparent_color"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
Loading…
Reference in a new issue