Skip to content
Open
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
1 change: 0 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ dependencies {
implementation "androidx.emoji2:emoji2-bundled:${emojiVersion}"
implementation "androidx.emoji2:emoji2-views:${emojiVersion}"
implementation "androidx.emoji2:emoji2-views-helper:${emojiVersion}"
implementation "androidx.emoji2:emoji2-emojipicker:${emojiVersion}"
implementation 'org.michaelevans.colorart:library:0.0.3'
implementation "androidx.work:work-runtime:${workVersion}"
implementation "androidx.work:work-rxjava2:${workVersion}"
Expand Down
8 changes: 1 addition & 7 deletions app/src/main/java/com/nextcloud/talk/api/NcApiCoroutines.kt
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,6 @@ interface NcApiCoroutines {
@Header("Authorization") authorization: String,
@Url url: String,
@Field("message") message: String,
@Field("actorDisplayName") actorDisplayName: String,
@Field("referenceId") referenceId: String,
@Field("replyTo") replyTo: Int?,
@Field("silent") sendWithoutNotification: Boolean,
@Field("threadTitle") threadTitle: String?,
Expand All @@ -356,16 +354,12 @@ interface NcApiCoroutines {

@FormUrlEncoded
@POST
@Suppress("LongParameterList")
suspend fun updateScheduledMessage(
@Header("Authorization") authorization: String,
@Url url: String,
@Field("message") message: String,
@Field("sendAt") sendAt: Int?,
@Field("replyTo") replyTo: Int?,
@Field("silent") sendWithoutNotification: Boolean,
@Field("threadTitle") threadTitle: String?,
@Field("threadId") threadId: Long?
@Field("silent") sendWithoutNotification: Boolean
): ChatOverallSingleMessage

@DELETE
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2543,7 +2543,7 @@ class ChatActivity :
(layoutManager as LinearLayoutManager).scrollToPositionWithOffset(position, 500)
} else {
Log.d(TAG, "message $messageId that should be scrolled to was not found (scrollToMessageWithId)")
startContextChatWindowForMessage(messageId, conversationThreadId.toString())
startContextChatWindowForMessage(messageId, conversationThreadId?.toString())
}
}

Expand Down Expand Up @@ -3523,7 +3523,6 @@ class ChatActivity :
roomToken
),
message = message,
displayName = conversationUser!!.displayName ?: "",
replyTo = replyToMessageId,
sendWithoutNotification = sendWithoutNotification,
threadTitle = threadTitle,
Expand Down
69 changes: 44 additions & 25 deletions app/src/main/java/com/nextcloud/talk/chat/ScheduleMessageCompose.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ package com.nextcloud.talk.chat

import android.content.Context
import android.text.format.DateFormat
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
Expand All @@ -25,6 +23,7 @@ import androidx.compose.foundation.layout.requiredSizeIn
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.wrapContentHeight
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
Expand Down Expand Up @@ -248,19 +247,35 @@ class ScheduleMessageCompose(
val context = LocalContext.current
Row(
modifier = Modifier
.padding(INT_8.dp)
.padding(start = 8.dp, end = 8.dp, top = 6.dp, bottom = 8.dp)
.fillMaxWidth()
) {
Text(stringResource(R.string.nc_schedule_message_title), modifier = Modifier.weight(HALF_WEIGHT))

val timeText = timeState.value.format(DateTimeFormatter.ofPattern(fullPattern(context)))

Spacer(modifier = Modifier.width(60.dp))
val dateText = timeState.value.format(
DateTimeFormatter.ofPattern("EEE, dd MMM")
)

Text(
timeText,
modifier = Modifier.weight(HALF_WEIGHT)
val timeText = timeState.value.format(
DateTimeFormatter.ofPattern(
if (DateFormat.is24HourFormat(context)) {
"HH:mm"
} else {
"hh:mm a"
}
)
)

Spacer(modifier = Modifier.width(44.dp))

Column(modifier = Modifier.weight(HALF_WEIGHT)) {
Text(
text = dateText
)
Text(
text = timeText
)
}
}
HorizontalDivider()
}
Expand Down Expand Up @@ -363,24 +378,28 @@ class ScheduleMessageCompose(

@Composable
private fun TimeOption(label: String, timeString: String, selected: Boolean, onClick: () -> Unit) {
Row(
Surface(
onClick = onClick,
modifier = Modifier
.fillMaxWidth()
.padding(INT_8.dp)
.background(
if (selected) {
MaterialTheme.colorScheme.primary
} else {
Color
.Transparent
},
RoundedCornerShape(4.dp)
)
.clickable { onClick() }
.wrapContentWidth(),
color = if (selected) {
MaterialTheme.colorScheme.inversePrimary
} else {
Color.Transparent
},
shape = RoundedCornerShape(10.dp)
) {
Text(label, modifier = Modifier.weight(HALF_WEIGHT))
Spacer(modifier = Modifier.width(60.dp))
Text(timeString, modifier = Modifier.weight(HALF_WEIGHT))
Row(
modifier = Modifier
.fillMaxWidth()
.padding(start = 8.dp, end = 6.dp, top = 6.dp, bottom = 8.dp),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {
Text(text = label, modifier = Modifier.weight(HALF_WEIGHT))
Spacer(modifier = Modifier.width(44.dp))
Text(text = timeString, modifier = Modifier.weight(HALF_WEIGHT))
}
}
}

Expand Down
Loading
Loading