Merge develop into feature/fga/dagger_setup
This commit is contained in:
commit
4c88d8e3c2
214 changed files with 2662 additions and 1833 deletions
|
|
@ -1,22 +1,21 @@
|
|||
package io.element.android.x.core.compose
|
||||
|
||||
import android.util.Log
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.SideEffect
|
||||
import androidx.compose.runtime.remember
|
||||
import io.element.android.x.core.BuildConfig
|
||||
|
||||
import timber.log.Timber
|
||||
|
||||
// Note the inline function below which ensures that this function is essentially
|
||||
// copied at the call site to ensure that its logging only recompositions from the
|
||||
// original call site.
|
||||
@Composable
|
||||
inline fun LogCompositions(tag: String, msg: String) {
|
||||
fun LogCompositions(tag: String, msg: String) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
val ref = remember { Ref(0) }
|
||||
SideEffect { ref.value++ }
|
||||
Log.d(tag, "Compositions: $msg ${ref.value}")
|
||||
Timber.d(tag, "Compositions: $msg ${ref.value}")
|
||||
}
|
||||
}
|
||||
|
||||
class Ref(var value: Int)
|
||||
class Ref(var value: Int)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import androidx.lifecycle.LifecycleOwner
|
|||
fun OnLifecycleEvent(onEvent: (owner: LifecycleOwner, event: Lifecycle.Event) -> Unit) {
|
||||
val eventHandler = rememberUpdatedState(onEvent)
|
||||
val lifecycleOwner = rememberUpdatedState(LocalLifecycleOwner.current)
|
||||
|
||||
|
||||
DisposableEffect(lifecycleOwner.value) {
|
||||
val lifecycle = lifecycleOwner.value.lifecycle
|
||||
val observer = LifecycleEventObserver { owner, event ->
|
||||
|
|
@ -24,4 +24,4 @@ fun OnLifecycleEvent(onEvent: (owner: LifecycleOwner, event: Lifecycle.Event) ->
|
|||
lifecycle.removeObserver(observer)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import androidx.compose.runtime.MutableState
|
|||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
|
||||
|
||||
@Composable
|
||||
public fun textFieldState(stateValue: String): MutableState<String> =
|
||||
remember(stateValue) { mutableStateOf(stateValue) }
|
||||
remember(stateValue) { mutableStateOf(stateValue) }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package io.element.android.x.core.data.flow
|
||||
package io.element.android.x.core.coroutine
|
||||
|
||||
import android.os.SystemClock
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package io.element.android.x.core.data
|
||||
package io.element.android.x.core.coroutine
|
||||
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.awaitAll
|
||||
|
|
@ -7,4 +7,4 @@ import kotlinx.coroutines.coroutineScope
|
|||
// https://jivimberg.io/blog/2018/05/04/parallel-map-in-kotlin/
|
||||
suspend fun <A, B> Iterable<A>.parallelMap(f: suspend (A) -> B): List<B> = coroutineScope {
|
||||
map { async { f(it) } }.awaitAll()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
package io.element.android.x.core.data
|
||||
|
||||
import android.util.Log
|
||||
import timber.log.Timber
|
||||
|
||||
inline fun <A> tryOrNull(message: String? = null, operation: () -> A): A? {
|
||||
return try {
|
||||
operation()
|
||||
} catch (any: Throwable) {
|
||||
if (message != null) {
|
||||
Log.e("TAG", message, any)
|
||||
Timber.e("TAG", message, any)
|
||||
}
|
||||
null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,18 +24,18 @@ class DimensionConverter(val resources: Resources) {
|
|||
@Px
|
||||
fun dpToPx(dp: Int): Int {
|
||||
return TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
dp.toFloat(),
|
||||
resources.displayMetrics
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
dp.toFloat(),
|
||||
resources.displayMetrics
|
||||
).toInt()
|
||||
}
|
||||
|
||||
@Px
|
||||
fun spToPx(sp: Int): Int {
|
||||
return TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_SP,
|
||||
sp.toFloat(),
|
||||
resources.displayMetrics
|
||||
TypedValue.COMPLEX_UNIT_SP,
|
||||
sp.toFloat(),
|
||||
resources.displayMetrics
|
||||
).toInt()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ fun View.showKeyboard(andRequestFocus: Boolean = false) {
|
|||
|
||||
fun View.setHorizontalPadding(padding: Int) {
|
||||
setPadding(
|
||||
padding,
|
||||
paddingTop,
|
||||
padding,
|
||||
paddingBottom
|
||||
padding,
|
||||
paddingTop,
|
||||
padding,
|
||||
paddingBottom
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@ android {
|
|||
implementation(libs.accompanist.systemui)
|
||||
ksp(libs.showkase.processor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<manifest>
|
||||
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.airbnb.android.showkase.annotation.ShowkaseColor
|
|||
|
||||
@ShowkaseColor(name = "LightGrey", group = "Material Design")
|
||||
val LightGrey = Color(0x993C3C43)
|
||||
|
||||
@ShowkaseColor(name = "DarkGrey", group = "Material Design")
|
||||
val DarkGrey = Color(0x99EBEBF5)
|
||||
|
||||
|
|
@ -37,7 +38,8 @@ val Vermilion = Color(0xFFFF5B55)
|
|||
|
||||
// TODO Update color
|
||||
val MessageHighlightLight = Azure
|
||||
|
||||
// TODO Update color
|
||||
val MessageHighlightDark = Azure
|
||||
|
||||
val LinkColor = Color(0xFF054F6E)
|
||||
val LinkColor = Color(0xFF054F6E)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,11 @@ package io.element.android.x.designsystem
|
|||
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.SideEffect
|
||||
|
|
@ -42,8 +46,9 @@ private val LightColorScheme = lightColorScheme(
|
|||
onTertiary = Color.White,
|
||||
onBackground = Color(0xFF1C1B1F),
|
||||
onSurface = Color(0xFF1C1B1F),
|
||||
*/
|
||||
*/
|
||||
)
|
||||
@Suppress("CompositionLocalAllowlist")
|
||||
val LocalIsDarkTheme = compositionLocalOf<Boolean> { error("Not defined") }
|
||||
|
||||
@Composable
|
||||
|
|
@ -81,7 +86,4 @@ fun ElementXTheme(
|
|||
content = content
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import androidx.compose.ui.text.style.TextAlign
|
|||
import androidx.compose.ui.unit.sp
|
||||
import com.airbnb.android.showkase.annotation.ShowkaseTypography
|
||||
|
||||
|
||||
@ShowkaseTypography(name = "Body Large", group = "Element")
|
||||
val bodyLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
|
|
@ -47,7 +46,7 @@ val Typography = Typography(
|
|||
lineHeight = 16.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
)
|
||||
*/
|
||||
*/
|
||||
)
|
||||
|
||||
object ElementTextStyles {
|
||||
|
|
@ -231,6 +230,4 @@ object ElementTextStyles {
|
|||
textAlign = TextAlign.Center
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@ object VectorIcons {
|
|||
val Delete = R.drawable.ic_baseline_delete_outline_24
|
||||
val Reply = R.drawable.ic_baseline_reply_24
|
||||
val Edit = R.drawable.ic_baseline_edit_24
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,8 @@ import androidx.compose.ui.platform.LocalUriHandler
|
|||
import androidx.compose.ui.text.AnnotatedString
|
||||
import androidx.compose.ui.text.TextLayoutResult
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import kotlinx.collections.immutable.ImmutableMap
|
||||
import kotlinx.collections.immutable.persistentMapOf
|
||||
|
||||
@Composable
|
||||
fun ClickableLinkText(
|
||||
|
|
@ -26,7 +28,7 @@ fun ClickableLinkText(
|
|||
interactionSource: MutableInteractionSource,
|
||||
modifier: Modifier = Modifier,
|
||||
style: TextStyle = LocalTextStyle.current,
|
||||
inlineContent: Map<String, InlineTextContent> = mapOf(),
|
||||
inlineContent: ImmutableMap<String, InlineTextContent> = persistentMapOf(),
|
||||
) {
|
||||
val uriHandler = LocalUriHandler.current
|
||||
val layoutResult = remember { mutableStateOf<TextLayoutResult?>(null) }
|
||||
|
|
@ -56,7 +58,6 @@ fun ClickableLinkText(
|
|||
uriHandler.openUri(linkAnnotations.first().item)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Text(
|
||||
|
|
@ -69,4 +70,3 @@ fun ClickableLinkText(
|
|||
inlineContent = inlineContent
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,14 +18,18 @@ import androidx.compose.ui.window.Dialog
|
|||
import androidx.compose.ui.window.DialogProperties
|
||||
|
||||
@Composable
|
||||
fun ProgressDialog(text: String? = null, onDismiss: () -> Unit = {}) {
|
||||
fun ProgressDialog(
|
||||
modifier: Modifier = Modifier,
|
||||
text: String? = null,
|
||||
onDismiss: () -> Unit = {},
|
||||
) {
|
||||
Dialog(
|
||||
onDismissRequest = onDismiss,
|
||||
properties = DialogProperties(dismissOnBackPress = false, dismissOnClickOutside = false)
|
||||
) {
|
||||
Box(
|
||||
contentAlignment = Alignment.Center,
|
||||
modifier = Modifier
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.background(
|
||||
color = MaterialTheme.colorScheme.onBackground,
|
||||
|
|
@ -52,5 +56,5 @@ fun ProgressDialog(text: String? = null, onDismiss: () -> Unit = {}) {
|
|||
@Composable
|
||||
@Preview
|
||||
fun ProgressDialogPreview() {
|
||||
ProgressDialog("test dialog content")
|
||||
}
|
||||
ProgressDialog(text = "test dialog content")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import androidx.compose.material3.Text
|
|||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
|
||||
@Composable
|
||||
fun VectorButton(text: String, enabled: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier) {
|
||||
Button(
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
package io.element.android.x.designsystem.components
|
||||
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun VectorTextField(value: String, onValueChange: (String) -> Unit, isError: Boolean = false) {
|
||||
OutlinedTextField(
|
||||
value = value,
|
||||
onValueChange = onValueChange,
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
isError = isError
|
||||
)
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import android.util.Log
|
||||
package io.element.android.x.designsystem.components.avatar
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.size
|
||||
|
|
@ -16,7 +17,7 @@ import androidx.compose.ui.unit.sp
|
|||
import coil.compose.AsyncImage
|
||||
import io.element.android.x.designsystem.AvatarGradientEnd
|
||||
import io.element.android.x.designsystem.AvatarGradientStart
|
||||
import io.element.android.x.designsystem.components.avatar.AvatarData
|
||||
import timber.log.Timber
|
||||
|
||||
@Composable
|
||||
fun Avatar(avatarData: AvatarData, modifier: Modifier = Modifier) {
|
||||
|
|
@ -44,7 +45,7 @@ private fun ImageAvatar(
|
|||
AsyncImage(
|
||||
model = avatarData.model,
|
||||
onError = {
|
||||
Log.e("TAG", "Error $it\n${it.result}", it.result.throwable)
|
||||
Timber.e("TAG", "Error $it\n${it.result}", it.result.throwable)
|
||||
},
|
||||
contentDescription = null,
|
||||
contentScale = ContentScale.Crop,
|
||||
|
|
@ -52,7 +53,6 @@ private fun ImageAvatar(
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
@Composable
|
||||
private fun InitialsAvatar(
|
||||
initials: String,
|
||||
|
|
@ -77,5 +77,3 @@ private fun InitialsAvatar(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,5 +30,4 @@ data class AvatarData(
|
|||
result = 31 * result + size.value
|
||||
return result
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@ enum class AvatarSize(val value: Int) {
|
|||
BIG(48);
|
||||
|
||||
val dp = value.dp
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,25 +8,24 @@ import androidx.compose.material3.AlertDialog
|
|||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.MutableState
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
fun ConfirmationDialog(
|
||||
isDisplayed: MutableState<Boolean>,
|
||||
isDisplayed: Boolean,
|
||||
title: String,
|
||||
content: String,
|
||||
modifier: Modifier = Modifier,
|
||||
submitText: String = "OK",
|
||||
cancelText: String = "Cancel",
|
||||
onSubmitClicked: () -> Unit = {},
|
||||
onDismiss: () -> Unit = {},
|
||||
) {
|
||||
if (!isDisplayed.value) return
|
||||
if (!isDisplayed) return
|
||||
AlertDialog(
|
||||
modifier = modifier,
|
||||
onDismissRequest = onDismiss,
|
||||
title = {
|
||||
Text(text = title)
|
||||
|
|
@ -42,11 +41,10 @@ fun ConfirmationDialog(
|
|||
Button(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
onClick = {
|
||||
isDisplayed.value = false
|
||||
onDismiss()
|
||||
onSubmitClicked()
|
||||
})
|
||||
{
|
||||
}
|
||||
) {
|
||||
Text(submitText)
|
||||
}
|
||||
}
|
||||
|
|
@ -59,7 +57,6 @@ fun ConfirmationDialog(
|
|||
Button(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
onClick = {
|
||||
isDisplayed.value = false
|
||||
onDismiss()
|
||||
}) {
|
||||
Text(cancelText)
|
||||
|
|
@ -73,8 +70,8 @@ fun ConfirmationDialog(
|
|||
@Preview
|
||||
fun ConfirmationDialogPreview() {
|
||||
ConfirmationDialog(
|
||||
isDisplayed = remember { mutableStateOf(true) },
|
||||
isDisplayed = true,
|
||||
title = "Title",
|
||||
content = "Content",
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
<vector android:height="24dp" android:tint="#000000"
|
||||
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="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8,9h8v10L8,19L8,9zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z"/>
|
||||
<vector android:height="24dp"
|
||||
android:tint="#000000"
|
||||
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="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2L18,7L6,7v12zM8,9h8v10L8,19L8,9zM15.5,4l-1,-1h-5l-1,1L5,4v2h14L19,4z" />
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
<vector android:height="24dp" android:tint="#000000"
|
||||
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="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
|
||||
<vector android:height="24dp"
|
||||
android:tint="#000000"
|
||||
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="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z" />
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:tint="#000000" 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="M10,9V5l-7,7 7,7v-4.1c5,0 8.5,1.6 11,5.1 -1,-5 -4,-10 -11,-11z"/>
|
||||
<vector android:autoMirrored="true"
|
||||
android:height="24dp"
|
||||
android:tint="#000000"
|
||||
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="M10,9V5l-7,7 7,7v-4.1c5,0 8.5,1.6 11,5.1 -1,-5 -4,-10 -11,-11z" />
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:tint="#000000" 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="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
|
||||
<vector android:autoMirrored="true"
|
||||
android:height="24dp"
|
||||
android:tint="#000000"
|
||||
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="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z" />
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
<vector android:height="24dp" android:tint="#000000"
|
||||
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="M16,1L4,1c-1.1,0 -2,0.9 -2,2v14h2L4,3h12L16,1zM19,5L8,5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h11c1.1,0 2,-0.9 2,-2L21,7c0,-1.1 -0.9,-2 -2,-2zM19,21L8,21L8,7h11v14z"/>
|
||||
<vector android:height="24dp"
|
||||
android:tint="#000000"
|
||||
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="M16,1L4,1c-1.1,0 -2,0.9 -2,2v14h2L4,3h12L16,1zM19,5L8,5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h11c1.1,0 2,-0.9 2,-2L21,7c0,-1.1 -0.9,-2 -2,-2zM19,21L8,21L8,7h11v14z" />
|
||||
</vector>
|
||||
|
|
|
|||
|
|
@ -8,4 +8,4 @@ android {
|
|||
|
||||
dependencies {
|
||||
implementation("com.google.android.material:material:1.7.0")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<manifest>
|
||||
|
||||
</manifest>
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/color_primary_alpha25" android:state_enabled="false" />
|
||||
<item android:color="?colorPrimary" android:state_enabled="true" />
|
||||
</selector>
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:alpha="0.25" android:color="?colorPrimary" />
|
||||
|
||||
</selector>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:bottom="10dp"
|
||||
android:left="10dp"
|
||||
android:right="10dp"
|
||||
android:top="10dp">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="?colorPrimary" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="?attr/selectableItemBackground" />
|
||||
</layer-list>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:fillColor="?vctr_content_quinary"
|
||||
android:pathData="M16,16m-16,0a16,16 0,1 1,32 0a16,16 0,1 1,-32 0" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M10.0009,16H22.0009"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="?vctr_content_secondary"
|
||||
android:strokeLineCap="round" />
|
||||
<path
|
||||
android:fillColor="#00000000"
|
||||
android:pathData="M16.0009,10V22"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="?vctr_content_secondary"
|
||||
android:strokeLineCap="round" />
|
||||
</vector>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<path
|
||||
android:pathData="M11,11m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#979797"
|
||||
android:fillType="evenOdd"/>
|
||||
<path
|
||||
android:pathData="M7.667,7.667L14.333,14.333M14.333,7.667L7.667,14.333"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#9E9E9E"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:viewportWidth="44"
|
||||
android:viewportHeight="44">
|
||||
<path
|
||||
android:pathData="M16,14.5C16,13.672 16.672,13 17.5,13H22.288C25.139,13 27.25,15.466 27.25,18.25C27.25,19.38 26.902,20.458 26.298,21.34C27.765,22.268 28.75,23.882 28.75,25.75C28.75,28.689 26.311,31 23.393,31H17.5C16.672,31 16,30.328 16,29.5V14.5ZM19,16V20.5H22.288C23.261,20.5 24.25,19.608 24.25,18.25C24.25,16.892 23.261,16 22.288,16H19ZM19,23.5V28H23.393C24.735,28 25.75,26.953 25.75,25.75C25.75,24.547 24.735,23.5 23.393,23.5H19Z"
|
||||
android:fillColor="#8D97A5"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48dp"
|
||||
android:height="48dp"
|
||||
android:viewportWidth="48"
|
||||
android:viewportHeight="48">
|
||||
<path
|
||||
android:pathData="M17.125,31.5C16.944,31.5 16.795,31.441 16.677,31.323C16.559,31.205 16.5,31.056 16.5,30.875V25.875C16.5,25.694 16.559,25.545 16.677,25.427C16.795,25.309 16.944,25.25 17.125,25.25C17.306,25.25 17.455,25.309 17.573,25.427C17.691,25.545 17.75,25.694 17.75,25.875V29.375L29.375,17.75H25.875C25.694,17.75 25.545,17.691 25.427,17.573C25.309,17.455 25.25,17.306 25.25,17.125C25.25,16.944 25.309,16.795 25.427,16.677C25.545,16.559 25.694,16.5 25.875,16.5H30.875C31.056,16.5 31.205,16.559 31.323,16.677C31.441,16.795 31.5,16.944 31.5,17.125V22.125C31.5,22.306 31.441,22.455 31.323,22.573C31.205,22.691 31.056,22.75 30.875,22.75C30.694,22.75 30.545,22.691 30.427,22.573C30.309,22.455 30.25,22.306 30.25,22.125V18.625L18.625,30.25H22.125C22.306,30.25 22.455,30.309 22.573,30.427C22.691,30.545 22.75,30.694 22.75,30.875C22.75,31.056 22.691,31.205 22.573,31.323C22.455,31.441 22.306,31.5 22.125,31.5H17.125Z"
|
||||
android:fillColor="#C1C6CD"/>
|
||||
</vector>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:viewportWidth="44"
|
||||
android:viewportHeight="44">
|
||||
<path
|
||||
android:pathData="M22.619,14.999L19.747,29.005H17.2C16.758,29.005 16.4,29.363 16.4,29.805C16.4,30.247 16.758,30.605 17.2,30.605H20.389C20.397,30.605 20.405,30.605 20.412,30.605H23.6C24.042,30.605 24.4,30.247 24.4,29.805C24.4,29.363 24.042,29.005 23.6,29.005H21.381L24.253,14.999H26.8C27.242,14.999 27.6,14.64 27.6,14.199C27.6,13.757 27.242,13.399 26.8,13.399H23.615C23.604,13.398 23.594,13.398 23.583,13.399H20.4C19.958,13.399 19.6,13.757 19.6,14.199C19.6,14.64 19.958,14.999 20.4,14.999H22.619Z"
|
||||
android:fillColor="#8D97A5"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:viewportWidth="44"
|
||||
android:viewportHeight="44">
|
||||
<path
|
||||
android:pathData="M24.897,17.154C24.235,15.821 22.876,15.21 21.374,15.372C19.05,15.622 18.44,17.423 18.722,18.592C19.032,19.872 20.046,20.37 21.839,20.826H29.92C30.517,20.826 31,21.351 31,22C31,22.648 30.517,23.174 29.92,23.174H14.08C13.483,23.174 13,22.648 13,22C13,21.351 13.483,20.826 14.08,20.826H17.355C17.041,20.377 16.791,19.839 16.633,19.189C16.003,16.581 17.554,13.424 21.16,13.036C23.285,12.807 25.615,13.661 26.798,16.038C27.081,16.608 26.886,17.32 26.361,17.629C25.836,17.937 25.181,17.725 24.897,17.154Z"
|
||||
android:fillColor="#8D97A5"/>
|
||||
<path
|
||||
android:pathData="M25.427,25.13H27.67C27.888,26.306 27.721,27.56 27.05,28.632C26.114,30.125 24.37,31 21.985,31C18.076,31 16.279,28.584 15.912,26.986C15.768,26.357 16.12,25.72 16.698,25.563C17.277,25.406 17.863,25.788 18.008,26.417C18.119,26.902 19.002,28.652 21.985,28.652C23.907,28.652 24.854,27.965 25.264,27.31C25.642,26.707 25.708,25.909 25.427,25.13Z"
|
||||
android:fillColor="#8D97A5"/>
|
||||
</vector>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:viewportWidth="44"
|
||||
android:viewportHeight="44">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M10,10h24v24h-24z"/>
|
||||
<path
|
||||
android:pathData="M22.79,26.95C25.82,26.56 28,23.84 28,20.79V14.25C28,13.56 27.44,13 26.75,13C26.06,13 25.5,13.56 25.5,14.25V20.9C25.5,22.57 24.37,24.09 22.73,24.42C20.48,24.89 18.5,23.17 18.5,21V14.25C18.5,13.56 17.94,13 17.25,13C16.56,13 16,13.56 16,14.25V21C16,24.57 19.13,27.42 22.79,26.95ZM15,30C15,30.55 15.45,31 16,31H28C28.55,31 29,30.55 29,30C29,29.45 28.55,29 28,29H16C15.45,29 15,29.45 15,30Z"
|
||||
android:fillColor="#8D97A5"/>
|
||||
</group>
|
||||
</vector>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:pathData="M4,18.6666L20,18.6666"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#000000"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="M6.6667,14L16.0001,4.6666"
|
||||
android:strokeLineJoin="round"
|
||||
android:strokeWidth="2"
|
||||
android:fillColor="#00000000"
|
||||
android:strokeColor="#000000"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
<vector android:autoMirrored="true" android:height="20dp"
|
||||
android:viewportHeight="20" android:viewportWidth="20"
|
||||
android:width="20dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#ffffff" android:pathData="M18.7922,11.1454L2.3564,19.3594C1.2489,19.9131 0.0966,18.7254 0.6379,17.6419C0.6379,17.6419 2.675,13.5282 3.2353,12.4507C3.7956,11.3731 4.437,11.1866 10.3935,10.4168C10.6139,10.3883 10.7943,10.2219 10.7943,9.9998C10.7943,9.778 10.6139,9.6117 10.3935,9.5832C4.437,8.8133 3.7956,8.6268 3.2353,7.5493C2.675,6.4721 0.6379,2.358 0.6379,2.358C0.0966,1.2749 1.2489,0.0869 2.3564,0.6405L18.7922,8.8549C19.7359,9.3262 19.7359,10.6738 18.7922,11.1454Z"/>
|
||||
</vector>
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
The transitions which us used for the entrance and exit of shared elements. Here we declare
|
||||
two different transitions which are targeting specific views.
|
||||
-->
|
||||
<transitionSet xmlns:android="http://schemas.android.com/apk/res/android" android:duration="200">
|
||||
|
||||
<!-- changeBounds is used for the TextViews which are shared -->
|
||||
<changeBounds/>
|
||||
|
||||
<!-- changeImageTransform is used for the ImageViews which are shared -->
|
||||
<changeImageTransform />
|
||||
|
||||
</transitionSet>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- room message colors -->
|
||||
<attr name="vctr_unsent_message_text_color" format="color" />
|
||||
<attr name="vctr_message_text_color" format="color" />
|
||||
<attr name="vctr_notice_text_color" format="color" />
|
||||
<attr name="vctr_notice_secondary" format="color" />
|
||||
<attr name="vctr_encrypting_message_text_color" format="color" />
|
||||
<attr name="vctr_sending_message_text_color" format="color" />
|
||||
<attr name="vctr_markdown_block_background_color" format="color" />
|
||||
<attr name="vctr_spoiler_background_color" format="color" />
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Timeline bubble background colors -->
|
||||
<attr name="vctr_message_bubble_inbound" format="color" />
|
||||
<color name="vctr_message_bubble_inbound_light">#E8EDF4</color>
|
||||
<color name="vctr_message_bubble_inbound_dark">#21262C</color>
|
||||
<attr name="vctr_message_bubble_outbound" format="color" />
|
||||
<color name="vctr_message_bubble_outbound_light">#E7F8F3</color>
|
||||
<color name="vctr_message_bubble_outbound_dark">#133A34</color>
|
||||
</resources>
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Widget.Vector.ActionButton" parent="Widget.AppCompat.ActionButton">
|
||||
<item name="android:paddingStart">5dp</item>
|
||||
<item name="android:paddingEnd">5dp</item>
|
||||
<item name="android:minWidth">0dp</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Vector.SnackBar" parent="@style/Widget.MaterialComponents.Snackbar">
|
||||
<!-- <item name="android:background">@color/notification_accent_color</item>-->
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.SnackBar.Button" parent="@style/Widget.Vector.Button.Text.OnPrimary">
|
||||
<!-- <item name="android:textColor">@color/white</item>-->
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.SnackBar.TextView" parent="@style/Widget.MaterialComponents.Snackbar.TextView">
|
||||
<!-- <item name="android:textColor">@color/white</item>-->
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Action mode style -->
|
||||
<style name="Widget.Vector.ActionMode" parent="Widget.AppCompat.ActionMode">
|
||||
<item name="background">?android:colorBackground</item>
|
||||
<item name="titleTextStyle">@style/Widget.Vector.TextView.Title</item>
|
||||
<item name="subtitleTextStyle">@style/Widget.Vector.TextView.Subtitle</item>
|
||||
<item name="actionMenuTextColor">?colorOnPrimary</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="ThemeOverlay.Vector.MaterialAlertDialog" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog">
|
||||
<item name="materialAlertDialogTitleTextStyle">@style/MaterialAlertDialog.Vector.Title.Text</item>
|
||||
<item name="materialAlertDialogBodyTextStyle">@style/MaterialAlertDialog.Vector.Body.Text</item>
|
||||
<item name="buttonBarPositiveButtonStyle">@style/Widget.Vector.Button.TextButton.Dialog</item>
|
||||
<item name="buttonBarNegativeButtonStyle">@style/Widget.Vector.Button.TextButton.Dialog</item>
|
||||
<item name="buttonBarNeutralButtonStyle">@style/Widget.Vector.Button.TextButton.Dialog</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.Vector.MaterialAlertDialog.Destructive">
|
||||
<item name="buttonBarPositiveButtonStyle">@style/Widget.Vector.Button.TextButton.Dialog.Destructive</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.Vector.MaterialAlertDialog.NegativeDestructive">
|
||||
<item name="buttonBarNegativeButtonStyle">@style/Widget.Vector.Button.TextButton.Dialog.Destructive</item>
|
||||
</style>
|
||||
|
||||
<!-- Title -->
|
||||
<style name="MaterialAlertDialog.Vector.Title.Text" parent="MaterialAlertDialog.MaterialComponents.Title.Text">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Subtitle</item>
|
||||
</style>
|
||||
|
||||
<!-- Body -->
|
||||
<style name="MaterialAlertDialog.Vector.Body.Text" parent="MaterialAlertDialog.MaterialComponents.Body.Text">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Body</item>
|
||||
<item name="lineHeight">20sp</item>
|
||||
</style>
|
||||
|
||||
<!-- Buttons -->
|
||||
<style name="Widget.Vector.Button.TextButton.Dialog" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Button</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.TextButton.Dialog.Destructive">
|
||||
<item name="materialThemeOverlay">@style/VectorMaterialThemeOverlayDestructive</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Vector.AppBarLayout" parent="Widget.MaterialComponents.AppBarLayout.Primary">
|
||||
<item name="android:background">?vctr_toolbar_background</item>
|
||||
<item name="elevation">4dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,62 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- BottomSheet theming -->
|
||||
<style name="Theme.Vector.BottomSheetDialog.Light" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
|
||||
<item name="colorPrimary">@color/element_accent_light</item>
|
||||
<item name="colorOnPrimary">@color/palette_white</item>
|
||||
<item name="colorSecondary">@color/palette_element_green</item>
|
||||
<item name="colorOnSecondary">@color/palette_white</item>
|
||||
<item name="colorSurface">@color/element_background_light</item>
|
||||
<item name="colorOnSurface">@color/element_content_primary_light</item>
|
||||
<item name="colorError">@color/element_alert_light</item>
|
||||
<item name="colorOnError">@color/palette_white</item>
|
||||
<!-- Default color for text View -->
|
||||
<item name="android:textColorTertiary">@color/element_content_primary_light</item>
|
||||
<item name="android:textColorLink">@color/element_link_light</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Vector.BottomSheetDialog.Dark" parent="Theme.MaterialComponents.BottomSheetDialog">
|
||||
<item name="colorPrimary">@color/element_accent_dark</item>
|
||||
<item name="colorOnPrimary">@color/palette_white</item>
|
||||
<item name="colorSecondary">@color/palette_element_green</item>
|
||||
<item name="colorOnSecondary">@color/palette_white</item>
|
||||
<item name="colorSurface">@color/element_background_dark</item>
|
||||
<item name="colorOnSurface">@color/element_content_primary_dark</item>
|
||||
<item name="colorError">@color/element_alert_dark</item>
|
||||
<item name="colorOnError">@color/palette_white</item>
|
||||
<!-- Default color for text View -->
|
||||
<item name="android:textColorTertiary">@color/element_content_primary_dark</item>
|
||||
<item name="android:textColorLink">@color/element_link_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Vector.BottomSheetDialog.Black" parent="Theme.Vector.BottomSheetDialog.Dark">
|
||||
<item name="colorSurface">@color/element_background_black</item>
|
||||
</style>
|
||||
|
||||
<!-- BottomSheet style -->
|
||||
<style name="BottomSheetItemTextMain">
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:lines">1</item>
|
||||
<item name="android:textColor">?vctr_content_primary</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
</style>
|
||||
|
||||
<style name="BottomSheetItemTextSecondary">
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:layout_width">0dp</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:maxLines">2</item>
|
||||
<item name="android:textColor">?vctr_content_secondary</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
|
||||
<style name="BottomSheetItemTime">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
|
|
|
|||
|
|
@ -1,76 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Vector.Button" parent="Widget.MaterialComponents.Button">
|
||||
<item name="android:paddingLeft">16dp</item>
|
||||
<item name="android:paddingRight">16dp</item>
|
||||
<item name="android:minWidth">94dp</item>
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Button</item>
|
||||
<item name="cornerRadius">8dp</item>
|
||||
<item name="lineHeight">24sp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.CallToAction" parent="Widget.Vector.Button">
|
||||
<item name="android:backgroundTint">@color/button_background_tint_selector</item>
|
||||
<item name="android:textColor">@android:color/white</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Destructive">
|
||||
<item name="android:minWidth">94dp</item>
|
||||
<item name="materialThemeOverlay">@style/VectorMaterialThemeOverlayDestructive</item>
|
||||
</style>
|
||||
|
||||
<style name="VectorMaterialThemeOverlayDestructive">
|
||||
<item name="colorPrimary">?colorError</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Positive">
|
||||
<item name="android:minWidth">94dp</item>
|
||||
<item name="materialThemeOverlay">@style/VectorMaterialThemeOverlayPositive</item>
|
||||
</style>
|
||||
|
||||
<style name="VectorMaterialThemeOverlayPositive">
|
||||
<!-- Keep default colors from the theme -->
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Text" parent="Widget.MaterialComponents.Button.TextButton">
|
||||
<item name="colorControlHighlight">?colorSecondary</item>
|
||||
<item name="materialThemeOverlay">@style/VectorMaterialThemeOverlayPositive</item>
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Button</item>
|
||||
<item name="cornerRadius">8dp</item>
|
||||
<item name="lineHeight">24sp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Text.Destructive">
|
||||
<item name="materialThemeOverlay">@style/VectorMaterialThemeOverlayDestructive</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Text.OnPrimary">
|
||||
<item name="colorControlHighlight">?colorOnPrimary</item>
|
||||
<item name="materialThemeOverlay">@style/VectorMaterialThemeOverlayOnPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Outlined" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
||||
<item name="android:textAllCaps">false</item>
|
||||
<item name="strokeColor">@color/button_background_tint_selector</item>
|
||||
<item name="strokeWidth">1dp</item>
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Button</item>
|
||||
<item name="cornerRadius">8dp</item>
|
||||
<item name="lineHeight">24sp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Text.Alerter">
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
<item name="materialThemeOverlay">@style/VectorMaterialThemeOverlayOnPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="VectorMaterialThemeOverlayOnPrimary">
|
||||
<item name="colorPrimary">?colorOnPrimary</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.FloatingActionButton" parent="Widget.MaterialComponents.FloatingActionButton">
|
||||
<item name="shapeAppearanceOverlay">@style/ShapeAppearanceOverlay.Material3.FloatingActionButton</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="TextAppearance.Vector.Subtitle.DevicesManagement">
|
||||
<item name="android:textColor">?vctr_content_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Subtitle.Medium.DevicesManagement">
|
||||
<item name="android:textColor">?vctr_content_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Body.DevicesManagement">
|
||||
<item name="android:textColor">?vctr_content_secondary</item>
|
||||
<item name="android:drawablePadding">12dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,16 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Vector.EditText.Composer" parent="Widget.AppCompat.EditText">
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:inputType">textCapSentences|textMultiLine</item>
|
||||
<item name="android:maxLines">10</item>
|
||||
<item name="android:minHeight">48dp</item>
|
||||
<item name="android:padding">8dp</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
<item name="android:textColor">?vctr_message_text_color</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.EditText.RichTextComposer" parent="Widget.AppCompat.EditText">
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:inputType">textCapSentences|textMultiLine</item>
|
||||
|
|
@ -21,7 +11,7 @@
|
|||
<item name="paddingStart">12dp</item>
|
||||
<item name="android:clipToPadding">false</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
<item name="android:textColor">?vctr_message_text_color</item>
|
||||
<item name="android:textColor">@color/element_content_primary_light</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<attr name="vctr_jump_to_unread_style" format="reference" />
|
||||
|
||||
<style name="Widget.Vector.JumpToUnread.Base" parent="Widget.MaterialComponents.Chip.Action">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Body.Medium</item>
|
||||
<item name="chipEndPadding">12dp</item>
|
||||
<item name="chipIconSize">24dp</item>
|
||||
<item name="chipMinHeight">44dp</item>
|
||||
<item name="chipStartPadding">12dp</item>
|
||||
<item name="closeIconVisible">true</item>
|
||||
<item name="android:elevation">6dp</item>
|
||||
<item name="closeIconSize">24dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.JumpToUnread.Light" parent="Widget.Vector.JumpToUnread.Base">
|
||||
<item name="chipBackgroundColor">@color/element_background_light</item>
|
||||
<item name="closeIconTint">?vctr_content_secondary</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.JumpToUnread.Dark" parent="Widget.Vector.JumpToUnread.Base">
|
||||
<item name="chipBackgroundColor">@color/element_system_dark</item>
|
||||
<item name="closeIconTint">?vctr_content_quaternary</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Vector.Button.Text.OnPrimary.LiveLocation">
|
||||
<item name="android:foreground">?selectableItemBackground</item>
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:padding">0dp</item>
|
||||
<item name="android:minWidth">0dp</item>
|
||||
<item name="android:insetRight">8dp</item>
|
||||
<item name="android:insetLeft">8dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Text.LiveLocation">
|
||||
<item name="android:foreground">?selectableItemBackground</item>
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Body.Medium</item>
|
||||
<item name="android:textColor">?colorError</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:padding">0dp</item>
|
||||
<item name="android:minWidth">0dp</item>
|
||||
<item name="android:insetRight">12dp</item>
|
||||
<item name="android:insetLeft">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Body.BottomSheetDisplayName">
|
||||
<item name="android:textSize">16sp</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Body.BottomSheetRemainingTime">
|
||||
<item name="android:textSize">12sp</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Body.BottomSheetLastUpdatedAt">
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:textColor">?vctr_content_tertiary</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Text.BottomSheetStopSharing">
|
||||
<item name="android:foreground">?selectableItemBackground</item>
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Body.Medium</item>
|
||||
<item name="android:textColor">?colorError</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:padding">0dp</item>
|
||||
<item name="android:minWidth">0dp</item>
|
||||
<item name="android:insetRight">16dp</item>
|
||||
<item name="android:insetLeft">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextView.Nano.Copyright">
|
||||
<!-- Static map view is always light in both light and dark theme. So we need to use a static dark color -->
|
||||
<item name="android:textColor">@color/element_content_primary_light</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<item name="loginLogo" type="id" />
|
||||
<item name="loginFormScrollView" type="id" />
|
||||
<item name="loginFormContainer" type="id" />
|
||||
|
||||
<style name="LoginLogo">
|
||||
<item name="android:id">@id/loginLogo</item>
|
||||
<item name="android:layout_width">60dp</item>
|
||||
<item name="android:layout_height">60dp</item>
|
||||
<item name="android:layout_gravity">center_horizontal</item>
|
||||
<item name="android:layout_marginBottom">36dp</item>
|
||||
<item name="android:src">@drawable/element_logo_green</item>
|
||||
<item name="android:transitionName">loginLogoTransition</item>
|
||||
<item name="android:importantForAccessibility">no</item>
|
||||
</style>
|
||||
|
||||
<style name="LoginFormContainer">
|
||||
<item name="android:id">@id/loginFormContainer</item>
|
||||
<item name="android:paddingTop">36dp</item>
|
||||
<item name="android:paddingStart">36dp</item>
|
||||
<item name="android:paddingEnd">36dp</item>
|
||||
<item name="android:orientation">vertical</item>
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
</style>
|
||||
|
||||
<style name="LoginFormScrollView">
|
||||
<item name="android:id">@id/loginFormScrollView</item>
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:clipToPadding">false</item>
|
||||
<item name="android:paddingTop">32dp</item>
|
||||
<item name="android:paddingBottom">32dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Login">
|
||||
<item name="android:minHeight">52dp</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Outlined.Login">
|
||||
<item name="android:minHeight">52dp</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.Button.Text.Login">
|
||||
<item name="android:minHeight">52dp</item>
|
||||
<item name="android:textAllCaps">false</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Vector.PopupMenu" parent="Widget.AppCompat.PopupMenu">
|
||||
<item name="android:textColor">?vctr_content_primary</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:dropDownHorizontalOffset">0dp</item>
|
||||
<item name="android:dropDownVerticalOffset">0dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Default style for TextInputLayout -->
|
||||
<style name="Widget.Vector.TextInputLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox" />
|
||||
|
||||
<style name="Widget.Vector.TextInputLayout.Password">
|
||||
<item name="endIconMode">password_toggle</item>
|
||||
<item name="endIconTint">?vctr_content_secondary</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextInputLayout.Username">
|
||||
<item name="endIconMode">clear_text</item>
|
||||
<item name="endIconTint">?vctr_content_secondary</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Source: https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=1336%3A17796
|
||||
-->
|
||||
|
||||
<style name="Widget.Vector.TextView" parent="Widget.MaterialComponents.TextView" />
|
||||
|
||||
<!-- Note: lineHeight attribute cannot be added in textAppearance style -->
|
||||
<style name="Widget.Vector.TextView.Title">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Title</item>
|
||||
<item name="lineHeight">32sp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextView.Title.Medium">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Title.Medium</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextView.HeadlineMedium">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Headline.Medium</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextView.Subtitle">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Subtitle</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextView.Subtitle.Medium">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Subtitle.Medium</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextView.Body">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Body</item>
|
||||
<item name="lineHeight">20sp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextView.Body.Medium">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Body.Medium</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextView.Caption">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Caption</item>
|
||||
<item name="lineHeight">16sp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextView.Micro">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Micro</item>
|
||||
<item name="lineHeight">16sp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Vector.TextView.Nano">
|
||||
<item name="android:textAppearance">@style/TextAppearance.Vector.Nano</item>
|
||||
<item name="lineHeight">16sp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="TimelineContentStubBaseParams">
|
||||
<item name="android:layout_width">match_parent</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
</style>
|
||||
|
||||
<style name="TimelineContentStubContainerParams">
|
||||
<item name="android:paddingStart">8dp</item>
|
||||
<item name="android:paddingEnd">8dp</item>
|
||||
<item name="android:paddingTop">4dp</item>
|
||||
<item name="android:paddingBottom">4dp</item>
|
||||
</style>
|
||||
|
||||
<style name="TimelineReactionView">
|
||||
<item name="android:paddingStart">6dp</item>
|
||||
<item name="android:paddingEnd">6dp</item>
|
||||
<item name="android:paddingTop">1dp</item>
|
||||
<item name="android:paddingBottom">1dp</item>
|
||||
<item name="android:minHeight">28dp</item>
|
||||
<item name="android:minWidth">40dp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
</style>
|
||||
|
||||
<style name="TimelineFixedSizeCaptionStyle" parent="@style/Widget.Vector.TextView.Caption">
|
||||
<item name="android:textSize" tools:ignore="SpUsage">12dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Vector.Toolbar.Base" parent="Widget.MaterialComponents.Toolbar">
|
||||
<item name="android:background">?vctr_toolbar_background</item>
|
||||
<item name="elevation">0dp</item>
|
||||
|
||||
<!-- main text -->
|
||||
<item name="titleTextAppearance">@style/TextAppearance.Vector.Widget.ActionBarTitle</item>
|
||||
|
||||
<!-- sub text -->
|
||||
<item name="subtitleTextAppearance">@style/TextAppearance.Vector.Widget.ActionBarSubTitle</item>
|
||||
|
||||
<item name="navigationIconTint">?vctr_content_secondary</item>
|
||||
</style>
|
||||
|
||||
<!-- Default toolbar style -->
|
||||
<style name="Widget.Vector.Toolbar" parent="Widget.Vector.Toolbar.Base">
|
||||
<item name="contentInsetStartWithNavigation">0dp</item>
|
||||
</style>
|
||||
|
||||
<!-- Toolbar for settings Activity (so we keep the default contentInsetStartWithNavigation here) -->
|
||||
<style name="Widget.Vector.Toolbar.Settings" parent="Widget.Vector.Toolbar.Base" />
|
||||
|
||||
<!-- Toolbar text style -->
|
||||
<!-- main text -->
|
||||
<style name="TextAppearance.Vector.Widget.ActionBarTitle" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
|
||||
<item name="android:textColor">?vctr_content_primary</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
<item name="fontFamily">sans-serif-medium</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
</style>
|
||||
|
||||
<!-- sub text -->
|
||||
<style name="TextAppearance.Vector.Widget.ActionBarSubTitle" parent="TextAppearance.AppCompat.Widget.ActionBar.Subtitle">
|
||||
<item name="android:textColor">?vctr_content_secondary</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="fontFamily">sans-serif</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
</style>
|
||||
|
||||
<!-- Material 3 -->
|
||||
|
||||
<style name="Widget.Vector.Material3.Toolbar" parent="Widget.Material3.Toolbar" />
|
||||
|
||||
<style name="Widget.Vector.Material3.CollapsingToolbar.Medium" parent="Widget.Material3.CollapsingToolbar.Medium">
|
||||
<item name="expandedTitleTextAppearance">@style/TextAppearance.Vector.Title.Medium</item>
|
||||
<item name="expandedTitleMarginBottom">20dp</item>
|
||||
<item name="collapsedTitleTextAppearance">@style/TextAppearance.Vector.Headline.Bold</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="VoiceBroadcastLiveIndicator" parent="Widget.AppCompat.TextView">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">20dp</item>
|
||||
<item name="android:backgroundTint">?colorError</item>
|
||||
<item name="android:drawablePadding">4dp</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="android:gravity">center_vertical</item>
|
||||
<item name="android:maxWidth">100dp</item>
|
||||
<item name="android:paddingEnd">4dp</item>
|
||||
<item name="android:paddingStart">4dp</item>
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:textColor">?colorOnError</item>
|
||||
<item name="drawableTint">?colorOnError</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!--
|
||||
Source: https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=1336%3A17796
|
||||
|
||||
Doc: https://medium.com/androiddevelopers/whats-your-text-s-appearance-f3a1729192d
|
||||
List of supported attributes for a TextAppearance:
|
||||
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/attrs.xml#4723
|
||||
|
||||
Do not use TextAppearance directly, use Widget.Vector.TextView style instead
|
||||
-->
|
||||
|
||||
<style name="TextAppearance.Vector.Title" parent="TextAppearance.MaterialComponents.Headline3">
|
||||
<item name="fontFamily">sans-serif</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:textSize">@dimen/text_size_title</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
<item name="android:textColor">?vctr_content_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Title.Medium">
|
||||
<item name="fontFamily">sans-serif-medium</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Headline.Medium" parent="TextAppearance.MaterialComponents.Headline1">
|
||||
<item name="fontFamily">sans-serif-medium</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
<item name="android:textSize">@dimen/text_size_headline</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
<item name="android:textColor">?vctr_content_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Headline.Bold" parent="TextAppearance.MaterialComponents.Headline1">
|
||||
<item name="fontFamily">sans-serif</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textSize">@dimen/text_size_headline</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
<item name="android:textColor">?vctr_content_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Subtitle" parent="TextAppearance.MaterialComponents.Subtitle1">
|
||||
<item name="fontFamily">sans-serif</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:textSize">@dimen/text_size_subtitle</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
<item name="android:textColor">?vctr_content_secondary</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Subtitle.Medium">
|
||||
<item name="fontFamily">sans-serif-medium</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
</style>
|
||||
|
||||
<!-- Note: this is the default text appearance for all the TextViews -->
|
||||
<style name="TextAppearance.Vector.Body" parent="TextAppearance.MaterialComponents.Body1">
|
||||
<item name="fontFamily">sans-serif</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:textSize">@dimen/text_size_body</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
<item name="android:textColor">?vctr_content_primary</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Body.Medium">
|
||||
<item name="fontFamily">sans-serif-medium</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Body.OnError">
|
||||
<item name="android:textColor">?colorOnError</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Caption" parent="TextAppearance.MaterialComponents.Caption">
|
||||
<item name="fontFamily">sans-serif</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:textSize">@dimen/text_size_caption</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
<item name="android:textColor">?vctr_content_secondary</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Micro" parent="TextAppearance.MaterialComponents.Caption">
|
||||
<item name="fontFamily">sans-serif</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:textSize">@dimen/text_size_micro</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Button" parent="TextAppearance.MaterialComponents.Button">
|
||||
<item name="fontFamily">sans-serif-medium</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
<item name="android:textSize">@dimen/text_size_button</item>
|
||||
<item name="android:letterSpacing">0.02</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.Vector.Nano" parent="TextAppearance.MaterialComponents.Caption">
|
||||
<item name="fontFamily">sans-serif</item>
|
||||
<item name="android:fontFamily">sans-serif</item>
|
||||
<item name="android:textSize">@dimen/text_size_nano</item>
|
||||
<item name="android:letterSpacing">0</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
@ -26,20 +26,8 @@
|
|||
<item name="vctr_waiting_background_color">@color/vctr_waiting_background_color_light</item>
|
||||
<item name="vctr_chat_effect_snow_background">@color/vctr_chat_effect_snow_background_light</item>
|
||||
<item name="vctr_toolbar_background">@color/element_background_light</item>
|
||||
<item name="vctr_message_bubble_inbound">@color/vctr_message_bubble_inbound_light</item>
|
||||
<item name="vctr_message_bubble_outbound">@color/vctr_message_bubble_outbound_light</item>
|
||||
<item name="vctr_badge_color_border">@color/vctr_badge_color_border_light</item>
|
||||
|
||||
<!-- room message colors -->
|
||||
<item name="vctr_notice_secondary">#61708B</item>
|
||||
<item name="vctr_unsent_message_text_color">?colorError</item>
|
||||
<item name="vctr_message_text_color">@color/element_content_primary_light</item>
|
||||
<item name="vctr_notice_text_color">#FF61708b</item>
|
||||
<item name="vctr_encrypting_message_text_color">@color/palette_element_green</item>
|
||||
<item name="vctr_sending_message_text_color">@color/element_content_secondary_light</item>
|
||||
<item name="vctr_markdown_block_background_color">#FFEEEEEE</item>
|
||||
<item name="vctr_spoiler_background_color">#FF000000</item>
|
||||
|
||||
<!-- Presence Indicator colors -->
|
||||
<item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_light</item>
|
||||
<item name="vctr_presence_indicator_online">@color/vctr_presence_indicator_online_light</item>
|
||||
|
|
@ -67,36 +55,7 @@
|
|||
<item name="android:colorBackground">@color/element_background_light</item>
|
||||
<item name="colorOnBackground">?vctr_content_primary</item>
|
||||
|
||||
<!--Material type attributes-->
|
||||
<item name="textAppearanceButton">@style/TextAppearance.Vector.Button</item>
|
||||
<item name="textAppearanceCaption">@style/TextAppearance.Vector.Caption</item>
|
||||
<!-- Default Text appearance for TextViews -->
|
||||
<item name="android:textAppearanceSmall">@style/TextAppearance.Vector.Body</item>
|
||||
<!-- Text appearance for List item -->
|
||||
<item name="textAppearanceListItem">@style/TextAppearance.Vector.Subtitle</item>
|
||||
<item name="textAppearanceListItemSecondary">@style/TextAppearance.Vector.Body</item>
|
||||
<item name="textAppearanceListItemSmall">@style/TextAppearance.Vector.Body</item>
|
||||
|
||||
<!-- Default styles -->
|
||||
<item name="android:textViewStyle">@style/Widget.Vector.TextView.Body</item>
|
||||
<item name="materialButtonStyle">@style/Widget.Vector.Button</item>
|
||||
<item name="toolbarStyle">@style/Widget.Vector.Toolbar</item>
|
||||
<!--
|
||||
<item name="bottomNavigationStyle">@style/BottomNavigation.Vector</item>
|
||||
<item name="searchViewStyle">@style/Widget.Vector.SearchView</item>
|
||||
-->
|
||||
<item name="textInputStyle">@style/Widget.Vector.TextInputLayout</item>
|
||||
<item name="appBarLayoutStyle">@style/Widget.Vector.AppBarLayout</item>
|
||||
<item name="popupMenuStyle">@style/Widget.Vector.PopupMenu</item>
|
||||
<item name="snackbarStyle">@style/Widget.Vector.SnackBar</item>
|
||||
<item name="snackbarButtonStyle">@style/Widget.Vector.SnackBar.Button</item>
|
||||
<item name="snackbarTextViewStyle">@style/Widget.Vector.SnackBar.TextView</item>
|
||||
<item name="actionModeStyle">@style/Widget.Vector.ActionMode</item>
|
||||
|
||||
<!-- Default theme -->
|
||||
<item name="bottomSheetDialogTheme">@style/Theme.Vector.BottomSheetDialog.Light</item>
|
||||
<item name="materialAlertDialogTheme">@style/ThemeOverlay.Vector.MaterialAlertDialog</item>
|
||||
|
||||
<item name="android:textColorLink">@color/element_link_light</item>
|
||||
|
||||
<!-- Menu text color -->
|
||||
|
|
@ -132,10 +91,6 @@
|
|||
<!-- enable window content transitions -->
|
||||
<item name="android:windowContentTransitions">true</item>
|
||||
|
||||
<!-- specify shared element enter and exit transitions -->
|
||||
<item name="android:windowSharedElementEnterTransition">@transition/image_preview_transition</item>
|
||||
<item name="android:windowSharedElementExitTransition">@transition/image_preview_transition</item>
|
||||
|
||||
<!--
|
||||
<item name="vctr_social_login_button_google_style">@style/Widget.Vector.Button.Outlined.SocialLogin.Google.Light</item>
|
||||
<item name="vctr_social_login_button_github_style">@style/Widget.Vector.Button.Outlined.SocialLogin.Github.Light</item>
|
||||
|
|
@ -145,8 +100,6 @@
|
|||
<item name="vctr_social_login_button_gitlab_style">@style/Widget.Vector.Button.Outlined.SocialLogin.Gitlab.Light</item>
|
||||
-->
|
||||
|
||||
<item name="vctr_jump_to_unread_style">@style/Widget.Vector.JumpToUnread.Light</item>
|
||||
|
||||
<!-- Keywords -->
|
||||
<!--
|
||||
<item name="vctr_keyword_style">@style/Widget.Vector.Keyword</item>
|
||||
|
|
@ -154,8 +107,6 @@
|
|||
|
||||
<item name="vctr_toast_background">@color/vctr_toast_background_light</item>
|
||||
|
||||
<item name="android:actionButtonStyle">@style/Widget.Vector.ActionButton</item>
|
||||
|
||||
<!-- Location sharing -->
|
||||
<item name="vctr_live_location">@color/vctr_live_location_light</item>
|
||||
|
||||
|
|
@ -166,4 +117,4 @@
|
|||
<item name="vctr_rich_text_editor_menu_button_background">@color/vctr_rich_text_editor_menu_button_background_light</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -16,9 +16,8 @@ dependencies {
|
|||
api(project(":libraries:rustsdk"))
|
||||
implementation(project(":libraries:di"))
|
||||
implementation(project(":libraries:core"))
|
||||
implementation(libs.timber)
|
||||
implementation("net.java.dev.jna:jna:5.12.1@aar")
|
||||
implementation(libs.coil.compose)
|
||||
implementation(libs.androidx.datastore.preferences)
|
||||
implementation(libs.serialization.json)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import io.element.android.x.matrix.util.logError
|
|||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.asCoroutineDispatcher
|
||||
import kotlinx.coroutines.flow.*
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.matrix.rustcomponents.sdk.AuthenticationService
|
||||
import org.matrix.rustcomponents.sdk.Client
|
||||
|
|
@ -101,4 +101,4 @@ class Matrix @Inject constructor(
|
|||
baseDirectory = baseDirectory,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,19 @@ import io.element.android.x.matrix.room.RoomSummaryDataSource
|
|||
import io.element.android.x.matrix.room.RustRoomSummaryDataSource
|
||||
import io.element.android.x.matrix.session.SessionStore
|
||||
import io.element.android.x.matrix.sync.SlidingSyncObserverProxy
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.matrix.rustcomponents.sdk.*
|
||||
import timber.log.Timber
|
||||
import java.io.Closeable
|
||||
import java.io.File
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.matrix.rustcomponents.sdk.Client
|
||||
import org.matrix.rustcomponents.sdk.ClientDelegate
|
||||
import org.matrix.rustcomponents.sdk.MediaSource
|
||||
import org.matrix.rustcomponents.sdk.RequiredState
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncMode
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncViewBuilder
|
||||
import org.matrix.rustcomponents.sdk.StoppableSpawn
|
||||
import timber.log.Timber
|
||||
|
||||
class MatrixClient internal constructor(
|
||||
private val client: Client,
|
||||
|
|
@ -60,7 +66,7 @@ class MatrixClient internal constructor(
|
|||
.slidingSync()
|
||||
.homeserver("https://slidingsync.lab.element.dev")
|
||||
.withCommonExtensions()
|
||||
//.coldCache("ElementX")
|
||||
// .coldCache("ElementX")
|
||||
.addView(slidingSyncView)
|
||||
.build()
|
||||
|
||||
|
|
@ -148,6 +154,7 @@ class MatrixClient internal constructor(
|
|||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalUnsignedTypes::class)
|
||||
suspend fun loadMediaContentForSource(source: MediaSource): Result<ByteArray> =
|
||||
withContext(dispatchers.io) {
|
||||
runCatching {
|
||||
|
|
@ -155,6 +162,7 @@ class MatrixClient internal constructor(
|
|||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalUnsignedTypes::class)
|
||||
suspend fun loadMediaThumbnailForSource(
|
||||
source: MediaSource,
|
||||
width: Long,
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
package io.element.android.x.matrix
|
||||
|
||||
import android.util.Log
|
||||
import org.matrix.rustcomponents.sdk.Client
|
||||
import org.matrix.rustcomponents.sdk.Room
|
||||
|
||||
class RoomWrapper(
|
||||
private val client: Client
|
||||
) {
|
||||
fun getRoom(roomId: String): Room? {
|
||||
val rooms = client.rooms()
|
||||
Log.d(LOG_TAG, "We have ${rooms.size} rooms")
|
||||
return rooms.firstOrNull { it.id() == roomId }
|
||||
}
|
||||
}
|
||||
|
|
@ -3,4 +3,4 @@ package io.element.android.x.matrix.core
|
|||
import java.io.Serializable
|
||||
|
||||
@JvmInline
|
||||
value class EventId(val value: String) : Serializable
|
||||
value class EventId(val value: String) : Serializable
|
||||
|
|
|
|||
|
|
@ -80,15 +80,15 @@ object MatrixPatterns {
|
|||
|
||||
// list of patterns to find some matrix item.
|
||||
val MATRIX_PATTERNS = listOf(
|
||||
PATTERN_CONTAIN_MATRIX_TO_PERMALINK_ROOM_ID,
|
||||
PATTERN_CONTAIN_MATRIX_TO_PERMALINK_ROOM_ALIAS,
|
||||
PATTERN_CONTAIN_APP_LINK_PERMALINK_ROOM_ID,
|
||||
PATTERN_CONTAIN_APP_LINK_PERMALINK_ROOM_ALIAS,
|
||||
PATTERN_CONTAIN_MATRIX_USER_IDENTIFIER,
|
||||
PATTERN_CONTAIN_MATRIX_ALIAS,
|
||||
PATTERN_CONTAIN_MATRIX_ROOM_IDENTIFIER,
|
||||
PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER,
|
||||
PATTERN_CONTAIN_MATRIX_GROUP_IDENTIFIER
|
||||
PATTERN_CONTAIN_MATRIX_TO_PERMALINK_ROOM_ID,
|
||||
PATTERN_CONTAIN_MATRIX_TO_PERMALINK_ROOM_ALIAS,
|
||||
PATTERN_CONTAIN_APP_LINK_PERMALINK_ROOM_ID,
|
||||
PATTERN_CONTAIN_APP_LINK_PERMALINK_ROOM_ALIAS,
|
||||
PATTERN_CONTAIN_MATRIX_USER_IDENTIFIER,
|
||||
PATTERN_CONTAIN_MATRIX_ALIAS,
|
||||
PATTERN_CONTAIN_MATRIX_ROOM_IDENTIFIER,
|
||||
PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER,
|
||||
PATTERN_CONTAIN_MATRIX_GROUP_IDENTIFIER
|
||||
)
|
||||
|
||||
/**
|
||||
|
|
@ -129,9 +129,9 @@ object MatrixPatterns {
|
|||
*/
|
||||
fun isEventId(str: String?): Boolean {
|
||||
return str != null &&
|
||||
(str matches PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER ||
|
||||
str matches PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V3 ||
|
||||
str matches PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V4)
|
||||
(str matches PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER ||
|
||||
str matches PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V3 ||
|
||||
str matches PATTERN_CONTAIN_MATRIX_EVENT_IDENTIFIER_V4)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,4 +3,4 @@ package io.element.android.x.matrix.core
|
|||
import java.io.Serializable
|
||||
|
||||
@JvmInline
|
||||
value class RoomId(val value: String): Serializable
|
||||
value class RoomId(val value: String) : Serializable
|
||||
|
|
|
|||
|
|
@ -3,4 +3,4 @@ package io.element.android.x.matrix.core
|
|||
import java.io.Serializable
|
||||
|
||||
@JvmInline
|
||||
value class UserId(val value: String): Serializable
|
||||
value class UserId(val value: String) : Serializable
|
||||
|
|
|
|||
|
|
@ -36,4 +36,4 @@ internal class MediaFetcher(
|
|||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ internal class MediaKeyer : Keyer<MediaResolver.Meta> {
|
|||
override fun key(data: MediaResolver.Meta, options: Options): String? {
|
||||
return "${data.source.url()}_${data.kind}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ interface MediaResolver {
|
|||
suspend fun resolve(meta: Meta): ByteArray?
|
||||
}
|
||||
|
||||
|
||||
internal class RustMediaResolver(private val client: MatrixClient) : MediaResolver {
|
||||
|
||||
override suspend fun resolve(url: String?, kind: MediaResolver.Kind): ByteArray? {
|
||||
|
|
@ -43,6 +42,4 @@ internal class RustMediaResolver(private val client: MatrixClient) : MediaResolv
|
|||
)
|
||||
}.getOrNull()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ package io.element.android.x.matrix.permalink
|
|||
import android.net.Uri
|
||||
import android.net.UrlQuerySanitizer
|
||||
import io.element.android.x.matrix.core.MatrixPatterns
|
||||
import timber.log.Timber
|
||||
import java.net.URLDecoder
|
||||
import timber.log.Timber
|
||||
|
||||
/**
|
||||
* This class turns a uri to a [PermalinkData].
|
||||
|
|
@ -43,12 +43,12 @@ object PermalinkParser {
|
|||
|
||||
// we are limiting to 2 params
|
||||
val params = safeFragment
|
||||
.split(MatrixPatterns.SEP_REGEX)
|
||||
.filter { it.isNotEmpty() }
|
||||
.take(2)
|
||||
.split(MatrixPatterns.SEP_REGEX)
|
||||
.filter { it.isNotEmpty() }
|
||||
.take(2)
|
||||
|
||||
val decodedParams = params
|
||||
.map { URLDecoder.decode(it, "UTF-8") }
|
||||
.map { URLDecoder.decode(it, "UTF-8") }
|
||||
|
||||
val identifier = params.getOrNull(0)
|
||||
val decodedIdentifier = decodedParams.getOrNull(0)
|
||||
|
|
@ -61,10 +61,10 @@ object PermalinkParser {
|
|||
}
|
||||
MatrixPatterns.isRoomAlias(decodedIdentifier) -> {
|
||||
PermalinkData.RoomLink(
|
||||
roomIdOrAlias = decodedIdentifier,
|
||||
isRoomAlias = true,
|
||||
eventId = extraParameter.takeIf { !it.isNullOrEmpty() && MatrixPatterns.isEventId(it) },
|
||||
viaParameters = viaQueryParameters
|
||||
roomIdOrAlias = decodedIdentifier,
|
||||
isRoomAlias = true,
|
||||
eventId = extraParameter.takeIf { !it.isNullOrEmpty() && MatrixPatterns.isEventId(it) },
|
||||
viaParameters = viaQueryParameters
|
||||
)
|
||||
}
|
||||
else -> PermalinkData.FallbackLink(uri, MatrixPatterns.isGroupId(identifier))
|
||||
|
|
@ -83,16 +83,16 @@ object PermalinkParser {
|
|||
val token = signValidUri.getQueryParameter("token") ?: throw IllegalArgumentException()
|
||||
val privateKey = signValidUri.getQueryParameter("private_key") ?: throw IllegalArgumentException()
|
||||
PermalinkData.RoomEmailInviteLink(
|
||||
roomId = identifier,
|
||||
email = email!!,
|
||||
signUrl = signUrl!!,
|
||||
roomName = paramList.firstOrNull { it.first == "room_name" }?.second,
|
||||
inviterName = paramList.firstOrNull { it.first == "inviter_name" }?.second,
|
||||
roomAvatarUrl = paramList.firstOrNull { it.first == "room_avatar_url" }?.second,
|
||||
roomType = paramList.firstOrNull { it.first == "room_type" }?.second,
|
||||
identityServer = identityServerHost,
|
||||
token = token,
|
||||
privateKey = privateKey
|
||||
roomId = identifier,
|
||||
email = email!!,
|
||||
signUrl = signUrl!!,
|
||||
roomName = paramList.firstOrNull { it.first == "room_name" }?.second,
|
||||
inviterName = paramList.firstOrNull { it.first == "inviter_name" }?.second,
|
||||
roomAvatarUrl = paramList.firstOrNull { it.first == "room_avatar_url" }?.second,
|
||||
roomType = paramList.firstOrNull { it.first == "room_type" }?.second,
|
||||
identityServer = identityServerHost,
|
||||
token = token,
|
||||
privateKey = privateKey
|
||||
)
|
||||
} catch (failure: Throwable) {
|
||||
Timber.i("## Permalink: Failed to parse permalink $signUrl")
|
||||
|
|
@ -100,29 +100,29 @@ object PermalinkParser {
|
|||
}
|
||||
} else {
|
||||
PermalinkData.RoomLink(
|
||||
roomIdOrAlias = identifier,
|
||||
isRoomAlias = false,
|
||||
eventId = extraParameter.takeIf { !it.isNullOrEmpty() && MatrixPatterns.isEventId(it) },
|
||||
viaParameters = viaQueryParameters
|
||||
roomIdOrAlias = identifier,
|
||||
isRoomAlias = false,
|
||||
eventId = extraParameter.takeIf { !it.isNullOrEmpty() && MatrixPatterns.isEventId(it) },
|
||||
viaParameters = viaQueryParameters
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun safeExtractParams(fragment: String) =
|
||||
fragment.substringAfter("?").split('&').mapNotNull {
|
||||
val splitNameValue = it.split("=")
|
||||
if (splitNameValue.size == 2) {
|
||||
Pair(splitNameValue[0], URLDecoder.decode(splitNameValue[1], "UTF-8"))
|
||||
} else null
|
||||
}
|
||||
fragment.substringAfter("?").split('&').mapNotNull {
|
||||
val splitNameValue = it.split("=")
|
||||
if (splitNameValue.size == 2) {
|
||||
Pair(splitNameValue[0], URLDecoder.decode(splitNameValue[1], "UTF-8"))
|
||||
} else null
|
||||
}
|
||||
|
||||
private fun String.getViaParameters(): List<String> {
|
||||
return UrlQuerySanitizer(this)
|
||||
.parameterList
|
||||
.filter {
|
||||
it.mParameter == "via"
|
||||
}.map {
|
||||
URLDecoder.decode(it.mValue, "UTF-8")
|
||||
}
|
||||
.parameterList
|
||||
.filter {
|
||||
it.mParameter == "via"
|
||||
}.map {
|
||||
URLDecoder.decode(it.mValue, "UTF-8")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,11 @@ import kotlinx.coroutines.flow.filter
|
|||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.coroutines.flow.onStart
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.matrix.rustcomponents.sdk.*
|
||||
import org.matrix.rustcomponents.sdk.Room
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncRoom
|
||||
import org.matrix.rustcomponents.sdk.UpdateSummary
|
||||
import org.matrix.rustcomponents.sdk.genTransactionId
|
||||
import org.matrix.rustcomponents.sdk.messageEventContentFromMarkdown
|
||||
|
||||
class MatrixRoom(
|
||||
private val slidingSyncUpdateFlow: Flow<UpdateSummary>,
|
||||
|
|
@ -84,7 +88,7 @@ class MatrixRoom(
|
|||
|
||||
suspend fun editMessage(originalEventId: String, message: String): Result<Unit> = withContext(coroutineDispatchers.io) {
|
||||
val transactionId = genTransactionId()
|
||||
val content = messageEventContentFromMarkdown(message)
|
||||
// val content = messageEventContentFromMarkdown(message)
|
||||
runCatching {
|
||||
room.edit(/* TODO use content */ message, originalEventId, transactionId)
|
||||
}
|
||||
|
|
@ -92,16 +96,16 @@ class MatrixRoom(
|
|||
|
||||
suspend fun replyMessage(eventId: String, message: String): Result<Unit> = withContext(coroutineDispatchers.io) {
|
||||
val transactionId = genTransactionId()
|
||||
val content = messageEventContentFromMarkdown(message)
|
||||
// val content = messageEventContentFromMarkdown(message)
|
||||
runCatching {
|
||||
room.sendReply(/* TODO use content */ message, eventId, transactionId)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun redactEvent(eventId: String, reason: String? = null, ) = withContext(coroutineDispatchers.io) {
|
||||
suspend fun redactEvent(eventId: String, reason: String? = null) = withContext(coroutineDispatchers.io) {
|
||||
val transactionId = genTransactionId()
|
||||
runCatching {
|
||||
room.redact(eventId, reason, transactionId)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import org.matrix.rustcomponents.sdk.Room
|
|||
import org.matrix.rustcomponents.sdk.TimelineDiff
|
||||
import org.matrix.rustcomponents.sdk.TimelineListener
|
||||
|
||||
|
||||
fun Room.timelineDiff(scope: CoroutineScope): Flow<TimelineDiff> = callbackFlow {
|
||||
val listener = object : TimelineListener {
|
||||
override fun onUpdate(update: TimelineDiff) {
|
||||
|
|
@ -22,6 +21,4 @@ fun Room.timelineDiff(scope: CoroutineScope): Flow<TimelineDiff> = callbackFlow
|
|||
awaitClose {
|
||||
removeTimeline()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package io.element.android.x.matrix.room
|
|||
|
||||
import io.element.android.x.matrix.core.RoomId
|
||||
|
||||
|
||||
sealed interface RoomSummary {
|
||||
data class Empty(val identifier: String) : RoomSummary
|
||||
data class Filled(val details: RoomSummaryDetails) : RoomSummary
|
||||
|
|
@ -13,7 +12,6 @@ sealed interface RoomSummary {
|
|||
is Filled -> details.roomId.value
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
data class RoomSummaryDetails(
|
||||
|
|
|
|||
|
|
@ -3,12 +3,28 @@ package io.element.android.x.matrix.room
|
|||
import io.element.android.x.core.coroutine.CoroutineDispatchers
|
||||
import io.element.android.x.matrix.sync.roomListDiff
|
||||
import io.element.android.x.matrix.sync.state
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.flow.*
|
||||
import org.matrix.rustcomponents.sdk.*
|
||||
import timber.log.Timber
|
||||
import java.io.Closeable
|
||||
import java.util.*
|
||||
import java.util.Collections
|
||||
import java.util.UUID
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.FlowPreview
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.cancelChildren
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.flow.sample
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.matrix.rustcomponents.sdk.RoomListEntry
|
||||
import org.matrix.rustcomponents.sdk.SlidingSync
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncState
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncView
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncViewRoomsListDiff
|
||||
import org.matrix.rustcomponents.sdk.UpdateSummary
|
||||
import timber.log.Timber
|
||||
|
||||
interface RoomSummaryDataSource {
|
||||
fun roomSummaries(): Flow<List<RoomSummary>>
|
||||
|
|
@ -56,7 +72,6 @@ internal class RustRoomSummaryDataSource(
|
|||
Timber.v("New sliding sync state: $slidingSyncState")
|
||||
state.value = slidingSyncState
|
||||
}.launchIn(coroutineScope)
|
||||
|
||||
}
|
||||
|
||||
fun stopSync() {
|
||||
|
|
@ -67,6 +82,7 @@ internal class RustRoomSummaryDataSource(
|
|||
coroutineScope.cancel()
|
||||
}
|
||||
|
||||
@OptIn(FlowPreview::class)
|
||||
override fun roomSummaries(): Flow<List<RoomSummary>> {
|
||||
return roomSummaries.sample(50)
|
||||
}
|
||||
|
|
@ -95,7 +111,6 @@ internal class RustRoomSummaryDataSource(
|
|||
}
|
||||
|
||||
private fun MutableList<RoomSummary>.applyDiff(diff: SlidingSyncViewRoomsListDiff) {
|
||||
|
||||
fun MutableList<RoomSummary>.fillUntil(untilIndex: Int) {
|
||||
repeat((size - 1 until untilIndex).count()) {
|
||||
add(buildEmptyRoomSummary())
|
||||
|
|
@ -163,4 +178,4 @@ internal class RustRoomSummaryDataSource(
|
|||
else -> false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import org.matrix.rustcomponents.sdk.SlidingSyncRoom
|
|||
|
||||
class RoomSummaryDetailsFactory(private val roomMessageFactory: RoomMessageFactory = RoomMessageFactory()) {
|
||||
|
||||
fun create(slidingSyncRoom: SlidingSyncRoom, room: Room?): RoomSummaryDetails{
|
||||
fun create(slidingSyncRoom: SlidingSyncRoom, room: Room?): RoomSummaryDetails {
|
||||
val latestRoomMessage = slidingSyncRoom.latestRoomMessage()?.let {
|
||||
roomMessageFactory.create(it)
|
||||
}
|
||||
|
|
@ -17,14 +17,13 @@ class RoomSummaryDetailsFactory(private val roomMessageFactory: RoomMessageFacto
|
|||
else -> "${latestRoomMessage.sender.value}: ${latestRoomMessage.body}"
|
||||
}
|
||||
return RoomSummaryDetails(
|
||||
roomId = RoomId(slidingSyncRoom.roomId()),
|
||||
name = slidingSyncRoom.name() ?: slidingSyncRoom.roomId(),
|
||||
isDirect = slidingSyncRoom.isDm() ?: false,
|
||||
avatarURLString = room?.avatarUrl(),
|
||||
unreadNotificationCount = slidingSyncRoom.unreadNotifications().notificationCount().toInt(),
|
||||
lastMessage = computedLastMessage,
|
||||
lastMessageTimestamp = latestRoomMessage?.originServerTs
|
||||
roomId = RoomId(slidingSyncRoom.roomId()),
|
||||
name = slidingSyncRoom.name() ?: slidingSyncRoom.roomId(),
|
||||
isDirect = slidingSyncRoom.isDm() ?: false,
|
||||
avatarURLString = room?.avatarUrl(),
|
||||
unreadNotificationCount = slidingSyncRoom.unreadNotifications().notificationCount().toInt(),
|
||||
lastMessage = computedLastMessage,
|
||||
lastMessageTimestamp = latestRoomMessage?.originServerTs
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,5 +14,4 @@ class RoomMessageFactory {
|
|||
originServerTs = eventTimelineItem.originServerTs()?.toLong() ?: 0L
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@ import kotlinx.coroutines.flow.Flow
|
|||
import kotlinx.coroutines.flow.firstOrNull
|
||||
import kotlinx.coroutines.flow.map
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.decodeFromString
|
||||
import kotlinx.serialization.encodeToString
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.matrix.rustcomponents.sdk.Session
|
||||
|
||||
|
|
@ -73,4 +74,4 @@ internal class SessionStore(
|
|||
suspend fun reset() {
|
||||
store.edit { it.clear() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import org.matrix.rustcomponents.sdk.UpdateSummary
|
|||
|
||||
// Sounds like a reasonable buffer size before it suspends emitting new items.
|
||||
private const val BUFFER_SIZE = 64
|
||||
|
||||
class SlidingSyncObserverProxy(
|
||||
private val coroutineScope: CoroutineScope,
|
||||
private val coroutineDispatchers: CoroutineDispatchers
|
||||
|
|
@ -26,5 +27,4 @@ class SlidingSyncObserverProxy(
|
|||
updateSummaryMutableFlow.emit(summary)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,15 @@
|
|||
package io.element.android.x.matrix.sync
|
||||
|
||||
import io.element.android.x.matrix.util.mxCallbackFlow
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.launch
|
||||
import mxCallbackFlow
|
||||
import org.matrix.rustcomponents.sdk.*
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncState
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncView
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncViewRoomListObserver
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncViewRoomsCountObserver
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncViewRoomsListDiff
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncViewStateObserver
|
||||
|
||||
fun SlidingSyncView.roomListDiff(scope: CoroutineScope): Flow<SlidingSyncViewRoomsListDiff> =
|
||||
mxCallbackFlow {
|
||||
|
|
|
|||
|
|
@ -2,15 +2,21 @@ package io.element.android.x.matrix.timeline
|
|||
|
||||
import io.element.android.x.core.coroutine.CoroutineDispatchers
|
||||
import io.element.android.x.matrix.room.MatrixRoom
|
||||
import java.util.Collections
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.FlowPreview
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.sample
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.matrix.rustcomponents.sdk.*
|
||||
import org.matrix.rustcomponents.sdk.PaginationOutcome
|
||||
import org.matrix.rustcomponents.sdk.Room
|
||||
import org.matrix.rustcomponents.sdk.SlidingSyncRoom
|
||||
import org.matrix.rustcomponents.sdk.TimelineChange
|
||||
import org.matrix.rustcomponents.sdk.TimelineDiff
|
||||
import org.matrix.rustcomponents.sdk.TimelineListener
|
||||
import timber.log.Timber
|
||||
import java.util.*
|
||||
|
||||
class MatrixTimeline(
|
||||
private val matrixRoom: MatrixRoom,
|
||||
|
|
@ -31,7 +37,7 @@ class MatrixTimeline(
|
|||
private val timelineItems: MutableStateFlow<List<MatrixTimelineItem>> =
|
||||
MutableStateFlow(emptyList())
|
||||
|
||||
|
||||
@OptIn(FlowPreview::class)
|
||||
fun timelineItems(): Flow<List<MatrixTimelineItem>> {
|
||||
return timelineItems.sample(50)
|
||||
}
|
||||
|
|
@ -41,7 +47,6 @@ class MatrixTimeline(
|
|||
return paginationOutcome.value.moreMessages
|
||||
}
|
||||
|
||||
|
||||
private fun MutableList<MatrixTimelineItem>.applyDiff(diff: TimelineDiff) {
|
||||
when (diff.change()) {
|
||||
TimelineChange.PUSH -> {
|
||||
|
|
@ -140,5 +145,4 @@ class MatrixTimeline(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ data class TracingConfiguration(
|
|||
targets.map { "${it.key.filter}=${it.value.filter}" }.joinToString(separator = ",")
|
||||
}"
|
||||
|
||||
|
||||
sealed class Target(open val filter: String) {
|
||||
object Hyper : Target("hyper")
|
||||
object Sled : Target("sled")
|
||||
|
|
@ -31,7 +30,6 @@ data class TracingConfiguration(
|
|||
object Debug : LogLevel("debug")
|
||||
object Error : LogLevel("error")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun setupTracing(tracingConfiguration: TracingConfiguration) {
|
||||
|
|
@ -47,4 +45,4 @@ object TracingConfigurations {
|
|||
TracingConfiguration.Target.Sled to TracingConfiguration.LogLevel.Warn
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
@file:OptIn(ExperimentalCoroutinesApi::class)
|
||||
package io.element.android.x.matrix.util
|
||||
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.channels.ProducerScope
|
||||
import kotlinx.coroutines.channels.awaitClose
|
||||
import kotlinx.coroutines.flow.callbackFlow
|
||||
|
|
@ -12,4 +11,4 @@ internal fun <T> mxCallbackFlow(block: suspend ProducerScope<T>.() -> StoppableS
|
|||
awaitClose {
|
||||
token.cancel()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@ fun logError(throwable: Throwable) {
|
|||
Timber.e("Error", throwable)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<manifest>
|
||||
|
||||
</manifest>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ sealed interface MessageComposerMode {
|
|||
override val defaultContent: CharSequence
|
||||
) : Special(eventId, defaultContent)
|
||||
|
||||
|
||||
val relatedEventId: String?
|
||||
get() = when (this) {
|
||||
is Normal -> null
|
||||
|
|
@ -42,7 +41,4 @@ sealed interface MessageComposerMode {
|
|||
is Quote -> eventId
|
||||
is Reply -> eventId
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,12 +45,12 @@ import io.element.android.wysiwyg.inputhandlers.models.InlineFormat
|
|||
import io.element.android.x.core.ui.DimensionConverter
|
||||
import io.element.android.x.core.ui.hideKeyboard
|
||||
import io.element.android.x.core.ui.showKeyboard
|
||||
import io.element.android.x.element.resources.R as ElementR
|
||||
import io.element.android.x.textcomposer.databinding.ComposerRichTextLayoutBinding
|
||||
import io.element.android.x.textcomposer.databinding.ViewRichTextMenuButtonBinding
|
||||
import io.element.android.x.textcomposer.tools.setTextIfDifferent
|
||||
import uniffi.wysiwyg_composer.ActionState
|
||||
import uniffi.wysiwyg_composer.ComposerAction
|
||||
import io.element.android.x.element.resources.R as ElementR
|
||||
|
||||
// Imported from Element Android
|
||||
class RichTextComposerLayout @JvmOverloads constructor(
|
||||
|
|
@ -247,28 +247,28 @@ class RichTextComposerLayout @JvmOverloads constructor(
|
|||
|
||||
private fun setupRichTextMenu() {
|
||||
addRichTextMenuItem(
|
||||
ElementR.drawable.ic_composer_bold,
|
||||
R.drawable.ic_composer_bold,
|
||||
ElementR.string.rich_text_editor_format_bold,
|
||||
ComposerAction.BOLD
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.Bold)
|
||||
}
|
||||
addRichTextMenuItem(
|
||||
ElementR.drawable.ic_composer_italic,
|
||||
R.drawable.ic_composer_italic,
|
||||
ElementR.string.rich_text_editor_format_italic,
|
||||
ComposerAction.ITALIC
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.Italic)
|
||||
}
|
||||
addRichTextMenuItem(
|
||||
ElementR.drawable.ic_composer_underlined,
|
||||
R.drawable.ic_composer_underlined,
|
||||
ElementR.string.rich_text_editor_format_underline,
|
||||
ComposerAction.UNDERLINE
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.Underline)
|
||||
}
|
||||
addRichTextMenuItem(
|
||||
ElementR.drawable.ic_composer_strikethrough,
|
||||
R.drawable.ic_composer_strikethrough,
|
||||
ElementR.string.rich_text_editor_format_strikethrough,
|
||||
ComposerAction.STRIKE_THROUGH
|
||||
) {
|
||||
|
|
@ -485,7 +485,7 @@ class RichTextComposerLayout @JvmOverloads constructor(
|
|||
} else {
|
||||
views.composerModeGroup.isGone = true
|
||||
(mode as? MessageComposerMode.Normal)?.content?.let { text ->
|
||||
// TODO: un-comment once we update to a version of the lib > 0.8.0
|
||||
// TODO un-comment once we update to a version of the lib > 0.8.0
|
||||
/*
|
||||
if (isTextFormattingEnabled) {
|
||||
replaceFormattedContent(text)
|
||||
|
|
|
|||
|
|
@ -22,81 +22,81 @@ import io.element.android.x.element.resources.R as ElementR
|
|||
|
||||
@Composable
|
||||
fun TextComposer(
|
||||
onSendMessage: (String) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
fullscreen: Boolean,
|
||||
onFullscreenToggle: () -> Unit,
|
||||
composerMode: MessageComposerMode,
|
||||
onCloseSpecialMode: () -> Unit,
|
||||
onComposerTextChange: (CharSequence) -> Unit,
|
||||
composerCanSendMessage: Boolean,
|
||||
composerText: String?,
|
||||
composerMode: MessageComposerMode,
|
||||
composerCanSendMessage: Boolean,
|
||||
modifier: Modifier = Modifier,
|
||||
onSendMessage: (String) -> Unit = {},
|
||||
onFullscreenToggle: () -> Unit = {},
|
||||
onCloseSpecialMode: () -> Unit = {},
|
||||
onComposerTextChange: (CharSequence) -> Unit = {},
|
||||
) {
|
||||
if (LocalInspectionMode.current) {
|
||||
FakeComposer(modifier)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
val isInDarkMode = isSystemInDarkTheme()
|
||||
AndroidView(
|
||||
modifier = modifier,
|
||||
factory = { context ->
|
||||
RichTextComposerLayout(context).apply {
|
||||
// Sets up listeners for View -> Compose communication
|
||||
this.callback = object : Callback {
|
||||
override fun onRichContentSelected(contentUri: Uri): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
val isInDarkMode = isSystemInDarkTheme()
|
||||
AndroidView(
|
||||
modifier = modifier,
|
||||
factory = { context ->
|
||||
RichTextComposerLayout(context).apply {
|
||||
// Sets up listeners for View -> Compose communication
|
||||
this.callback = object : Callback {
|
||||
override fun onRichContentSelected(contentUri: Uri): Boolean {
|
||||
return false
|
||||
override fun onTextChanged(text: CharSequence) {
|
||||
onComposerTextChange(text)
|
||||
}
|
||||
|
||||
override fun onCloseRelatedMessage() {
|
||||
onCloseSpecialMode()
|
||||
}
|
||||
|
||||
override fun onSendMessage(text: CharSequence) {
|
||||
// text contains markdown.
|
||||
onSendMessage(text.toString())
|
||||
}
|
||||
|
||||
override fun onAddAttachment() {
|
||||
}
|
||||
|
||||
override fun onExpandOrCompactChange() {
|
||||
}
|
||||
|
||||
override fun onFullScreenModeChanged() {
|
||||
onFullscreenToggle()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTextChanged(text: CharSequence) {
|
||||
onComposerTextChange(text)
|
||||
setFullScreen(fullscreen, animated = false, manageKeyboard = true)
|
||||
(this as MessageComposerView).apply {
|
||||
setup(isInDarkMode, composerMode)
|
||||
}
|
||||
|
||||
override fun onCloseRelatedMessage() {
|
||||
onCloseSpecialMode()
|
||||
}
|
||||
|
||||
override fun onSendMessage(text: CharSequence) {
|
||||
// text contains markdown.
|
||||
onSendMessage(text.toString())
|
||||
}
|
||||
|
||||
override fun onAddAttachment() {
|
||||
}
|
||||
|
||||
override fun onExpandOrCompactChange() {
|
||||
}
|
||||
|
||||
override fun onFullScreenModeChanged() {
|
||||
onFullscreenToggle()
|
||||
}
|
||||
|
||||
}
|
||||
setFullScreen(fullscreen, animated = false, manageKeyboard = true)
|
||||
(this as MessageComposerView).apply {
|
||||
setup(isInDarkMode, composerMode)
|
||||
}
|
||||
},
|
||||
update = { view ->
|
||||
// View's been inflated or state read in this block has been updated
|
||||
// Add logic here if necessary
|
||||
|
||||
// As selectedItem is read here, AndroidView will recompose
|
||||
// whenever the state changes
|
||||
// Example of Compose -> View communication
|
||||
val messageComposerView = (view as MessageComposerView)
|
||||
view.setFullScreen(fullscreen, animated = false, manageKeyboard = false)
|
||||
messageComposerView.renderComposerMode(composerMode)
|
||||
messageComposerView.sendButton.isInvisible = !composerCanSendMessage
|
||||
messageComposerView.setTextIfDifferent(composerText ?: "")
|
||||
messageComposerView.editText.requestFocus()
|
||||
}
|
||||
},
|
||||
update = { view ->
|
||||
// View's been inflated or state read in this block has been updated
|
||||
// Add logic here if necessary
|
||||
|
||||
// As selectedItem is read here, AndroidView will recompose
|
||||
// whenever the state changes
|
||||
// Example of Compose -> View communication
|
||||
val messageComposerView = (view as MessageComposerView)
|
||||
view.setFullScreen(fullscreen, animated = false, manageKeyboard = false)
|
||||
messageComposerView.renderComposerMode(composerMode)
|
||||
messageComposerView.sendButton.isInvisible = !composerCanSendMessage
|
||||
messageComposerView.setTextIfDifferent(composerText ?: "")
|
||||
messageComposerView.editText.requestFocus()
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun FakeComposer(modifier: Modifier) {
|
||||
private fun FakeComposer(
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
// AndroidView is not Available in this mode, just render a Text
|
||||
Box(
|
||||
modifier = modifier
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package io.element.android.x.textcomposer.tools
|
||||
|
||||
import android.view.ViewGroup
|
||||
import androidx.transition.*
|
||||
import androidx.transition.ChangeBounds
|
||||
import androidx.transition.Fade
|
||||
import androidx.transition.Transition
|
||||
import androidx.transition.TransitionManager
|
||||
import androidx.transition.TransitionSet
|
||||
|
||||
fun ViewGroup.animateLayoutChange(animationDuration: Long, transitionComplete: (() -> Unit)? = null) {
|
||||
val transition = TransitionSet().apply {
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="?android:colorBackground"/>
|
||||
<corners android:topLeftRadius="24dp" android:topRightRadius="24dp" />
|
||||
</shape>
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="?vctr_content_quinary"/>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="?vctr_content_quinary" />
|
||||
<corners android:radius="4dp" />
|
||||
|
||||
</shape>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="44dp"
|
||||
android:height="44dp"
|
||||
android:viewportWidth="44"
|
||||
android:viewportHeight="44">
|
||||
<path
|
||||
android:pathData="M16,14.5C16,13.672 16.672,13 17.5,13H22.288C25.139,13 27.25,15.466 27.25,18.25C27.25,19.38 26.902,20.458 26.298,21.34C27.765,22.268 28.75,23.882 28.75,25.75C28.75,28.689 26.311,31 23.393,31H17.5C16.672,31 16,30.328 16,29.5V14.5ZM19,16V20.5H22.288C23.261,20.5 24.25,19.608 24.25,18.25C24.25,16.892 23.261,16 22.288,16H19ZM19,23.5V28H23.393C24.735,28 25.75,26.953 25.75,25.75C25.75,24.547 24.735,23.5 23.393,23.5H19Z"
|
||||
android:fillColor="#8D97A5"
|
||||
android:fillType="evenOdd" />
|
||||
</vector>
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue