|
|
|
@ -3,6 +3,7 @@ package com.dfsek.feldspar.ui |
|
|
|
|
import android.net.Uri |
|
|
|
|
import android.os.Bundle |
|
|
|
|
import android.os.Environment |
|
|
|
|
import android.text.format.DateFormat |
|
|
|
|
import android.util.Log |
|
|
|
|
import androidx.activity.compose.rememberLauncherForActivityResult |
|
|
|
|
import androidx.activity.compose.setContent |
|
|
|
@ -64,6 +65,9 @@ import org.matrix.android.sdk.api.session.room.sender.SenderInfo |
|
|
|
|
import java.io.File |
|
|
|
|
import java.io.FileInputStream |
|
|
|
|
import java.io.FileOutputStream |
|
|
|
|
import java.text.SimpleDateFormat |
|
|
|
|
import java.time.format.DateTimeFormatter |
|
|
|
|
import java.util.* |
|
|
|
|
import kotlin.math.roundToInt |
|
|
|
|
|
|
|
|
|
class RoomActivity : AppCompatActivity() { |
|
|
|
@ -378,11 +382,29 @@ class RoomActivity : AppCompatActivity() { |
|
|
|
|
Avatar(senderInfo.avatarUrl, AppState.Preferences.roomAvatarSize, name = senderInfo.disambiguatedDisplayName) |
|
|
|
|
|
|
|
|
|
Column { |
|
|
|
|
Text( |
|
|
|
|
senderInfo.disambiguatedDisplayName, |
|
|
|
|
fontSize = 14.sp, |
|
|
|
|
style = TextStyle(fontWeight = FontWeight.Bold) |
|
|
|
|
) |
|
|
|
|
Row { |
|
|
|
|
Text( |
|
|
|
|
senderInfo.disambiguatedDisplayName, |
|
|
|
|
fontSize = 14.sp, |
|
|
|
|
style = TextStyle(fontWeight = FontWeight.Bold) |
|
|
|
|
) |
|
|
|
|
timelineEvents.first().event.root.originServerTs?.let { |
|
|
|
|
val context = LocalContext.current |
|
|
|
|
val time = remember { |
|
|
|
|
if (DateFormat.is24HourFormat(context)) { |
|
|
|
|
SimpleDateFormat("HH:mm", Locale.US) |
|
|
|
|
} else { |
|
|
|
|
SimpleDateFormat("h:mm a", Locale.US) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Spacer(modifier = Modifier.width(5.dp)) |
|
|
|
|
Text( |
|
|
|
|
time.format(Date(it)), |
|
|
|
|
fontSize = 12.sp |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
timelineEvents.forEach { Message(it) } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|