Merge pull request #342 from sdex/hold_unhold

Add ability to put a call on hold
This commit is contained in:
Tibor Kaputa
2022-05-16 14:26:59 +02:00
committed by GitHub
5 changed files with 17 additions and 24 deletions

View File

@ -312,7 +312,7 @@ class CallActivity : SimpleActivity() {
private fun toggleHold() {
val isOnHold = CallManager.toggleHold()
val drawable = if (isOnHold) R.drawable.ic_call_vector else R.drawable.ic_pause_vector
val drawable = if (isOnHold) R.drawable.ic_phone_vector else R.drawable.ic_pause_inset
call_toggle_hold.setImageDrawable(getDrawable(drawable))
call_toggle_hold.contentDescription = getString(if (isOnHold) R.string.resume_call else R.string.hold_call)
hold_status_label.beVisibleIf(isOnHold)
@ -385,6 +385,10 @@ class CallActivity : SimpleActivity() {
if (statusTextId != 0) {
call_status_label.text = getString(statusTextId)
}
val isActiveCall = state == Call.STATE_ACTIVE || state == Call.STATE_HOLDING
call_toggle_hold.isEnabled = isActiveCall
call_toggle_hold.alpha = if (isActiveCall) 1.0f else 0.5f
}
private fun acceptCall() {

View File

@ -1,5 +0,0 @@
<vector android:height="24dp" android:tint="#FFFFFF"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20.01,15.38c-1.23,0 -2.42,-0.2 -3.53,-0.56 -0.35,-0.12 -0.74,-0.03 -1.01,0.24l-1.57,1.97c-2.83,-1.35 -5.48,-3.9 -6.89,-6.83l1.95,-1.66c0.27,-0.28 0.35,-0.67 0.24,-1.02 -0.37,-1.11 -0.56,-2.3 -0.56,-3.53 0,-0.54 -0.45,-0.99 -0.99,-0.99H4.19C3.65,3 3,3.24 3,3.99 3,13.28 10.73,21 20.01,21c0.71,0 0.99,-0.63 0.99,-1.18v-3.45c0,-0.54 -0.45,-0.99 -0.99,-0.99z"/>
</vector>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/ic_pause_vector"
android:insetLeft="4dp"
android:insetTop="4dp"
android:insetRight="4dp"
android:insetBottom="4dp" />

View File

@ -158,23 +158,10 @@
android:layout_marginTop="@dimen/bigger_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_pause_vector"
app:layout_constraintEnd_toStartOf="@+id/call_conference"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/call_toggle_speaker" />
<ImageView
android:id="@+id/call_conference"
android:layout_width="@dimen/dialpad_button_size"
android:layout_height="@dimen/dialpad_button_size"
android:layout_marginTop="@dimen/bigger_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_plus_vector"
android:src="@drawable/ic_pause_inset"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/call_toggle_hold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/call_toggle_speaker" />
<ImageView

View File

@ -48,9 +48,9 @@
<string name="show_dialpad">Zobraziť číselník</string>
<string name="hide_dialpad">Skryť číselník</string>
<string name="end_call">Ukončiť hovor</string>
<string name="hold_call">Hold call</string>
<string name="resume_call">Resume call</string>
<string name="call_on_hold">On Hold</string>
<string name="hold_call">Podržať hovor</string>
<string name="resume_call">Obnoviť hovor</string>
<string name="call_on_hold">Podržaný hovor</string>
<!-- Speed dial -->
<string name="speed_dial">Rýchle vytáčanie</string>