Various UI changes

This commit is contained in:
Sylvain Berfini 2023-09-18 15:45:10 +02:00
parent 6974c53194
commit 62139047b3
42 changed files with 196 additions and 238 deletions

View file

@ -312,7 +312,6 @@ class AccountCreationViewModel @UiThread constructor() : ViewModel(), CountryPic
@UiThread
fun confirmPhoneNumber() {
operationInProgress.value = true
coreContext.postOnCoreThread {
if (::accountCreator.isInitialized) {
val prefix = internationalPrefix.value.orEmpty().trim()
@ -343,7 +342,6 @@ class AccountCreationViewModel @UiThread constructor() : ViewModel(), CountryPic
Log.e(
"$TAG Failed to compute phone number using international prefix [$digitsPrefix] and number [$number]"
)
operationInProgress.postValue(false)
val error = AppUtils.getString(
R.string.assistant_account_register_invalid_phone_number_error
@ -382,7 +380,6 @@ class AccountCreationViewModel @UiThread constructor() : ViewModel(), CountryPic
}
}
phoneNumberError.postValue(error)
operationInProgress.postValue(false)
}
} else {
Log.e("$TAG Account creator hasn't been initialized!")

View file

@ -165,7 +165,7 @@ class HelpViewModel @UiThread constructor() : ViewModel() {
fun checkForUpdate() {
val currentVersion = version.value.orEmpty()
coreContext.postOnCoreThread { core ->
Log.i("[$TAG] Checking for update using current version [$currentVersion]")
Log.i("$TAG Checking for update using current version [$currentVersion]")
core.checkForUpdate(currentVersion)
}
}

View file

@ -54,8 +54,8 @@ class SettingsViewModel @UiThread constructor() : ViewModel() {
val isVibrationAvailable = MutableLiveData<Boolean>()
init {
expandCalls.value = true
expandNetwork.value = true
expandCalls.value = false
expandNetwork.value = false
expandUserInterface.value = false
val vibrator = coreContext.context.getSystemService(Vibrator::class.java)

View file

@ -24,11 +24,13 @@ import androidx.annotation.WorkerThread
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import org.linphone.LinphoneApplication.Companion.coreContext
import org.linphone.R
import org.linphone.core.Call
import org.linphone.core.Core
import org.linphone.core.CoreListenerStub
import org.linphone.core.tools.Log
import org.linphone.ui.main.model.AccountModel
import org.linphone.utils.AppUtils
import org.linphone.utils.Event
import org.linphone.utils.LinphoneUtils
@ -167,7 +169,7 @@ open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
callDisplayName.postValue(
contact?.name ?: LinphoneUtils.getDisplayName(currentCall.remoteAddress)
)
callStatus.postValue(currentCall.state.name) // TODO: improve text
callStatus.postValue(callStateToString(currentCall.state))
} else {
val firstCall = core.calls.firstOrNull()
if (firstCall != null) {
@ -177,10 +179,38 @@ open class AbstractTopBarViewModel @UiThread constructor() : ViewModel() {
callDisplayName.postValue(
contact?.name ?: LinphoneUtils.getDisplayName(firstCall.remoteAddress)
)
callStatus.postValue(firstCall.state.name) // TODO: improve text
callStatus.postValue(callStateToString(firstCall.state))
}
}
Log.i("$TAG At least a call, asking fragment to change status bar color")
changeSystemTopBarColorToInCallEvent.postValue(Event(true))
}
@WorkerThread
private fun callStateToString(state: Call.State): String {
return when (state) {
Call.State.IncomingEarlyMedia, Call.State.IncomingReceived -> {
AppUtils.getString(R.string.voip_call_state_incoming_received)
}
Call.State.OutgoingInit, Call.State.OutgoingProgress -> {
AppUtils.getString(R.string.voip_call_state_outgoing_progress)
}
Call.State.OutgoingRinging, Call.State.OutgoingEarlyMedia -> {
AppUtils.getString(R.string.voip_call_state_outgoing_ringing)
}
Call.State.Connected, Call.State.StreamsRunning, Call.State.Updating, Call.State.UpdatedByRemote -> {
AppUtils.getString(R.string.voip_call_state_connected)
}
Call.State.Pausing, Call.State.Paused, Call.State.PausedByRemote -> {
AppUtils.getString(R.string.voip_call_state_paused)
}
Call.State.End, Call.State.Released, Call.State.Error -> {
AppUtils.getString(R.string.voip_call_state_ended)
}
else -> {
// TODO: handle other states
""
}
}
}
}

View file

@ -107,7 +107,7 @@ class AppUtils {
)
redToast.message = message
redToast.icon = icon
redToast.shadowColor = R.drawable.shape_toast_red_shadow
redToast.shadowColor = R.drawable.shape_toast_red_background
redToast.textColor = R.color.red_danger
redToast.root.visibility = View.GONE
return redToast
@ -128,7 +128,7 @@ class AppUtils {
)
greenToast.message = message
greenToast.icon = icon
greenToast.shadowColor = R.drawable.shape_toast_green_shadow
greenToast.shadowColor = R.drawable.shape_toast_green_background
greenToast.textColor = R.color.green_online
greenToast.root.visibility = View.GONE
return greenToast
@ -149,7 +149,7 @@ class AppUtils {
)
blueToast.message = message
blueToast.icon = icon
blueToast.shadowColor = R.drawable.shape_toast_blue_shadow
blueToast.shadowColor = R.drawable.shape_toast_blue_background
blueToast.textColor = R.color.blue_trusted
blueToast.root.visibility = View.GONE
return blueToast

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="@color/green_online" />
<item android:color="@color/gray_10"/>
</selector>

View file

@ -1,13 +1,9 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="18dp"
android:height="18dp"
android:viewportWidth="18"
android:viewportHeight="18">
<path
android:name="path"
android:pathData="M 16.5 18 C 17.328 18 18 17.328 18 16.5 C 18 15.672 17.328 15 16.5 15 L 5.121 15 L 17.561 2.561 C 18.146 1.975 18.146 1.025 17.561 0.439 C 16.975 -0.146 16.025 -0.146 15.439 0.439 L 3 12.879 L 3 1.5 C 3 0.672 2.328 0 1.5 0 C 0.672 0 0 0.672 0 1.5 L 0 16.5 C 0 17.328 0.672 18 1.5 18 L 16.5 18 Z"
android:fillColor="#4fae80"
android:strokeWidth="1"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
<path
android:pathData="M11,12C11.552,12 12,11.552 12,11C12,10.448 11.552,10 11,10L3.414,10L11.707,1.707C12.098,1.317 12.098,0.683 11.707,0.293C11.317,-0.098 10.683,-0.098 10.293,0.293L2,8.586L2,1C2,0.448 1.552,0 1,-0C0.448,-0 -0,0.448 -0,1L-0,11C-0,11.552 0.448,12 1,12L11,12Z"
android:fillColor="#4FAE80"/>
</vector>

View file

@ -1,13 +1,9 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="18dp"
android:height="18dp"
android:viewportWidth="18"
android:viewportHeight="18">
<path
android:name="path_1"
android:pathData="M 16.5 18 C 17.328 18 18 17.328 18 16.5 C 18 15.672 17.328 15 16.5 15 L 5.121 15 L 17.561 2.561 C 18.146 1.975 18.146 1.025 17.561 0.439 C 16.975 -0.146 16.025 -0.146 15.439 0.439 L 3 12.879 L 3 1.5 C 3 0.672 2.328 0 1.5 0 C 0.672 0 0 0.672 0 1.5 L 0 16.5 C 0 17.328 0.672 18 1.5 18 L 16.5 18 Z"
android:fillColor="#dd5f5f"
android:strokeWidth="1"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
<path
android:pathData="M11,12C11.552,12 12,11.552 12,11C12,10.448 11.552,10 11,10L3.414,10L11.707,1.707C12.098,1.317 12.098,0.683 11.707,0.293C11.317,-0.098 10.683,-0.098 10.293,0.293L2,8.586L2,1C2,0.448 1.552,0 1,-0C0.448,-0 -0,0.448 -0,1L-0,11C-0,11.552 0.448,12 1,12L11,12Z"
android:fillColor="#DD5F5F"/>
</vector>

View file

@ -1,13 +1,9 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="18dp"
android:height="18dp"
android:viewportWidth="18"
android:viewportHeight="18">
<path
android:name="path"
android:pathData="M 1.5 0 C 0.672 0 0 0.672 0 1.5 C 0 2.328 0.672 3 1.5 3 L 12.879 3 L 0.439 15.439 C -0.146 16.025 -0.146 16.975 0.439 17.561 C 1.025 18.146 1.975 18.146 2.561 17.561 L 15 5.121 L 15 16.5 C 15 17.328 15.672 18 16.5 18 C 17.328 18 18 17.328 18 16.5 L 18 1.5 C 18 0.672 17.328 0 16.5 0 L 1.5 0 Z"
android:fillColor="#4aa8ff"
android:strokeWidth="1"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
<path
android:pathData="M1,0C0.448,0 0,0.448 0,1C0,1.552 0.448,2 1,2H8.586L0.293,10.293C-0.098,10.683 -0.098,11.317 0.293,11.707C0.683,12.098 1.317,12.098 1.707,11.707L10,3.414V11C10,11.552 10.448,12 11,12C11.552,12 12,11.552 12,11V1C12,0.448 11.552,0 11,0H1Z"
android:fillColor="#4AA8FF"/>
</vector>

View file

@ -1,13 +1,9 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="18dp"
android:height="18dp"
android:viewportWidth="18"
android:viewportHeight="18">
<path
android:name="path"
android:pathData="M 1.5 0 C 0.672 0 0 0.672 0 1.5 C 0 2.328 0.672 3 1.5 3 L 12.879 3 L 0.439 15.439 C -0.146 16.025 -0.146 16.975 0.439 17.561 C 1.025 18.146 1.975 18.146 2.561 17.561 L 15 5.121 L 15 16.5 C 15 17.328 15.672 18 16.5 18 C 17.328 18 18 17.328 18 16.5 L 18 1.5 C 18 0.672 17.328 0 16.5 0 L 1.5 0 Z"
android:fillColor="#dd5f5f"
android:strokeWidth="1"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="12dp"
android:viewportWidth="12"
android:viewportHeight="12">
<path
android:pathData="M1,0C0.448,0 0,0.448 0,1C0,1.552 0.448,2 1,2H8.586L0.293,10.293C-0.098,10.683 -0.098,11.317 0.293,11.707C0.683,12.098 1.317,12.098 1.707,11.707L10,3.414V11C10,11.552 10.448,12 11,12C11.552,12 12,11.552 12,11V1C12,0.448 11.552,0 11,0H1Z"
android:fillColor="#DD5F5F"/>
</vector>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<size android:width="70dp" android:height="70dp" />
<size android:width="60dp" android:height="60dp" />
<solid android:color="@color/white"/>
</shape>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<size android:width="70dp" android:height="70dp" />
<size android:width="60dp" android:height="60dp" />
<solid android:color="@color/gray_11"/>
</shape>

View file

@ -3,13 +3,13 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="50dp" />
<solid android:color="@color/blue_trusted"/>
<corners android:radius="15dp" />
<solid android:color="@color/primary_color"/>
</shape>
</item>
<item android:bottom="2dp">
<shape android:shape="rectangle">
<corners android:radius="50dp" />
<corners android:radius="15dp" />
<solid
android:color="@color/white" />
</shape>

View file

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="15dp" />
<solid android:color="@color/primary_color"/>
</shape>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="50dp" />
<solid android:color="@color/white" />
<stroke android:color="@color/blue_trusted" android:width="2dp"/>
</shape>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="50dp" />
<solid android:color="@color/white" />
<stroke android:color="@color/green_online" android:width="2dp"/>
</shape>

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="50dp" />
<solid android:color="@color/green_online"/>
</shape>
</item>
<item android:bottom="2dp">
<shape android:shape="rectangle">
<corners android:radius="50dp" />
<solid
android:color="@color/white" />
</shape>
</item>
</layer-list>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="50dp" />
<solid android:color="@color/white" />
<stroke android:color="@color/red_danger" android:width="2dp"/>
</shape>

View file

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="50dp" />
<solid android:color="@color/red_danger"/>
</shape>
</item>
<item android:bottom="2dp">
<shape android:shape="rectangle">
<corners android:radius="50dp" />
<solid
android:color="@color/white" />
</shape>
</item>
</layer-list>

View file

@ -244,6 +244,7 @@
app:layout_constraintBottom_toBottomOf="@id/connection_bottom_anchor"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:onClick="@{() -> viewModel.toggleRegister()}"
android:id="@+id/connected_switch"
android:layout_width="wrap_content"

View file

@ -35,14 +35,27 @@
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
<ImageView
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginTop="19dp"
android:src="@drawable/header"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/back"
app:layout_constraintBottom_toBottomOf="@id/title"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/assistant_page_title_style"
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:paddingBottom="27dp"
android:text="@string/assistant_login_third_party_sip_account"
android:textColor="@color/gray_9"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

View file

@ -19,8 +19,8 @@
<ImageView
android:id="@+id/call_status"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginTop="11dp"
android:layout_marginStart="2dp"
android:src="@{model.iconResId, default=@drawable/outgoing_call}"
@ -51,7 +51,7 @@
android:text="@{model.dateTime, default=`August 13th 2023 | 07:47 PM`}"
android:textSize="12sp"
android:textColor="@{model.isSuccessful ? @color/gray_9 : @color/red_danger, default=@color/gray_9}"
app:layout_constraintStart_toEndOf="@id/call_status"
app:layout_constraintStart_toStartOf="@id/direction_label"
app:layout_constraintTop_toBottomOf="@id/direction_label"
app:layout_constraintBottom_toTopOf="@id/separator"/>

View file

@ -43,7 +43,7 @@
app:layout_constraintTop_toBottomOf="@id/handle"
app:flow_horizontalStyle="spread"
app:flow_wrapMode="aligned"
app:flow_verticalGap="16dp"
app:flow_verticalGap="10dp"
app:flow_maxElementsWrap="3"
app:constraint_referenced_ids="digit_1, digit_2, digit_3, digit_4, digit_5, digit_6, digit_7, digit_8, digit_9, digit_star, digit_0, digit_sharp" />
@ -172,13 +172,14 @@
android:id="@+id/call"
android:onClick="@{() -> model.onCallClicked()}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="21dp"
android:layout_height="@dimen/voip_button_size"
android:paddingStart="30dp"
android:paddingTop="15dp"
android:paddingEnd="30dp"
android:paddingBottom="15dp"
android:src="@drawable/phone"
android:padding="15dp"
android:elevation="3dp"
android:background="@drawable/circle_green_button_background"
android:background="@drawable/squircle_green_button_background"
app:tint="@color/white"
app:layout_constraintTop_toBottomOf="@id/flow"
app:layout_constraintStart_toStartOf="parent"
@ -196,8 +197,8 @@
android:padding="20dp"
android:elevation="3dp"
app:layout_constraintTop_toBottomOf="@id/flow"
app:layout_constraintStart_toEndOf="@id/call"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/digit_sharp"
app:layout_constraintEnd_toEndOf="@id/digit_sharp"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -18,16 +18,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/dialog_background_shadow"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_squircle_primary_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="@id/dialog_background" />
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
@ -35,7 +25,7 @@
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_squircle_white_background"
android:src="@drawable/shape_dialog_background"
app:layout_constraintWidth_max="@dimen/dialog_max_width"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -15,16 +15,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/dialog_background_shadow"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_squircle_primary_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="@id/dialog_background" />
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
@ -32,7 +22,7 @@
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_squircle_white_background"
android:src="@drawable/shape_dialog_background"
android:clickable="true"
android:focusable="true"
app:layout_constraintWidth_max="@dimen/dialog_max_width"

View file

@ -15,16 +15,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/dialog_background_shadow"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_squircle_primary_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="@id/dialog_background" />
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
@ -32,7 +22,7 @@
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_squircle_white_background"
android:src="@drawable/shape_dialog_background"
app:layout_constraintWidth_max="@dimen/dialog_max_width"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -16,16 +16,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/dialog_background_shadow"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_squircle_primary_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="@id/dialog_background" />
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
@ -33,7 +23,7 @@
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_squircle_white_background"
android:src="@drawable/shape_dialog_background"
app:layout_constraintWidth_max="@dimen/dialog_max_width"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -16,16 +16,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/dialog_background_shadow"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_squircle_primary_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="@id/dialog_background" />
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
@ -33,7 +23,7 @@
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_squircle_white_background"
android:src="@drawable/shape_dialog_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintWidth_max="@dimen/dialog_max_width"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -15,16 +15,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/dialog_background_shadow"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_squircle_primary_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="@id/dialog_background" />
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
@ -32,7 +22,7 @@
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_squircle_white_background"
android:src="@drawable/shape_dialog_background"
app:layout_constraintWidth_max="@dimen/dialog_max_width"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -15,16 +15,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/dialog_background_shadow"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_squircle_primary_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="@id/dialog_background" />
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
@ -32,7 +22,7 @@
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_squircle_white_background"
android:src="@drawable/shape_dialog_background"
app:layout_constraintWidth_max="@dimen/dialog_max_width"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -16,16 +16,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/dialog_background_shadow"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_squircle_primary_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="@id/dialog_background" />
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
@ -33,7 +23,7 @@
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_squircle_white_background"
android:src="@drawable/shape_dialog_background"
app:layout_constraintWidth_max="@dimen/dialog_max_width"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -16,16 +16,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/dialog_background_shadow"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_squircle_primary_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="@id/dialog_background" />
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
@ -33,7 +23,7 @@
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_squircle_white_background"
android:src="@drawable/shape_dialog_background"
app:layout_constraintWidth_max="@dimen/dialog_max_width"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -16,16 +16,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/dialog_background_shadow"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/shape_squircle_primary_background"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="@id/dialog_background" />
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
@ -33,7 +23,7 @@
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_squircle_white_background"
android:src="@drawable/shape_dialog_background"
app:layout_constraintWidth_max="@dimen/dialog_max_width"
app:layout_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -72,6 +72,7 @@
app:layout_constraintEnd_toStartOf="@id/debug_mode_switch" />
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:onClick="@{() -> viewModel.toggleDebugMode()}"
android:id="@+id/debug_mode_switch"
android:layout_width="wrap_content"

View file

@ -9,11 +9,26 @@
type="Boolean" />
</data>
<RelativeLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="@{visibility ? View.VISIBLE : View.GONE}"
android:background="@color/dialog_background">
android:background="@color/dialog_background"
android:visibility="@{visibility ? View.VISIBLE : View.GONE, default=gone}">
<ImageView
android:id="@+id/dialog_background"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="2dp"
android:src="@drawable/shape_dialog_background"
app:layout_constraintWidth_max="@dimen/dialog_max_width"
app:layout_constraintHeight_max="300dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progress"
@ -21,18 +36,29 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:indicatorColor="@color/primary_color"
android:indeterminate="true" />
android:indeterminate="true"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintTop_toTopOf="@id/dialog_background"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintBottom_toTopOf="@id/title"/>
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style_800"
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/operation_in_progress_overlay"
android:textColor="@color/primary_color"
android:textSize="18sp"
android:layout_below="@id/progress"
android:layout_centerHorizontal="true"/>
android:layout_centerHorizontal="true"
app:layout_constraintTop_toBottomOf="@id/progress"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintBottom_toBottomOf="@id/dialog_background"/>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -121,6 +121,7 @@
app:layout_constraintEnd_toStartOf="@id/echo_canceller_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/echo_canceller_switch"
android:onClick="@{() -> viewModel.toggleEchoCanceller()}"
android:visibility="@{viewModel.expandCalls ? View.VISIBLE : View.GONE}"
@ -150,6 +151,7 @@
app:layout_constraintEnd_toStartOf="@id/route_audio_to_bluetooth_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/route_audio_to_bluetooth_switch"
android:onClick="@{() -> viewModel.toggleRouteAudioToBluetooth()}"
android:visibility="@{viewModel.expandCalls ? View.VISIBLE : View.GONE}"
@ -179,6 +181,7 @@
app:layout_constraintEnd_toStartOf="@id/enable_video_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/enable_video_switch"
android:onClick="@{() -> viewModel.toggleEnableVideo()}"
android:visibility="@{viewModel.expandCalls ? View.VISIBLE : View.GONE}"
@ -223,6 +226,7 @@
app:layout_constraintEnd_toStartOf="@id/auto_initiate_video_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/auto_initiate_video_switch"
android:onClick="@{() -> viewModel.toggleAutoInitiateVideoCalls()}"
android:visibility="@{viewModel.expandCalls ? View.VISIBLE : View.GONE}"
@ -267,6 +271,7 @@
app:layout_constraintEnd_toStartOf="@id/auto_accept_video_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/auto_accept_video_switch"
android:onClick="@{() -> viewModel.toggleAutoAcceptVideoRequests()}"
android:visibility="@{viewModel.expandCalls ? View.VISIBLE : View.GONE}"
@ -296,6 +301,7 @@
app:layout_constraintEnd_toStartOf="@id/device_ringtone_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/device_ringtone_switch"
android:onClick="@{() -> viewModel.toggleDeviceRingtone()}"
android:visibility="@{viewModel.expandCalls ? View.VISIBLE : View.GONE}"
@ -325,6 +331,7 @@
app:layout_constraintEnd_toStartOf="@id/vibrate_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/vibrate_switch"
android:onClick="@{() -> viewModel.toggleVibrateOnIncomingCalls()}"
android:visibility="@{viewModel.expandCalls &amp;&amp; viewModel.isVibrationAvailable ? View.VISIBLE : View.GONE}"
@ -354,6 +361,7 @@
app:layout_constraintEnd_toStartOf="@id/auto_record_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/auto_record_switch"
android:onClick="@{() -> viewModel.toggleAutoRecordCall()}"
android:visibility="@{viewModel.expandCalls ? View.VISIBLE : View.GONE}"
@ -423,6 +431,7 @@
app:layout_constraintEnd_toStartOf="@id/wifi_only_switch"/>
<com.google.android.material.materialswitch.MaterialSwitch
style="@style/material_switch_style"
android:id="@+id/wifi_only_switch"
android:onClick="@{() -> viewModel.toggleUseWifiOnly()}"
android:visibility="@{viewModel.expandNetwork ? View.VISIBLE : View.GONE}"
@ -496,6 +505,7 @@
android:text="@string/settings_advanced_title"
android:drawableEnd="@drawable/caret_right"
android:drawableTint="@color/gray_9"
app:layout_constraintVertical_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/user_interface"

View file

@ -31,7 +31,7 @@
android:id="@+id/toast_background"
android:layout_width="match_parent"
android:layout_height="0dp"
android:src="@{shadow_color, default=@drawable/shape_toast_blue_shadow}"
android:src="@{shadow_color, default=@drawable/shape_toast_blue_background}"
app:layout_constraintBottom_toBottomOf="@id/toast_message"
app:layout_constraintEnd_toEndOf="@id/toast_message"
app:layout_constraintStart_toStartOf="@id/toast_icon"

View file

@ -139,8 +139,8 @@
<ImageView
android:id="@+id/call_direction_icon"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginStart="10dp"
android:adjustViewBounds="true"
android:src="@{viewModel.isOutgoing ? @drawable/outgoing_call : @drawable/incoming_call, default=@drawable/outgoing_call}"

View file

@ -17,8 +17,8 @@
<ImageView
android:id="@+id/call_direction_icon"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginStart="10dp"
android:adjustViewBounds="true"
android:src="@drawable/incoming_call"

View file

@ -17,8 +17,8 @@
<ImageView
android:id="@+id/call_direction_icon"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginStart="10dp"
android:adjustViewBounds="true"
android:src="@drawable/outgoing_call"

View file

@ -272,6 +272,12 @@
<string name="voip_action_pause_call">Pause</string>
<string name="voip_action_resume_call">Pause</string>
<string name="voip_action_record_call">Record</string>
<string name="voip_call_state_outgoing_progress">In progress</string>
<string name="voip_call_state_outgoing_ringing">Ringing</string>
<string name="voip_call_state_incoming_received">Incoming</string>
<string name="voip_call_state_connected">Active</string>
<string name="voip_call_state_paused">Paused</string>
<string name="voip_call_state_ended">Ended</string>
<string name="chat_message_reaction_received">%s has reacted by %s to: %s</string>

View file

@ -127,4 +127,9 @@
<item name="maxLines">1</item>
<item name="android:ellipsize">end</item>
</style>
<style name="material_switch_style">
<item name="thumbTint">@color/white</item>
<item name="trackTint">@color/switch_track_color</item>
<item name="trackDecorationTint">@color/transparent_color</item>
</style>
</resources>