Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,6 @@ dependencies {
implementation(platform("androidx.compose:compose-bom:2026.02.00"))
implementation("androidx.compose.ui:ui")
implementation 'androidx.compose.material3:material3:1.4.0'
// replace with xml drawables instead of legacy fallback lib, see
// https://developer.android.com/jetpack/androidx/releases/compose-material3#1.4.0
implementation 'androidx.compose.material:material-icons-core:1.7.8'
implementation("androidx.compose.material:material-icons-extended")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation 'androidx.activity:activity-compose:1.12.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import android.util.Log
import com.nextcloud.talk.activities.ParticipantUiState

@SuppressLint("UnusedBoxWithConstraintsScope")
@Suppress("LongParameterList")
@Suppress("LongParameterList", "LongMethod")
@Composable
fun ParticipantGrid(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
Expand All @@ -35,9 +33,12 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.nextcloud.talk.R
Expand Down Expand Up @@ -135,9 +136,36 @@ private fun CloseButton(onClick: () -> Unit) {
.border(1.dp, Color.White.copy(alpha = 0.8f), CircleShape)
) {
Icon(
imageVector = Icons.Default.Close,
imageVector = ImageVector.vectorResource(R.drawable.ic_baseline_close_24),
contentDescription = stringResource(R.string.close),
tint = Color.White
)
}
}

@Preview(name = "LTR")
@Composable
fun ScreenShareComponentPreview(nick: String = "Alice") {
ScreenShareComponent(
participantUiState = ParticipantUiState(
sessionKey = null,
baseUrl = "https://nextcloud.example.com",
roomToken = "token",
nick = nick,
isConnected = true,
isAudioEnabled = true,
isStreamEnabled = true,
isScreenStreamEnabled = false,
raisedHand = false,
isInternal = false
),
eglBase = null,
onCloseIconClick = {}
)
}

@Preview(name = "RTL / Arabic", locale = "ar")
@Composable
fun ScreenShareComponentRtlPreview() {
ScreenShareComponentPreview(nick = "أليس")
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.DateRange
import androidx.compose.material3.DatePicker
import androidx.compose.material3.DatePickerDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
Expand All @@ -54,11 +52,14 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.colorResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import com.nextcloud.talk.R
import com.nextcloud.talk.ui.theme.ViewThemeUtils
import com.nextcloud.talk.utils.preview.ComposePreviewUtils
import java.time.DayOfWeek
import java.time.Instant
import java.time.LocalDate
Expand Down Expand Up @@ -286,7 +287,10 @@ class ScheduleMessageCompose(
@Suppress("LongMethod")
@Composable
private fun CollapsableDateTime(shouldDismiss: MutableState<Boolean>, isCollapsed: MutableState<Boolean>) {
GeneralIconButton(icon = Icons.Filled.DateRange, label = stringResource(R.string.custom)) {
GeneralIconButton(
icon = ImageVector.vectorResource(R.drawable.ic_date_range_24px),
label = stringResource(R.string.custom)
) {
selectedOption.value = SelectedOption.NONE
isCollapsed.value = !isCollapsed.value
}
Expand Down Expand Up @@ -417,3 +421,27 @@ class ScheduleMessageCompose(
private const val CUBED_PADDING = 0.33f
}
}

@Preview(name = "Light Mode")
@Preview(
name = "Dark Mode",
uiMode = android.content.res.Configuration.UI_MODE_NIGHT_YES
)
@Preview(name = "RTL / Arabic", locale = "ar")
@Composable
fun GetScheduleDialogPreview() {
val context = LocalContext.current
val previewUtils = ComposePreviewUtils.getInstance(context)
val scheduleCompose = ScheduleMessageCompose(
initialMessage = "Hello Alice",
initialScheduledAt = null,
onDismiss = {},
onSchedule = { _, _ -> },
defaultSendWithoutNotification = false,
viewThemeUtils = previewUtils.viewThemeUtils
)
scheduleCompose.GetScheduleDialog(
shouldDismiss = remember { mutableStateOf(false) },
context = context
)
}
Loading
Loading