-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: send and receive in-call reactions [#WPB-14254]
- Loading branch information
1 parent
22a0b22
commit 424abf8
Showing
33 changed files
with
1,521 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
app/src/main/kotlin/com/wire/android/ui/calling/controlbuttons/HangUpOngoingButton.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2024 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
*/ | ||
|
||
package com.wire.android.ui.calling.controlbuttons | ||
|
||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.shape.CircleShape | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.DpSize | ||
import com.wire.android.R | ||
import com.wire.android.ui.common.button.WireButtonState | ||
import com.wire.android.ui.common.button.WirePrimaryIconButton | ||
import com.wire.android.ui.common.dimensions | ||
import com.wire.android.ui.theme.WireTheme | ||
import com.wire.android.ui.theme.wireDimensions | ||
import com.wire.android.util.ui.PreviewMultipleThemes | ||
|
||
@Composable | ||
fun HangUpOngoingButton( | ||
onHangUpButtonClicked: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
width: Dp = dimensions().defaultCallingControlsWidth, | ||
height: Dp = dimensions().defaultCallingControlsHeight, | ||
iconSize: Dp = dimensions().bigCallingHangUpButtonIconSize, | ||
) { | ||
WirePrimaryIconButton( | ||
iconResource = R.drawable.ic_call_reject, | ||
contentDescription = R.string.content_description_calling_hang_up_call, | ||
state = WireButtonState.Error, | ||
shape = CircleShape, | ||
minSize = DpSize(width, height), | ||
minClickableSize = DpSize(width, height), | ||
iconSize = iconSize, | ||
onButtonClicked = onHangUpButtonClicked, | ||
modifier = modifier, | ||
) | ||
} | ||
|
||
@PreviewMultipleThemes | ||
@Composable | ||
fun PreviewComposableHangUpOngoingButton() = WireTheme { | ||
HangUpOngoingButton( | ||
modifier = Modifier | ||
.width(MaterialTheme.wireDimensions.bigCallingControlsSize) | ||
.height(MaterialTheme.wireDimensions.bigCallingControlsSize), | ||
onHangUpButtonClicked = { } | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
app/src/main/kotlin/com/wire/android/ui/calling/model/InCallReaction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Wire | ||
* Copyright (C) 2024 Wire Swiss GmbH | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see http://www.gnu.org/licenses/. | ||
*/ | ||
package com.wire.android.ui.calling.model | ||
|
||
data class InCallReaction( | ||
val emoji: String, | ||
val sender: ReactionSender, | ||
) | ||
|
||
sealed interface ReactionSender { | ||
data object You : ReactionSender | ||
data class Other(val name: String) : ReactionSender | ||
data object Unknown : ReactionSender | ||
} |
Oops, something went wrong.