Added pause/resume from in-call extras actions + update available dialog + removed unused resources

This commit is contained in:
Sylvain Berfini 2023-09-29 17:03:50 +02:00
parent e35b76d0f4
commit c72e2cb852
33 changed files with 241 additions and 220 deletions

View file

@ -78,6 +78,10 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
val remoteRecordingLabel = MutableLiveData<String>()
val canBePaused = MutableLiveData<Boolean>()
val isPaused = MutableLiveData<Boolean>()
val isMicrophoneMuted = MutableLiveData<Boolean>()
val isSpeakerEnabled = MutableLiveData<Boolean>()
@ -207,6 +211,9 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
fullScreenMode.postValue(false)
}
}
isPaused.postValue(isCallPaused())
canBePaused.postValue(canCallBePaused())
}
@WorkerThread
@ -539,6 +546,24 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
}
}
@UiThread
fun togglePause() {
coreContext.postOnCoreThread {
if (::currentCall.isInitialized) {
when (isCallPaused()) {
true -> {
Log.i("$TAG Resuming call [${currentCall.remoteAddress.asStringUriOnly()}]")
currentCall.resume()
}
false -> {
Log.i("$TAG Pausing call [${currentCall.remoteAddress.asStringUriOnly()}]")
currentCall.pause()
}
}
}
}
}
@UiThread
fun toggleFullScreen() {
if (fullScreenMode.value == false && isVideoEnabled.value == false) return
@ -647,6 +672,9 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
isOutgoing.postValue(call.dir == Call.Dir.Outgoing)
isPaused.postValue(isCallPaused())
canBePaused.postValue(canCallBePaused())
val address = call.remoteAddress.clone()
address.clean()
displayedAddress.postValue(address.asStringUriOnly())
@ -695,4 +723,23 @@ class CurrentCallViewModel @UiThread constructor() : ViewModel() {
)
isBluetoothEnabled.postValue(audioDevice?.type == AudioDevice.Type.Bluetooth)
}
@WorkerThread
private fun isCallPaused(): Boolean {
if (::currentCall.isInitialized) {
return when (currentCall.state) {
Call.State.Paused, Call.State.Pausing -> true
else -> false
}
}
return false
}
@WorkerThread
private fun canCallBePaused(): Boolean {
return ::currentCall.isInitialized && !currentCall.mediaInProgress() && when (currentCall.state) {
Call.State.StreamsRunning, Call.State.PausedByRemote, Call.State.Paused -> true
else -> false
}
}
}

View file

@ -311,7 +311,7 @@ class ContactFragment : GenericFragment() {
}
}
model.confirmRemovalEvent.observe(viewLifecycleOwner) {
model.confirmEvent.observe(viewLifecycleOwner) {
it.consume {
Log.w(
"$TAG Deleting contact [${viewModel.contact.value?.name?.value}]"

View file

@ -125,7 +125,7 @@ class EditContactFragment : GenericFragment() {
}
}
model.confirmRemovalEvent.observe(viewLifecycleOwner) {
model.confirmEvent.observe(viewLifecycleOwner) {
it.consume {
findNavController().popBackStack()
dialog.dismiss()
@ -242,7 +242,7 @@ class EditContactFragment : GenericFragment() {
}
}
model.confirmRemovalEvent.observe(viewLifecycleOwner) {
model.confirmEvent.observe(viewLifecycleOwner) {
it.consume {
backPressedCallback.isEnabled = false
findNavController().popBackStack()

View file

@ -223,7 +223,7 @@ class NewContactFragment : GenericFragment() {
}
}
model.confirmRemovalEvent.observe(viewLifecycleOwner) {
model.confirmEvent.observe(viewLifecycleOwner) {
it.consume {
backPressedCallback.isEnabled = false
findNavController().popBackStack()

View file

@ -15,6 +15,8 @@ import org.linphone.databinding.HelpFragmentBinding
import org.linphone.ui.main.MainActivity
import org.linphone.ui.main.fragment.GenericFragment
import org.linphone.ui.main.help.viewmodel.HelpViewModel
import org.linphone.ui.main.history.model.ConfirmationDialogModel
import org.linphone.utils.DialogUtils
@UiThread
class HelpFragment : GenericFragment() {
@ -88,11 +90,10 @@ class HelpFragment : GenericFragment() {
}
viewModel.newVersionAvailableEvent.observe(viewLifecycleOwner) {
it.consume { version ->
(requireActivity() as MainActivity).showGreenToast(
getString(R.string.help_update_available_toast_message, version),
R.drawable.info
)
it.consume { pair ->
val version = pair.first
val url = pair.second
showUpdateAvailableDialog(version, url)
}
}
@ -114,4 +115,37 @@ class HelpFragment : GenericFragment() {
}
}
}
private fun showUpdateAvailableDialog(version: String, url: String) {
val message = getString(R.string.dialog_update_available_message, version)
val model = ConfirmationDialogModel()
val dialog = DialogUtils.getUpdateAvailableDialog(
requireActivity(),
model,
message
)
model.dismissEvent.observe(viewLifecycleOwner) {
it.consume {
dialog.dismiss()
}
}
model.confirmEvent.observe(viewLifecycleOwner) {
it.consume {
try {
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(browserIntent)
} catch (ise: IllegalStateException) {
Log.e(
"$TAG Can't start ACTION_VIEW intent for URL [$url], IllegalStateException: $ise"
)
}
dialog.dismiss()
}
}
dialog.show()
}
}

View file

@ -45,8 +45,8 @@ class HelpViewModel @UiThread constructor() : ViewModel() {
val debugModeEnabled = MutableLiveData<Boolean>()
val newVersionAvailableEvent: MutableLiveData<Event<String>> by lazy {
MutableLiveData<Event<String>>()
val newVersionAvailableEvent: MutableLiveData<Event<Pair<String, String>>> by lazy {
MutableLiveData<Event<Pair<String, String>>>()
}
val versionUpToDateEvent: MutableLiveData<Event<Boolean>> by lazy {
@ -80,8 +80,8 @@ class HelpViewModel @UiThread constructor() : ViewModel() {
when (result) {
VersionUpdateCheckResult.NewVersionAvailable -> {
Log.i("$TAG Update available, version [$version], url [$url]")
if (!version.isNullOrEmpty()) {
newVersionAvailableEvent.postValue(Event(version))
if (!version.isNullOrEmpty() && !url.isNullOrEmpty()) {
newVersionAvailableEvent.postValue(Event(Pair(version, url)))
}
}
VersionUpdateCheckResult.UpToDate -> {

View file

@ -204,7 +204,7 @@ class HistoryContactFragment : GenericFragment() {
}
}
model.confirmRemovalEvent.observe(viewLifecycleOwner) {
model.confirmEvent.observe(viewLifecycleOwner) {
it.consume {
Log.w(
"$TAG Removing call entries with [${viewModel.callLogModel.value?.address?.asStringUriOnly()}] from database"

View file

@ -270,7 +270,7 @@ class HistoryListFragment : AbstractTopBarFragment() {
}
}
model.confirmRemovalEvent.observe(viewLifecycleOwner) {
model.confirmEvent.observe(viewLifecycleOwner) {
it.consume {
Log.w("$TAG Removing all call entries from database")
listViewModel.removeAllCallLogs()

View file

@ -26,7 +26,7 @@ import org.linphone.utils.Event
class ConfirmationDialogModel @UiThread constructor() {
val dismissEvent = MutableLiveData<Event<Boolean>>()
val confirmRemovalEvent = MutableLiveData<Event<Boolean>>()
val confirmEvent = MutableLiveData<Event<Boolean>>()
@UiThread
fun dismiss() {
@ -34,7 +34,7 @@ class ConfirmationDialogModel @UiThread constructor() {
}
@UiThread
fun confirmRemoval() {
confirmRemovalEvent.value = Event(true)
fun confirm() {
confirmEvent.value = Event(true)
}
}

View file

@ -113,7 +113,7 @@ class AccountProfileFragment : GenericFragment() {
}
}
model.confirmRemovalEvent.observe(viewLifecycleOwner) {
model.confirmEvent.observe(viewLifecycleOwner) {
it.consume {
viewModel.deleteAccount()
dialog.dismiss()

View file

@ -43,6 +43,7 @@ import org.linphone.databinding.DialogPickNumberOrAddressBinding
import org.linphone.databinding.DialogRemoveAccountBinding
import org.linphone.databinding.DialogRemoveAllCallLogsBinding
import org.linphone.databinding.DialogRemoveCallLogsBinding
import org.linphone.databinding.DialogUpdateAvailableBinding
import org.linphone.ui.assistant.model.AcceptConditionsAndPolicyDialogModel
import org.linphone.ui.assistant.model.ConfirmPhoneNumberDialogModel
import org.linphone.ui.call.model.ZrtpSasConfirmationDialogModel
@ -246,6 +247,24 @@ class DialogUtils {
return getDialog(context, binding)
}
@UiThread
fun getUpdateAvailableDialog(
context: Context,
viewModel: ConfirmationDialogModel,
message: String
): Dialog {
val binding: DialogUpdateAvailableBinding = DataBindingUtil.inflate(
LayoutInflater.from(context),
R.layout.dialog_update_available,
null,
false
)
binding.viewModel = viewModel
binding.message.text = message
return getDialog(context, binding)
}
@UiThread
fun getZrtpSasConfirmationDialog(
context: Context,
@ -262,6 +281,7 @@ class DialogUtils {
return getDialog(context, binding)
}
@UiThread
private fun getDialog(context: Context, binding: ViewDataBinding): Dialog {
val dialog = Dialog(context, R.style.Theme_LinphoneDialog)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:drawable="@drawable/shape_primary_button_disabled_background" />
<item android:state_pressed="true"
android:drawable="@drawable/shape_circle_green_pressed_background" />
<item
android:drawable="@drawable/shape_circle_green_background" />
</selector>

View file

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="256"
android:viewportHeight="256">
<path
android:pathData="M213.66,82.34l-56,-56A8,8 0,0 0,152 24L56,24A16,16 0,0 0,40 40L40,216a16,16 0,0 0,16 16L200,232a16,16 0,0 0,16 -16L216,88A8,8 0,0 0,213.66 82.34ZM160,51.31 L188.69,80L160,80ZM200,216L56,216L56,40h88L144,88a8,8 0,0 0,8 8h48L200,216ZM168,136a8,8 0,0 1,-8 8L96,144a8,8 0,0 1,0 -16h64A8,8 0,0 1,168 136ZM168,168a8,8 0,0 1,-8 8L96,176a8,8 0,0 1,0 -16h64A8,8 0,0 1,168 168Z"
android:fillColor="#4e6074"/>
</vector>

View file

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="256"
android:viewportHeight="256">
<path
android:pathData="M128,24A104,104 0,1 0,232 128,104.11 104.11,0 0,0 128,24ZM128,216a88,88 0,1 1,88 -88A88.1,88.1 0,0 1,128 216ZM128,56a72,72 0,1 0,72 72A72.08,72.08 0,0 0,128 56ZM128,184a56,56 0,1 1,56 -56A56.06,56.06 0,0 1,128 184Z"
android:fillColor="#4e6074"/>
</vector>

View file

@ -1,13 +0,0 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="vector"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:name="path"
android:pathData="M 7 21.5 L 9 21.5 L 9 23.5 L 7 23.5 L 7 21.5 Z M 12 12.5 C 13.66 12.5 15 11.16 15 9.5 L 15 3.5 C 15 1.84 13.66 0.5 12 0.5 C 10.34 0.5 9 1.84 9 3.5 L 9 9.5 C 9 11.16 10.34 12.5 12 12.5 Z M 11 3.5 C 11 2.95 11.45 2.5 12 2.5 C 12.55 2.5 13 2.95 13 3.5 L 13 9.5 C 13 10.06 12.56 10.5 12 10.5 C 11.45 10.5 11 10.05 11 9.5 L 11 3.5 Z M 11 21.5 L 13 21.5 L 13 23.5 L 11 23.5 L 11 21.5 Z M 15 21.5 L 17 21.5 L 17 23.5 L 15 23.5 L 15 21.5 Z M 19 9.5 L 17.3 9.5 C 17.3 12.5 14.76 14.6 12 14.6 C 9.24 14.6 6.7 12.5 6.7 9.5 L 5 9.5 C 5 12.91 7.72 15.73 11 16.22 L 11 19.5 L 13 19.5 L 13 16.22 C 16.28 15.73 19 12.91 19 9.5 Z"
android:fillColor="#6c7a87"
android:strokeWidth="1"/>
</vector>

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="oval">
<size android:width="70dp" android:height="70dp" />
<solid android:color="@color/green_success_500"/>
</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="oval">
<size android:width="70dp" android:height="70dp" />
<solid android:color="@color/green_success_200"/>
</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="oval">
<size android:width="70dp" android:height="70dp" />
<solid android:color="@color/green_success_700"/>
</shape>

View file

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/white"/>
</shape>

View file

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="256"
android:viewportHeight="256">
<path
android:pathData="M144,157.68a68,68 0,1 0,-71.9 0c-20.65,6.76 -39.23,19.39 -54.17,37.17a8,8 0,1 0,12.24 10.3C50.25,181.19 77.91,168 108,168s57.75,13.19 77.87,37.15a8,8 0,0 0,12.26 -10.3C183.18,177.07 164.6,164.44 144,157.68ZM56,100a52,52 0,1 1,52 52A52.06,52.06 0,0 1,56 100ZM244.25,143.07 L239.59,140.38a23.6,23.6 0,0 0,0 -8.76l4.66,-2.69a8,8 0,0 0,-8 -13.86l-4.67,2.7a23.92,23.92 0,0 0,-7.58 -4.39L224,108a8,8 0,0 0,-16 0v5.38a23.92,23.92 0,0 0,-7.58 4.39l-4.67,-2.7a8,8 0,1 0,-8 13.86l4.66,2.69a23.6,23.6 0,0 0,0 8.76l-4.66,2.69a8,8 0,0 0,8 13.86l4.67,-2.7a23.92,23.92 0,0 0,7.58 4.39L208,164a8,8 0,0 0,16 0v-5.38a23.92,23.92 0,0 0,7.58 -4.39l4.67,2.7a7.92,7.92 0,0 0,4 1.07,8 8,0 0,0 4,-14.93ZM208,136a8,8 0,1 1,8 8A8,8 0,0 1,208 136Z"
android:fillColor="#4e6074"/>
</vector>

View file

@ -137,6 +137,9 @@
<ImageView
android:id="@+id/pause_call"
android:onClick="@{() -> viewModel.togglePause()}"
android:enabled="@{viewModel.canBePaused}"
android:selected="@{viewModel.isPaused}"
android:layout_width="0dp"
android:layout_height="@dimen/call_button_size"
android:layout_marginTop="@dimen/call_extra_button_top_margin"
@ -227,6 +230,7 @@
<androidx.appcompat.widget.AppCompatTextView
style="@style/in_call_extra_action_label_style"
android:id="@+id/pause_call_label"
android:onClick="@{() -> viewModel.togglePause()}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingBottom="15dp"

View file

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="center"
android:orientation="horizontal"
android:padding="5dp">
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/country_flag"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingStart="5dp"
android:paddingEnd="5dp" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/country_name"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingStart="5dp"
android:paddingEnd="5dp" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/country_prefix"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingStart="5dp"
android:paddingEnd="5dp" />
</LinearLayout>

View file

@ -1,88 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<import type="android.view.View"/>
<variable
name="cancelClickListener"
type="android.view.View.OnClickListener"/>
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp">
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|center"
android:singleLine="true"
android:text="@string/assistant_country_picker_title"/>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp">
<com.google.android.material.textfield.TextInputLayout
android:layout_toStartOf="@id/clear_field"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/assistant_country_picker_hint">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/search_country"
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>
<ImageView
android:id="@+id/clear_field"
android:onClick="@{() -> searchCountry.setText(``)}"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:src="@drawable/x" />
</RelativeLayout>
<ListView
android:id="@+id/countryList"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:cacheColorHint="@color/transparent_color"
android:divider="@color/gray_main2_200"
android:dividerHeight="1dp" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:onClick="@{cancelClickListener}"
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/cancel"
android:gravity="end" />
</LinearLayout>
</layout>

View file

@ -137,6 +137,9 @@
<ImageView
android:id="@+id/pause_call"
android:onClick="@{() -> viewModel.togglePause()}"
android:enabled="@{viewModel.canBePaused}"
android:selected="@{viewModel.isPaused}"
android:layout_width="0dp"
android:layout_height="@dimen/call_button_size"
android:layout_marginTop="@dimen/call_extra_button_top_margin"
@ -223,6 +226,7 @@
<androidx.appcompat.widget.AppCompatTextView
style="@style/in_call_extra_action_label_style"
android:id="@+id/pause_call_label"
android:onClick="@{() -> viewModel.togglePause()}"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:paddingBottom="15dp"

View file

@ -75,7 +75,7 @@
app:layout_constraintBottom_toTopOf="@id/confirm"/>
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{() -> viewModel.confirmRemoval()}"
android:onClick="@{() -> viewModel.confirm()}"
style="@style/primary_button_label_style"
android:id="@+id/confirm"
android:layout_width="0dp"

View file

@ -75,7 +75,7 @@
app:layout_constraintBottom_toTopOf="@id/confirm"/>
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{() -> viewModel.confirmRemoval()}"
android:onClick="@{() -> viewModel.confirm()}"
style="@style/primary_button_label_style"
android:id="@+id/confirm"
android:layout_width="0dp"

View file

@ -75,7 +75,7 @@
app:layout_constraintBottom_toTopOf="@id/confirm"/>
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{() -> viewModel.confirmRemoval()}"
android:onClick="@{() -> viewModel.confirm()}"
style="@style/primary_button_label_style"
android:id="@+id/confirm"
android:layout_width="0dp"

View file

@ -75,7 +75,7 @@
app:layout_constraintBottom_toTopOf="@id/confirm"/>
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{() -> viewModel.confirmRemoval()}"
android:onClick="@{() -> viewModel.confirm()}"
style="@style/primary_button_label_style"
android:id="@+id/confirm"
android:layout_width="0dp"

View file

@ -75,7 +75,7 @@
app:layout_constraintBottom_toTopOf="@id/confirm"/>
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{() -> viewModel.confirmRemoval()}"
android:onClick="@{() -> viewModel.confirm()}"
style="@style/primary_button_label_style"
android:id="@+id/confirm"
android:layout_width="0dp"

View file

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View" />
<import type="android.graphics.Typeface" />
<variable
name="viewModel"
type="org.linphone.ui.main.history.model.ConfirmationDialogModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:onClick="@{() -> viewModel.dismiss()}"
android:layout_width="match_parent"
android:layout_height="match_parent">
<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_constraintBottom_toBottomOf="@id/anchor"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/title" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/section_header_style"
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:paddingTop="@dimen/dialog_top_bottom_margin"
android:text="@string/dialog_update_available_title"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintBottom_toTopOf="@id/message"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
style="@style/default_text_style"
android:id="@+id/message"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_marginTop="10dp"
android:text="@string/dialog_update_available_message"
android:textSize="14sp"
app:layout_constraintBottom_toTopOf="@id/cancel"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintTop_toBottomOf="@id/title" />
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{() -> viewModel.dismiss()}"
style="@style/secondary_button_label_style"
android:id="@+id/cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:text="@string/dialog_cancel"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintTop_toBottomOf="@id/message"
app:layout_constraintBottom_toTopOf="@id/confirm"/>
<androidx.appcompat.widget.AppCompatTextView
android:onClick="@{() -> viewModel.confirm()}"
style="@style/primary_button_label_style"
android:id="@+id/confirm"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:text="@string/dialog_install"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintTop_toBottomOf="@id/cancel"
app:layout_constraintBottom_toTopOf="@id/anchor"/>
<View
android:id="@+id/anchor"
android:layout_width="wrap_content"
android:layout_height="@dimen/dialog_top_bottom_margin"
app:layout_constraintTop_toBottomOf="@id/confirm"
app:layout_constraintStart_toStartOf="@id/dialog_background"
app:layout_constraintEnd_toEndOf="@id/dialog_background"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

View file

@ -12,7 +12,8 @@
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="21dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:text="@string/history_call_start_suggestions_list_title"

View file

@ -30,7 +30,6 @@
<dimen name="top_bar_height">55dp</dimen>
<dimen name="toast_top_margin">70dp</dimen> <!-- 15dp + top_bar_height -->
<dimen name="toast_elevation">5dp</dimen>
<dimen name="call_top_bar_text_height">28dp</dimen>
<dimen name="call_top_bar_info_height">48dp</dimen> <!-- Size of top text + top & bottom margins -->

View file

@ -60,6 +60,7 @@
<string name="dialog_call">Call</string>
<string name="dialog_delete">Delete</string>
<string name="dialog_close">Close</string>
<string name="dialog_install">Install</string>
<string name="dialog_do_not_show_anymore">Do not show this dialog anymore</string>
<string name="dialog_general_terms_and_privacy_policy_title">General terms &amp; privacy policy</string>
<string name="dialog_general_terms_and_privacy_policy_message">blah blah blah</string> <!-- TODO FIXME -->
@ -85,8 +86,9 @@
<string name="dialog_account_secure_mode_interoperable_message">Blah</string> <!-- TODO -->
<string name="dialog_remove_account_title">Delete %s?</string>
<string name="dialog_remove_account_message">You can reconnect at any time by clicking “Add an account”. However, all data on this phone will be deleted.</string>
<string name="dialog_update_available_title">Update available</string>
<string name="dialog_update_available_message">A new version %s is available. Do you want to update?</string>
<string name="toast_assistant_qr_code_valid">QR code validated!</string>
<string name="toast_assistant_qr_code_invalid">Invalid QR code!</string>
<string name="toast_sip_address_copied_to_clipboard">SIP address copied into clipboard</string>
<string name="toast_phone_number_copied_to_clipboard">Number copied into clipboard</string>
@ -97,8 +99,6 @@
<string name="toast_alert_low_cellular_signal_cleared">Cellular signal is no longer low</string>
<string name="toast_call_can_be_trusted">This call can be trusted</string>
<string name="assistant_country_picker_title">Choose your country</string>
<string name="assistant_country_picker_hint">Country name</string>
<string name="assistant_account_login">Login</string>
<string name="assistant_scan_qr_code">Scan QR code</string>
<string name="assistant_qr_code_provisioning_done">Configuration successfully applied</string>
@ -162,7 +162,6 @@
<string name="help_about_check_for_update">Check update</string>
<string name="help_about_contribute_translations_title">Contribute on &appName; translation</string>
<string name="help_about_advanced_title">Advanced</string>
<string name="help_update_available_toast_message">A new version is available: %s</string>
<string name="help_version_up_to_date_toast_message">Your version is up-to-date</string>
<string name="help_error_checking_version_toast_message">An error occurred while checking for update</string>
<string name="help_troubleshooting_title">Troubleshooting</string>
@ -252,7 +251,6 @@
<string name="history_call_start_suggestions_list_title">Suggestions</string>
<string name="history_list_empty_history">No call for the moment…</string>
<string name="contacts_list_title">Contacts</string>
<string name="contacts_list_empty">No contact for the moment…</string>
<string name="contacts_list_favourites_title">Favourites</string>
<string name="contacts_list_all_contacts_title">All contacts</string>