Merge branch 'develop' of https://github.com/vector-im/element-x-android-poc into develop
This commit is contained in:
8
.idea/inspectionProfiles/Project_Default.xml
generated
8
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -3,27 +3,35 @@
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
|
||||
<option name="composableFile" value="true" />
|
||||
<option name="previewFile" value="true" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
@@ -15,7 +15,8 @@
|
||||
tools:targetApi="33">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true">
|
||||
android:exported="true"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.ElementX" parent="android:Theme.Material.Light.NoActionBar" />
|
||||
<style name="Theme.ElementX" parent="Theme.ElementAndroid" />
|
||||
</resources>
|
||||
@@ -10,6 +10,7 @@ dependencies {
|
||||
implementation(project(":libraries:core"))
|
||||
implementation(project(":libraries:matrix"))
|
||||
implementation(project(":libraries:designsystem"))
|
||||
implementation(project(":libraries:textcomposer"))
|
||||
implementation(libs.mavericks.compose)
|
||||
implementation(libs.timber)
|
||||
implementation(libs.datetime)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
package io.element.android.x.features.messages
|
||||
|
||||
import Avatar
|
||||
import android.net.Uri
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
@@ -38,8 +39,11 @@ import io.element.android.x.designsystem.components.avatar.AvatarData
|
||||
import io.element.android.x.features.messages.model.MessagesItemGroupPosition
|
||||
import io.element.android.x.features.messages.model.MessagesTimelineItemState
|
||||
import io.element.android.x.features.messages.model.MessagesViewState
|
||||
import io.element.android.x.textcomposer.Callback
|
||||
import io.element.android.x.textcomposer.TextComposer
|
||||
|
||||
private val BUBBLE_RADIUS = 16.dp
|
||||
private val COMPOSER_HEIGHT = 112.dp
|
||||
|
||||
@Composable
|
||||
fun MessagesScreen(
|
||||
@@ -58,7 +62,8 @@ fun MessagesScreen(
|
||||
timelineItems = timelineItems().orEmpty(),
|
||||
hasMoreToLoad = hasMoreToLoad,
|
||||
onReachedLoadMore = viewModel::loadMore,
|
||||
onBackPressed = onBackPressed
|
||||
onBackPressed = onBackPressed,
|
||||
onSendMessage = viewModel::sendMessage
|
||||
)
|
||||
}
|
||||
|
||||
@@ -69,7 +74,8 @@ fun MessagesContent(
|
||||
timelineItems: List<MessagesTimelineItemState>,
|
||||
hasMoreToLoad: Boolean,
|
||||
onReachedLoadMore: () -> Unit,
|
||||
onBackPressed: () -> Unit
|
||||
onBackPressed: () -> Unit,
|
||||
onSendMessage: (CharSequence) -> Unit,
|
||||
) {
|
||||
LogCompositions(tag = "MessagesScreen", msg = "Content")
|
||||
val lazyListState = rememberLazyListState()
|
||||
@@ -103,20 +109,55 @@ fun MessagesContent(
|
||||
)
|
||||
},
|
||||
content = { padding ->
|
||||
TimelineItems(
|
||||
padding = padding,
|
||||
lazyListState = lazyListState,
|
||||
timelineItems = timelineItems,
|
||||
hasMoreToLoad = hasMoreToLoad,
|
||||
onReachedLoadMore = onReachedLoadMore,
|
||||
)
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(padding)
|
||||
.fillMaxSize()
|
||||
) {
|
||||
TimelineItems(
|
||||
lazyListState = lazyListState,
|
||||
timelineItems = timelineItems,
|
||||
hasMoreToLoad = hasMoreToLoad,
|
||||
onReachedLoadMore = onReachedLoadMore,
|
||||
)
|
||||
Box(
|
||||
modifier = Modifier.align(Alignment.BottomCenter)
|
||||
) {
|
||||
TextComposer(
|
||||
callback = object : Callback {
|
||||
override fun onRichContentSelected(contentUri: Uri): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onTextChanged(text: CharSequence) {
|
||||
}
|
||||
|
||||
override fun onCloseRelatedMessage() {
|
||||
}
|
||||
|
||||
override fun onSendMessage(text: CharSequence) {
|
||||
onSendMessage.invoke(text)
|
||||
}
|
||||
|
||||
override fun onAddAttachment() {
|
||||
}
|
||||
|
||||
override fun onExpandOrCompactChange() {
|
||||
}
|
||||
|
||||
override fun onFullScreenModeChanged() {
|
||||
}
|
||||
},
|
||||
height = COMPOSER_HEIGHT
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun TimelineItems(
|
||||
padding: PaddingValues,
|
||||
lazyListState: LazyListState,
|
||||
timelineItems: List<MessagesTimelineItemState>,
|
||||
hasMoreToLoad: Boolean,
|
||||
@@ -124,7 +165,7 @@ fun TimelineItems(
|
||||
) {
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.padding(padding)
|
||||
.padding(bottom = COMPOSER_HEIGHT)
|
||||
.fillMaxSize(),
|
||||
state = lazyListState,
|
||||
horizontalAlignment = Alignment.Start,
|
||||
@@ -245,14 +286,22 @@ fun MessageEventBubble(
|
||||
RoundedCornerShape(0.dp, BUBBLE_RADIUS, BUBBLE_RADIUS, BUBBLE_RADIUS)
|
||||
}
|
||||
MessagesItemGroupPosition.None ->
|
||||
RoundedCornerShape(BUBBLE_RADIUS, BUBBLE_RADIUS, BUBBLE_RADIUS, BUBBLE_RADIUS)
|
||||
RoundedCornerShape(
|
||||
BUBBLE_RADIUS,
|
||||
BUBBLE_RADIUS,
|
||||
BUBBLE_RADIUS,
|
||||
BUBBLE_RADIUS
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
val (backgroundBubbleColor, border) = if (messageEvent.isMine) {
|
||||
Pair(MaterialTheme.colorScheme.surfaceVariant, null)
|
||||
} else {
|
||||
Pair(Color.Transparent, BorderStroke(1.dp, MaterialTheme.colorScheme.surfaceVariant))
|
||||
Pair(
|
||||
Color.Transparent,
|
||||
BorderStroke(1.dp, MaterialTheme.colorScheme.surfaceVariant)
|
||||
)
|
||||
}
|
||||
|
||||
fun Modifier.offsetForItem(messageEvent: MessagesTimelineItemState.MessageEvent): Modifier {
|
||||
@@ -294,7 +343,10 @@ internal fun MessagesLoadingMoreIndicator(onReachedLoadMore: () -> Unit) {
|
||||
.padding(8.dp),
|
||||
contentAlignment = Alignment.Center,
|
||||
) {
|
||||
CircularProgressIndicator(strokeWidth = 2.dp, color = MaterialTheme.colorScheme.primary)
|
||||
CircularProgressIndicator(
|
||||
strokeWidth = 2.dp,
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
LaunchedEffect(Unit) {
|
||||
onReachedLoadMore()
|
||||
}
|
||||
|
||||
@@ -60,6 +60,12 @@ class MessagesViewModel(
|
||||
}
|
||||
}
|
||||
|
||||
fun sendMessage(text: CharSequence) {
|
||||
viewModelScope.launch {
|
||||
timeline.sendMessage(text.toString())
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleInit() {
|
||||
room.syncUpdateFlow()
|
||||
.onEach {
|
||||
|
||||
@@ -7,6 +7,7 @@ kotlin = "1.7.20"
|
||||
material = "1.6.1"
|
||||
corektx = "1.9.0"
|
||||
datastore = "1.0.0"
|
||||
constraintlayout = "2.1.4"
|
||||
|
||||
# Compose
|
||||
compose_compiler = "1.3.2"
|
||||
@@ -34,6 +35,7 @@ mavericks = "3.0.1"
|
||||
timber = "5.0.1"
|
||||
coil = "2.2.1"
|
||||
datetime = "0.4.0"
|
||||
wysiwyg = "0.4.0"
|
||||
|
||||
[libraries]
|
||||
# Project
|
||||
@@ -44,6 +46,7 @@ kotlin_gradle_plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", v
|
||||
androidx_material = { module = "com.google.android.material:material", version.ref = "material" }
|
||||
androidx_corektx = { module = "androidx.core:core-ktx", version.ref = "corektx" }
|
||||
androidx_datastore = { module = "androidx.datastore:datastore-preferences", version.ref = "datastore" }
|
||||
androidx_constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
|
||||
|
||||
androidx_compose_bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose_bom" }
|
||||
androidx_compose_foundation = { group = "androidx.compose.foundation", name = "foundation" }
|
||||
@@ -76,5 +79,8 @@ timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
|
||||
coil_compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
|
||||
datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime" }
|
||||
|
||||
# Composer
|
||||
wysiwyg = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" }
|
||||
|
||||
[bundles]
|
||||
|
||||
|
||||
11
libraries/elementresources/build.gradle.kts
Normal file
11
libraries/elementresources/build.gradle.kts
Normal file
@@ -0,0 +1,11 @@
|
||||
plugins {
|
||||
id("io.element.android-library")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "io.element.android.x.element.resources"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.google.android.material:material:1.7.0")
|
||||
}
|
||||
4
libraries/elementresources/src/main/AndroidManifest.xml
Normal file
4
libraries/elementresources/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" android:color="?attr/vctr_content_quinary" />
|
||||
<item android:state_pressed="true" android:color="?attr/colorSecondary" />
|
||||
<item android:state_hovered="true" android:color="?attr/colorSecondary" />
|
||||
<item android:state_selected="true" android:color="?attr/colorSecondary" />
|
||||
<item android:color="?attr/vctr_content_tertiary" />
|
||||
</selector>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@android:color/transparent" />
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="?vctr_content_quaternary" />
|
||||
|
||||
<corners android:radius="@dimen/rich_text_composer_corner_radius_expanded" />
|
||||
|
||||
</shape>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@android:color/transparent" />
|
||||
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="?vctr_content_quaternary" />
|
||||
|
||||
<corners android:radius="@dimen/rich_text_composer_corner_radius_single_line" />
|
||||
|
||||
</shape>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_hovered="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="?attr/vctr_rich_text_editor_menu_button_background" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="8dp" />
|
||||
<solid android:color="?attr/vctr_rich_text_editor_menu_button_background" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<ripple android:color="?attr/vctr_rich_text_editor_menu_button_background" />
|
||||
</item>
|
||||
</selector>
|
||||
13
libraries/elementresources/src/main/res/drawable/bg_send.xml
Normal file
13
libraries/elementresources/src/main/res/drawable/bg_send.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,21 @@
|
||||
<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>
|
||||
@@ -0,0 +1,20 @@
|
||||
<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>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,9 @@
|
||||
<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>
|
||||
@@ -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="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>
|
||||
@@ -0,0 +1,12 @@
|
||||
<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>
|
||||
@@ -0,0 +1,13 @@
|
||||
<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>
|
||||
20
libraries/elementresources/src/main/res/drawable/ic_edit.xml
Normal file
20
libraries/elementresources/src/main/res/drawable/ic_edit.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<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>
|
||||
@@ -0,0 +1,5 @@
|
||||
<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>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?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>
|
||||
161
libraries/elementresources/src/main/res/values/colors.xml
Normal file
161
libraries/elementresources/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Error colors -->
|
||||
<color name="vector_warning_color_2">@color/palette_melon</color>
|
||||
<color name="vector_info_color">#2f9edb</color>
|
||||
|
||||
<!-- Notification view colors -->
|
||||
<color name="soft_resource_limit_exceeded">#2f9edb</color>
|
||||
<color name="hard_resource_limit_exceeded">?colorError</color>
|
||||
|
||||
<!-- Notification (do not depends on theme) -->
|
||||
<color name="notification_accent_color">@color/palette_azure</color>
|
||||
<color name="key_share_req_accent_color">@color/palette_melon</color>
|
||||
|
||||
<!-- Source: https://zpl.io/aBKw9Mk -->
|
||||
|
||||
<color name="bg_call_screen_blur">#99000000</color>
|
||||
<color name="bg_call_screen">#27303A</color>
|
||||
|
||||
<color name="vctr_notice_secondary_alpha12">#1E61708B</color>
|
||||
|
||||
<!-- Other useful color -->
|
||||
<!-- Emoji text has to use a black text color -->
|
||||
<color name="emoji_color">@android:color/black</color>
|
||||
<color name="join_conference_animated_color">#0BAC7E</color>
|
||||
|
||||
<color name="half_transparent_status_bar">#80000000</color>
|
||||
|
||||
<color name="black_alpha">#55000000</color>
|
||||
<color name="black_54">#8A000000</color>
|
||||
|
||||
<!-- For Android status bar and navigation bar -->
|
||||
<color name="android_status_bar_background_light">@color/element_system_light</color>
|
||||
<color name="android_navigation_bar_background_light">@color/element_system_light</color>
|
||||
<color name="android_status_bar_background_dark">@color/element_background_dark</color>
|
||||
<color name="android_navigation_bar_background_dark">@color/element_system_dark</color>
|
||||
|
||||
<!-- Used for toolbar background -->
|
||||
<attr name="vctr_toolbar_background" format="color" />
|
||||
|
||||
<!-- Used for header background -->
|
||||
<attr name="vctr_header_background" format="color" />
|
||||
|
||||
<!-- Used for item separators in list -->
|
||||
<attr name="vctr_list_separator" format="color" />
|
||||
|
||||
<!-- Used for item separators in list, variant using element system color -->
|
||||
<attr name="vctr_list_separator_system" format="color" />
|
||||
|
||||
<!-- Used for item separators in list, on surface -->
|
||||
<attr name="vctr_list_separator_on_surface" format="color" />
|
||||
|
||||
<!-- Background color used for:
|
||||
- unread badge background for a room item in the room list
|
||||
- start unread indicator for a room item in the room list
|
||||
- Background for unread badge background in the bottom navigation -->
|
||||
<attr name="vctr_unread_background" format="color" />
|
||||
|
||||
<!-- Other colors, which are not in the palette -->
|
||||
<attr name="vctr_fab_label_bg" format="color" />
|
||||
<color name="vctr_fab_label_bg_light">@android:color/white</color>
|
||||
<color name="vctr_fab_label_bg_dark">#FF181B21</color>
|
||||
<color name="vctr_fab_label_bg_black">#FF181B21</color>
|
||||
|
||||
<attr name="vctr_fab_label_stroke" format="color" />
|
||||
<color name="vctr_fab_label_stroke_light">#1EFFFFFF</color>
|
||||
<color name="vctr_fab_label_stroke_dark">@android:color/black</color>
|
||||
<color name="vctr_fab_label_stroke_black">@android:color/black</color>
|
||||
|
||||
<attr name="vctr_fab_label_color" format="color" />
|
||||
<color name="vctr_fab_label_color_light">#FF2E2F32</color>
|
||||
<color name="vctr_fab_label_color_dark">#FFA1B2D1</color>
|
||||
<color name="vctr_fab_label_color_black">#FFA1B2D1</color>
|
||||
|
||||
<attr name="vctr_touch_guard_bg" format="color" />
|
||||
<color name="vctr_touch_guard_bg_light">#66000000</color>
|
||||
<color name="vctr_touch_guard_bg_dark">#BF000000</color>
|
||||
<color name="vctr_touch_guard_bg_black">#BF000000</color>
|
||||
|
||||
<attr name="vctr_room_active_widgets_banner_bg" format="color" />
|
||||
<color name="vctr_room_active_widgets_banner_bg_light">#EBEFF5</color>
|
||||
<color name="vctr_room_active_widgets_banner_bg_dark">#27303A</color>
|
||||
<color name="vctr_room_active_widgets_banner_bg_black">#27303A</color>
|
||||
|
||||
<attr name="vctr_room_active_widgets_banner_text" format="color" />
|
||||
<color name="vctr_room_active_widgets_banner_text_light">#61708B</color>
|
||||
<color name="vctr_room_active_widgets_banner_text_dark">#E3E8F0</color>
|
||||
<color name="vctr_room_active_widgets_banner_text_black">#E3E8F0</color>
|
||||
|
||||
<attr name="vctr_waiting_background_color" format="color" />
|
||||
<color name="vctr_waiting_background_color_light">#AAAAAAAA</color>
|
||||
<color name="vctr_waiting_background_color_dark">#55555555</color>
|
||||
|
||||
<color name="vctr_disabled_view_color_light">#EEEEEE</color>
|
||||
|
||||
<attr name="vctr_reaction_background_off" format="color" />
|
||||
<color name="vctr_reaction_background_off_light">#FFF3F8FD</color>
|
||||
<color name="vctr_reaction_background_off_dark">#22252B</color>
|
||||
<color name="vctr_reaction_background_off_black">#22252B</color>
|
||||
|
||||
<attr name="vctr_reaction_background_on" format="color" />
|
||||
<color name="vctr_reaction_background_on_light">#2011BC8A</color>
|
||||
<color name="vctr_reaction_background_on_dark">#4011BC8A</color>
|
||||
<color name="vctr_reaction_background_on_black">#4011BC8A</color>
|
||||
|
||||
<!-- (color from RiotWeb) -->
|
||||
<attr name="vctr_keys_backup_banner_accent_color" format="color" />
|
||||
<color name="vctr_keys_backup_banner_accent_color_light">#FFF8E3</color>
|
||||
<color name="vctr_keys_backup_banner_accent_color_dark">#22262E</color>
|
||||
|
||||
<attr name="vctr_chat_effect_snow_background" format="color" />
|
||||
<color name="vctr_chat_effect_snow_background_light">@color/black_alpha</color>
|
||||
<color name="vctr_chat_effect_snow_background_dark">@android:color/transparent</color>
|
||||
|
||||
<attr name="vctr_toast_background" format="color" />
|
||||
<color name="vctr_toast_background_light">@color/palette_black_900</color>
|
||||
<color name="vctr_toast_background_dark">@color/palette_gray_400</color>
|
||||
|
||||
<!-- Presence Indicator colors -->
|
||||
<attr name="vctr_presence_indicator_offline" format="color" />
|
||||
<color name="vctr_presence_indicator_offline_light">@color/palette_gray_100</color>
|
||||
<color name="vctr_presence_indicator_offline_dark">@color/palette_gray_450</color>
|
||||
|
||||
<attr name="vctr_presence_indicator_online" format="color" />
|
||||
<color name="vctr_presence_indicator_online_light">@color/palette_element_green</color>
|
||||
<color name="vctr_presence_indicator_online_dark">@color/palette_element_green</color>
|
||||
|
||||
<attr name="vctr_presence_indicator_busy" format="color" />
|
||||
<color name="vctr_presence_indicator_busy_light">@color/element_alert_light</color>
|
||||
<color name="vctr_presence_indicator_busy_dark">@color/element_alert_dark</color>
|
||||
|
||||
<attr name="vctr_presence_indicator_away" format="color" />
|
||||
<color name="vctr_presence_indicator_away_light">@color/palette_element_orange</color>
|
||||
<color name="vctr_presence_indicator_away_dark">@color/palette_element_orange</color>
|
||||
|
||||
<!-- Location sharing colors -->
|
||||
<attr name="vctr_live_location" format="color" />
|
||||
<color name="vctr_live_location_light">@color/palette_prune</color>
|
||||
<color name="vctr_live_location_dark">@color/palette_prune</color>
|
||||
|
||||
<!-- Shield colors -->
|
||||
<color name="shield_color_trust">#0DBD8B</color>
|
||||
<color name="shield_color_trust_background">#0F0DBD8B</color>
|
||||
<color name="shield_color_black">#17191C</color>
|
||||
<color name="shield_color_gray">#91A1C0</color>
|
||||
<color name="shield_color_warning">#FF4B55</color>
|
||||
<color name="shield_color_warning_background">#0FFF4B55</color>
|
||||
<color name="shield_color_unknown">@color/palette_gray_200</color>
|
||||
|
||||
<!-- Badge Colors -->
|
||||
<attr name="vctr_badge_color_border" format="color" />
|
||||
<color name="vctr_badge_color_border_light">@color/palette_white</color>
|
||||
<color name="vctr_badge_color_border_dark">@color/palette_black_950</color>
|
||||
|
||||
<!-- WYSIWYG Colors -->
|
||||
<attr name="vctr_rich_text_editor_menu_button_background" format="color" />
|
||||
<color name="vctr_rich_text_editor_menu_button_background_light">#EEF8F4</color>
|
||||
<color name="vctr_rich_text_editor_menu_button_background_dark">#1D292A</color>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?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>
|
||||
87
libraries/elementresources/src/main/res/values/dimens.xml
Normal file
87
libraries/elementresources/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="layout_touch_size">48dp</dimen>
|
||||
|
||||
<dimen name="layout_horizontal_margin">16dp</dimen>
|
||||
<dimen name="layout_vertical_margin">16dp</dimen>
|
||||
<dimen name="layout_vertical_margin_big">32dp</dimen>
|
||||
|
||||
<dimen name="profile_avatar_size">50dp</dimen>
|
||||
<dimen name="typing_avatar_size">20dp</dimen>
|
||||
<dimen name="item_event_message_state_size">16dp</dimen>
|
||||
|
||||
<dimen name="item_event_message_media_button_size">32dp</dimen>
|
||||
|
||||
<dimen name="quote_gap">8dp</dimen>
|
||||
|
||||
<item name="dialog_width_ratio" format="float" type="dimen">0.75</item>
|
||||
|
||||
<dimen name="pill_avatar_size">16dp</dimen>
|
||||
<dimen name="pill_min_height">20dp</dimen>
|
||||
<dimen name="pill_text_padding">4dp</dimen>
|
||||
|
||||
<dimen name="call_pip_height">128dp</dimen>
|
||||
<dimen name="call_pip_width">88dp</dimen>
|
||||
<dimen name="call_pip_radius">8dp</dimen>
|
||||
|
||||
<dimen name="item_form_min_height">76dp</dimen>
|
||||
|
||||
<!-- Max width for some buttons -->
|
||||
<dimen name="button_max_width">280dp</dimen>
|
||||
|
||||
<!-- Navigation Drawer -->
|
||||
<dimen name="navigation_drawer_max_width">320dp</dimen>
|
||||
|
||||
<!-- Preview Url -->
|
||||
<dimen name="preview_url_view_corner_radius">8dp</dimen>
|
||||
<dimen name="preview_url_view_image_max_height">160dp</dimen>
|
||||
|
||||
<dimen name="menu_item_icon_size">24dp</dimen>
|
||||
<dimen name="menu_item_size">48dp</dimen>
|
||||
<dimen name="menu_item_ripple_size">48dp</dimen>
|
||||
<dimen name="menu_item_width_small">34dp</dimen>
|
||||
|
||||
<!-- Composer -->
|
||||
<dimen name="composer_min_height">56dp</dimen>
|
||||
<dimen name="composer_attachment_size">52dp</dimen>
|
||||
<dimen name="composer_attachment_margin">1dp</dimen>
|
||||
<dimen name="rich_text_composer_corner_radius_single_line">28dp</dimen>
|
||||
<dimen name="rich_text_composer_corner_radius_expanded">14dp</dimen>
|
||||
|
||||
<dimen name="chat_bubble_margin_start">28dp</dimen>
|
||||
<dimen name="chat_bubble_margin_end">6dp</dimen>
|
||||
<dimen name="chat_bubble_fixed_size">350sp</dimen>
|
||||
<dimen name="chat_bubble_corner_radius">8dp</dimen>
|
||||
|
||||
<!-- Onboarding -->
|
||||
<item name="ftue_auth_gutter_start_percent" format="float" type="dimen">0.05</item>
|
||||
<item name="ftue_auth_gutter_end_percent" format="float" type="dimen">0.95</item>
|
||||
|
||||
<item name="ftue_auth_carousel_item_spacing" format="float" type="dimen">0.01</item>
|
||||
<item name="ftue_auth_carousel_item_image_height" format="float" type="dimen">0.35</item>
|
||||
|
||||
<item name="ftue_auth_profile_picture_height" format="float" type="dimen">0.15</item>
|
||||
<item name="ftue_auth_profile_picture_icon_height" format="float" type="dimen">0.05</item>
|
||||
|
||||
<!-- Location sharing -->
|
||||
<dimen name="location_sharing_option_default_padding">10dp</dimen>
|
||||
<dimen name="location_sharing_locate_button_margin_vertical">16dp</dimen>
|
||||
<dimen name="location_sharing_locate_button_margin_horizontal">12dp</dimen>
|
||||
<dimen name="location_sharing_compass_button_margin_horizontal">8dp</dimen>
|
||||
<dimen name="location_sharing_live_duration_choice_margin_horizontal">12dp</dimen>
|
||||
<dimen name="location_sharing_live_duration_choice_margin_vertical">22dp</dimen>
|
||||
|
||||
<!-- Voice Broadcast -->
|
||||
<dimen name="voice_broadcast_recorder_button_size">48dp</dimen>
|
||||
<dimen name="voice_broadcast_player_button_size">36dp</dimen>
|
||||
|
||||
<!-- Material 3 -->
|
||||
<dimen name="collapsing_toolbar_layout_medium_size">112dp</dimen>
|
||||
|
||||
|
||||
<dimen name="release_notes_vertical_margin_small">8dp</dimen>
|
||||
<dimen name="release_notes_vertical_margin">16dp</dimen>
|
||||
<dimen name="release_notes_vertical_margin_large">28dp</dimen>
|
||||
</resources>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<dimen name="text_size_title">24sp</dimen>
|
||||
<dimen name="text_size_headline">18sp</dimen>
|
||||
<dimen name="text_size_subtitle">16sp</dimen>
|
||||
<dimen name="text_size_body">14sp</dimen>
|
||||
<dimen name="text_size_caption">12sp</dimen>
|
||||
<dimen name="text_size_micro">10sp</dimen>
|
||||
<dimen name="text_size_nano">8sp</dimen>
|
||||
|
||||
<dimen name="text_size_button">14sp</dimen>
|
||||
|
||||
</resources>
|
||||
47
libraries/elementresources/src/main/res/values/palette.xml
Normal file
47
libraries/elementresources/src/main/res/values/palette.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="UnusedResources">
|
||||
|
||||
<!--
|
||||
Define all the colors used across the Element Android project
|
||||
Source: https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=1338%3A17947
|
||||
Some colors are not used, but we want the palette to be complete so we ignore the lint error
|
||||
UnusedResources for all the resources in this file
|
||||
-->
|
||||
|
||||
<!-- For all themes -->
|
||||
<color name="palette_azure">#368BD6</color>
|
||||
<color name="palette_kiwi">#74D12C</color>
|
||||
<color name="palette_grape">#AC3BA8</color>
|
||||
<color name="palette_verde">#03B381</color>
|
||||
<color name="palette_polly">#E64F7A</color>
|
||||
<color name="palette_melon">#FF812D</color>
|
||||
|
||||
<color name="palette_element_green">#0DBD8B</color>
|
||||
<color name="palette_element_orange">#D9B072</color>
|
||||
<color name="palette_white">#FFFFFF</color>
|
||||
<color name="palette_vermilion">#FF5B55</color>
|
||||
<!-- (unused) -->
|
||||
<color name="palette_ems">#7E69FF</color>
|
||||
<color name="palette_aqua">#2DC2C5</color>
|
||||
<color name="palette_prune">#5C56F5</color>
|
||||
<color name="palette_links">#0086E6</color>
|
||||
|
||||
<!-- For light themes -->
|
||||
<color name="palette_gray_25">#F4F6FA</color>
|
||||
<color name="palette_gray_50">#E3E8F0</color>
|
||||
<color name="palette_gray_100">#C1C6CD</color>
|
||||
<color name="palette_gray_150">#8D97A5</color>
|
||||
<color name="palette_gray_200">#737D8C</color>
|
||||
<color name="palette_black_900">#17191C</color>
|
||||
<!-- (unused) -->
|
||||
<color name="palette_ice">#F4F9FD</color>
|
||||
|
||||
<!-- For dark themes -->
|
||||
<color name="palette_gray_250">#A9B2BC</color>
|
||||
<color name="palette_gray_300">#8E99A4</color>
|
||||
<color name="palette_gray_400">#6F7882</color>
|
||||
<color name="palette_gray_450">#394049</color>
|
||||
<color name="palette_black_800">#15191E</color>
|
||||
<color name="palette_black_950">#21262C</color>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<!-- Alias to the palette colors
|
||||
Source: https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=1521%3A23026 -->
|
||||
|
||||
<color name="element_accent_light">@color/palette_element_green</color>
|
||||
<color name="element_accent_dark">@color/palette_element_green</color>
|
||||
|
||||
<color name="element_alert_light">@color/palette_vermilion</color>
|
||||
<color name="element_alert_dark">@color/palette_vermilion</color>
|
||||
|
||||
<color name="element_link_light">@color/palette_links</color>
|
||||
<color name="element_link_dark">@color/palette_links</color>
|
||||
|
||||
<!-- attr for content colors -->
|
||||
<attr name="vctr_content_primary" format="color" />
|
||||
<attr name="vctr_content_secondary" format="color" />
|
||||
<attr name="vctr_content_tertiary" format="color" />
|
||||
<attr name="vctr_content_quaternary" format="color" />
|
||||
<attr name="vctr_content_quinary" format="color" />
|
||||
|
||||
<color name="element_content_primary_light">@color/palette_black_900</color>
|
||||
<color name="element_content_secondary_light">@color/palette_gray_200</color>
|
||||
<color name="element_content_tertiary_light">@color/palette_gray_150</color>
|
||||
<color name="element_content_quaternary_light">@color/palette_gray_100</color>
|
||||
<color name="element_content_quinary_light">@color/palette_gray_50</color>
|
||||
|
||||
<color name="element_content_primary_dark">@color/palette_white</color>
|
||||
<color name="element_content_secondary_dark">@color/palette_gray_250</color>
|
||||
<color name="element_content_tertiary_dark">@color/palette_gray_300</color>
|
||||
<color name="element_content_quaternary_dark">@color/palette_gray_400</color>
|
||||
<color name="element_content_quinary_dark">@color/palette_gray_450</color>
|
||||
|
||||
<attr name="vctr_system" format="color" />
|
||||
<color name="element_system_light">@color/palette_gray_25</color>
|
||||
<color name="element_system_dark">@color/palette_black_950</color>
|
||||
|
||||
<color name="element_background_light">@color/palette_white</color>
|
||||
<color name="element_background_dark">@color/palette_black_800</color>
|
||||
<color name="element_background_black">@android:color/black</color>
|
||||
|
||||
<color name="element_name_01">@color/palette_azure</color>
|
||||
<color name="element_name_02">@color/palette_grape</color>
|
||||
<color name="element_name_03">@color/palette_verde</color>
|
||||
<color name="element_name_04">@color/palette_polly</color>
|
||||
<color name="element_name_05">@color/palette_melon</color>
|
||||
<color name="element_name_06">@color/palette_aqua</color>
|
||||
<color name="element_name_07">@color/palette_prune</color>
|
||||
<color name="element_name_08">@color/palette_kiwi</color>
|
||||
|
||||
<!-- Also create alias for rooms -->
|
||||
<color name="element_room_01">@color/palette_verde</color>
|
||||
<color name="element_room_02">@color/palette_azure</color>
|
||||
<color name="element_room_03">@color/palette_grape</color>
|
||||
</resources>
|
||||
3454
libraries/elementresources/src/main/res/values/strings.xml
Normal file
3454
libraries/elementresources/src/main/res/values/strings.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?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>
|
||||
<item name="android:lines">1</item>
|
||||
<item name="android:textColor">?vctr_content_secondary</item>
|
||||
<item name="android:textSize">12sp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?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">12</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>
|
||||
<item name="android:maxLines">12</item>
|
||||
<item name="android:minHeight">20dp</item>
|
||||
<item name="android:padding">0dp</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
<item name="android:textColor">?vctr_message_text_color</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?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>
|
||||
@@ -0,0 +1,104 @@
|
||||
<?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>
|
||||
169
libraries/elementresources/src/main/res/values/theme_light.xml
Normal file
169
libraries/elementresources/src/main/res/values/theme_light.xml
Normal file
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Theme.ElementAndroid" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<!-- Element attribute for palette -->
|
||||
<!-- content colors -->
|
||||
<item name="vctr_content_primary">@color/element_content_primary_light</item>
|
||||
<item name="vctr_content_secondary">@color/element_content_secondary_light</item>
|
||||
<item name="vctr_content_tertiary">@color/element_content_tertiary_light</item>
|
||||
<item name="vctr_content_quaternary">@color/element_content_quaternary_light</item>
|
||||
<item name="vctr_content_quinary">@color/element_content_quinary_light</item>
|
||||
|
||||
<!-- system colors -->
|
||||
<item name="vctr_system">@color/element_system_light</item>
|
||||
|
||||
<!-- other colors -->
|
||||
<item name="vctr_fab_label_bg">@color/vctr_fab_label_bg_light</item>
|
||||
<item name="vctr_fab_label_stroke">@color/vctr_fab_label_stroke_light</item>
|
||||
<item name="vctr_fab_label_color">@color/vctr_fab_label_color_light</item>
|
||||
<item name="vctr_touch_guard_bg">@color/vctr_touch_guard_bg_light</item>
|
||||
<item name="vctr_keys_backup_banner_accent_color">@color/vctr_keys_backup_banner_accent_color_light</item>
|
||||
<item name="vctr_room_active_widgets_banner_bg">@color/vctr_room_active_widgets_banner_bg_light</item>
|
||||
<item name="vctr_room_active_widgets_banner_text">@color/vctr_room_active_widgets_banner_text_light</item>
|
||||
<item name="vctr_reaction_background_off">@color/vctr_reaction_background_off_light</item>
|
||||
<item name="vctr_reaction_background_on">@color/vctr_reaction_background_on_light</item>
|
||||
<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>
|
||||
<item name="vctr_presence_indicator_busy">@color/vctr_presence_indicator_busy_light</item>
|
||||
<item name="vctr_presence_indicator_away">@color/vctr_presence_indicator_away_light</item>
|
||||
|
||||
<!-- Some aliases -->
|
||||
<item name="vctr_header_background">?vctr_system</item>
|
||||
<item name="vctr_list_separator">?vctr_content_quinary</item>
|
||||
<item name="vctr_list_separator_system">?vctr_system</item>
|
||||
<item name="vctr_list_separator_on_surface">?vctr_system</item>
|
||||
<item name="vctr_unread_background">?vctr_content_tertiary</item>
|
||||
|
||||
<!-- Material color -->
|
||||
<item name="colorPrimary">@color/element_accent_light</item>
|
||||
<item name="colorPrimaryVariant">@color/element_accent_light</item>
|
||||
<item name="colorOnPrimary">@android:color/white</item>
|
||||
<item name="colorSecondary">@color/element_accent_light</item>
|
||||
<item name="colorSecondaryVariant">@color/element_accent_light</item>
|
||||
<item name="colorOnSecondary">@android:color/white</item>
|
||||
<item name="colorError">@color/element_alert_light</item>
|
||||
<item name="colorOnError">@color/palette_white</item>
|
||||
<item name="colorSurface">@color/element_system_light</item>
|
||||
<item name="colorOnSurface">?vctr_content_primary</item>
|
||||
<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 -->
|
||||
<item name="android:actionMenuTextColor">?colorSecondary</item>
|
||||
|
||||
<!-- Default color for text View -->
|
||||
<item name="android:textColorTertiary">@color/element_content_primary_light</item>
|
||||
|
||||
<!-- ANDROID SUPPORT ATTRIBUTES -->
|
||||
<!-- disable the overscroll because setOverscrollHeader/Footer don't always work -->
|
||||
<item name="android:overScrollMode">never</item>
|
||||
|
||||
<!--
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<item name="lockscreen_theme">@style/PinCodeScreenStyle</item>
|
||||
<item name="lockscreen_key_button_theme">@style/PinCodeKeyButtonStyle</item>
|
||||
<item name="lockscreen_title_theme">@style/PinCodeTitleStyle</item>
|
||||
<item name="lockscreen_hint_theme">@style/PinCodeHintStyle</item>
|
||||
<item name="lockscreen_code_view_theme">@style/PinCodeDotsViewStyle</item>
|
||||
<item name="lockscreen_delete_button_theme">@style/PinCodeDeleteButtonStyle</item>
|
||||
<item name="lockscreen_fingerprint_button_theme">@style/PinCodeFingerprintButtonStyle</item>
|
||||
<item name="lockscreen_next_theme">@style/PinCodeNextButtonStyle</item>
|
||||
-->
|
||||
|
||||
<!-- Use dark color, to have enough contrast with icons color. windowLightStatusBar is only available in API 23+ -->
|
||||
<item name="android:statusBarColor">@color/android_status_bar_background_dark</item>
|
||||
<!-- Use dark color, to have enough contrast with icons color. windowLightNavigationBar is only available in API 27+ -->
|
||||
<item name="android:navigationBarColor">@color/android_navigation_bar_background_dark</item>
|
||||
|
||||
<!-- 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>
|
||||
<item name="vctr_social_login_button_facebook_style">@style/Widget.Vector.Button.Outlined.SocialLogin.Facebook.Light</item>
|
||||
<item name="vctr_social_login_button_twitter_style">@style/Widget.Vector.Button.Outlined.SocialLogin.Twitter.Light</item>
|
||||
<item name="vctr_social_login_button_apple_style">@style/Widget.Vector.Button.Outlined.SocialLogin.Apple.Light</item>
|
||||
<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>
|
||||
-->
|
||||
|
||||
<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>
|
||||
|
||||
<!-- Material 3 -->
|
||||
<item name="collapsingToolbarLayoutMediumSize">@dimen/collapsing_toolbar_layout_medium_size</item>
|
||||
|
||||
<!-- WYSIWYG Editor -->
|
||||
<item name="vctr_rich_text_editor_menu_button_background">@color/vctr_rich_text_editor_menu_button_background_light</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -116,6 +116,8 @@ class MatrixTimeline(
|
||||
}
|
||||
|
||||
suspend fun sendMessage(message: String): Result<Unit> {
|
||||
val content = messageEventContentFromMarkdown(message)
|
||||
room.send(content, null)
|
||||
return Result.success(Unit)
|
||||
}
|
||||
|
||||
|
||||
17
libraries/textcomposer/build.gradle.kts
Normal file
17
libraries/textcomposer/build.gradle.kts
Normal file
@@ -0,0 +1,17 @@
|
||||
plugins {
|
||||
id("io.element.android-compose")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "io.element.android.x.textcomposer"
|
||||
buildFeatures {
|
||||
viewBinding = true
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":libraries:elementresources"))
|
||||
implementation(libs.wysiwyg)
|
||||
implementation(libs.androidx.constraintlayout)
|
||||
implementation("com.google.android.material:material:1.7.0")
|
||||
}
|
||||
4
libraries/textcomposer/src/main/AndroidManifest.xml
Normal file
4
libraries/textcomposer/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Copyright (c) 2022 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.element.android.x.textcomposer
|
||||
|
||||
import android.net.Uri
|
||||
import android.text.Editable
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageButton
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
|
||||
// Imported from Element Android
|
||||
interface MessageComposerView {
|
||||
|
||||
val text: Editable?
|
||||
val formattedText: String?
|
||||
val editText: EditText
|
||||
val emojiButton: ImageButton?
|
||||
val sendButton: ImageButton
|
||||
val attachmentButton: ImageButton
|
||||
val fullScreenButton: ImageButton?
|
||||
val composerRelatedMessageTitle: TextView
|
||||
val composerRelatedMessageContent: TextView
|
||||
val composerRelatedMessageImage: ImageView
|
||||
val composerRelatedMessageActionIcon: ImageView
|
||||
val composerRelatedMessageAvatar: ImageView
|
||||
|
||||
var callback: Callback?
|
||||
|
||||
var isVisible: Boolean
|
||||
|
||||
fun collapse(animate: Boolean = true, transitionComplete: (() -> Unit)? = null)
|
||||
fun expand(animate: Boolean = true, transitionComplete: (() -> Unit)? = null)
|
||||
fun setTextIfDifferent(text: CharSequence?): Boolean
|
||||
fun replaceFormattedContent(text: CharSequence)
|
||||
fun toggleFullScreen(newValue: Boolean)
|
||||
|
||||
fun setInvisible(isInvisible: Boolean)
|
||||
}
|
||||
|
||||
interface Callback {
|
||||
// From ComposerEditText.Callback
|
||||
fun onRichContentSelected(contentUri: Uri): Boolean
|
||||
|
||||
// From ComposerEditText.Callback
|
||||
fun onTextChanged(text: CharSequence)
|
||||
|
||||
fun onCloseRelatedMessage()
|
||||
fun onSendMessage(text: CharSequence)
|
||||
fun onAddAttachment()
|
||||
fun onExpandOrCompactChange()
|
||||
fun onFullScreenModeChanged()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,324 @@
|
||||
/*
|
||||
* Copyright (c) 2022 New Vector Ltd
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package io.element.android.x.textcomposer
|
||||
|
||||
import android.content.Context
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.EditText
|
||||
import android.widget.ImageButton
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.annotation.StringRes
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.core.text.toSpannable
|
||||
import androidx.core.view.isInvisible
|
||||
import androidx.core.view.isVisible
|
||||
import io.element.android.wysiwyg.EditorEditText
|
||||
import io.element.android.wysiwyg.inputhandlers.models.InlineFormat
|
||||
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.animateLayoutChange
|
||||
import io.element.android.x.textcomposer.tools.setTextIfDifferent
|
||||
import uniffi.wysiwyg_composer.ComposerAction
|
||||
import uniffi.wysiwyg_composer.MenuState
|
||||
|
||||
// Imported from Element Android
|
||||
class RichTextComposerLayout @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), MessageComposerView {
|
||||
|
||||
private val views: ComposerRichTextLayoutBinding
|
||||
|
||||
override var callback: Callback? = null
|
||||
|
||||
private var currentConstraintSetId: Int = -1
|
||||
private val animationDuration = 100L
|
||||
private val maxEditTextLinesWhenCollapsed = 12
|
||||
|
||||
private val isFullScreen: Boolean get() = currentConstraintSetId == R.layout.composer_rich_text_layout_constraint_set_fullscreen
|
||||
|
||||
var isTextFormattingEnabled = true
|
||||
set(value) {
|
||||
if (field == value) return
|
||||
syncEditTexts()
|
||||
field = value
|
||||
updateEditTextVisibility()
|
||||
}
|
||||
|
||||
override val text: Editable?
|
||||
get() = editText.text
|
||||
override val formattedText: String?
|
||||
get() = (editText as? EditorEditText)?.getHtmlOutput()
|
||||
override val editText: EditText
|
||||
get() = if (isTextFormattingEnabled) {
|
||||
views.richTextComposerEditText
|
||||
} else {
|
||||
views.plainTextComposerEditText
|
||||
}
|
||||
override val emojiButton: ImageButton?
|
||||
get() = null
|
||||
override val sendButton: ImageButton
|
||||
get() = views.sendButton
|
||||
override val attachmentButton: ImageButton
|
||||
get() = views.attachmentButton
|
||||
override val fullScreenButton: ImageButton?
|
||||
get() = views.composerFullScreenButton
|
||||
override val composerRelatedMessageActionIcon: ImageView
|
||||
get() = views.composerRelatedMessageActionIcon
|
||||
override val composerRelatedMessageAvatar: ImageView
|
||||
get() = views.composerRelatedMessageAvatar
|
||||
override val composerRelatedMessageContent: TextView
|
||||
get() = views.composerRelatedMessageContent
|
||||
override val composerRelatedMessageImage: ImageView
|
||||
get() = views.composerRelatedMessageImage
|
||||
override val composerRelatedMessageTitle: TextView
|
||||
get() = views.composerRelatedMessageTitle
|
||||
override var isVisible: Boolean
|
||||
get() = views.root.isVisible
|
||||
set(value) {
|
||||
views.root.isVisible = value
|
||||
}
|
||||
|
||||
init {
|
||||
inflate(context, R.layout.composer_rich_text_layout, this)
|
||||
views = ComposerRichTextLayoutBinding.bind(this)
|
||||
|
||||
collapse(false)
|
||||
|
||||
views.richTextComposerEditText.addTextChangedListener(
|
||||
TextChangeListener({ callback?.onTextChanged(it) }, { updateTextFieldBorder() })
|
||||
)
|
||||
views.plainTextComposerEditText.addTextChangedListener(
|
||||
TextChangeListener({ callback?.onTextChanged(it) }, { updateTextFieldBorder() })
|
||||
)
|
||||
|
||||
views.composerRelatedMessageCloseButton.setOnClickListener {
|
||||
collapse()
|
||||
callback?.onCloseRelatedMessage()
|
||||
}
|
||||
|
||||
views.sendButton.setOnClickListener {
|
||||
val textMessage = text?.toSpannable() ?: ""
|
||||
callback?.onSendMessage(textMessage)
|
||||
}
|
||||
|
||||
views.attachmentButton.setOnClickListener {
|
||||
callback?.onAddAttachment()
|
||||
}
|
||||
|
||||
views.composerFullScreenButton.setOnClickListener {
|
||||
callback?.onFullScreenModeChanged()
|
||||
}
|
||||
|
||||
setupRichTextMenu()
|
||||
}
|
||||
|
||||
private fun setupRichTextMenu() {
|
||||
addRichTextMenuItem(
|
||||
ElementR.drawable.ic_composer_bold,
|
||||
ElementR.string.rich_text_editor_format_bold,
|
||||
ComposerAction.Bold
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.Bold)
|
||||
}
|
||||
addRichTextMenuItem(
|
||||
ElementR.drawable.ic_composer_italic,
|
||||
ElementR.string.rich_text_editor_format_italic,
|
||||
ComposerAction.Italic
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.Italic)
|
||||
}
|
||||
addRichTextMenuItem(
|
||||
ElementR.drawable.ic_composer_underlined,
|
||||
ElementR.string.rich_text_editor_format_underline,
|
||||
ComposerAction.Underline
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.Underline)
|
||||
}
|
||||
addRichTextMenuItem(
|
||||
ElementR.drawable.ic_composer_strikethrough,
|
||||
ElementR.string.rich_text_editor_format_strikethrough,
|
||||
ComposerAction.StrikeThrough
|
||||
) {
|
||||
views.richTextComposerEditText.toggleInlineFormat(InlineFormat.StrikeThrough)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
|
||||
views.richTextComposerEditText.menuStateChangedListener =
|
||||
EditorEditText.OnMenuStateChangedListener { state ->
|
||||
if (state is MenuState.Update) {
|
||||
updateMenuStateFor(ComposerAction.Bold, state)
|
||||
updateMenuStateFor(ComposerAction.Italic, state)
|
||||
updateMenuStateFor(ComposerAction.Underline, state)
|
||||
updateMenuStateFor(ComposerAction.StrikeThrough, state)
|
||||
}
|
||||
}
|
||||
|
||||
updateEditTextVisibility()
|
||||
}
|
||||
|
||||
private fun updateEditTextVisibility() {
|
||||
views.richTextComposerEditText.isVisible = isTextFormattingEnabled
|
||||
views.richTextMenu.isVisible = isTextFormattingEnabled
|
||||
views.plainTextComposerEditText.isVisible = !isTextFormattingEnabled
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the non-active input with the contents of the active input.
|
||||
*/
|
||||
private fun syncEditTexts() =
|
||||
if (isTextFormattingEnabled) {
|
||||
views.plainTextComposerEditText.setText(views.richTextComposerEditText.getPlainText())
|
||||
} else {
|
||||
views.richTextComposerEditText.setText(views.plainTextComposerEditText.text.toString())
|
||||
}
|
||||
|
||||
private fun addRichTextMenuItem(
|
||||
@DrawableRes iconId: Int,
|
||||
@StringRes description: Int,
|
||||
action: ComposerAction,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
val button = ViewRichTextMenuButtonBinding.inflate(inflater, views.richTextMenu, true)
|
||||
button.root.tag = action
|
||||
with(button.root) {
|
||||
contentDescription = resources.getString(description)
|
||||
setImageResource(iconId)
|
||||
setOnClickListener {
|
||||
onClick()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateMenuStateFor(action: ComposerAction, menuState: MenuState.Update) {
|
||||
val button = findViewWithTag<ImageButton>(action) ?: return
|
||||
button.isEnabled = !menuState.disabledActions.contains(action)
|
||||
button.isSelected = menuState.reversedActions.contains(action)
|
||||
}
|
||||
|
||||
private fun updateTextFieldBorder() {
|
||||
val isExpanded = editText.editableText.lines().count() > 1
|
||||
val borderResource = if (isExpanded || isFullScreen) {
|
||||
ElementR.drawable.bg_composer_rich_edit_text_expanded
|
||||
} else {
|
||||
ElementR.drawable.bg_composer_rich_edit_text_single_line
|
||||
}
|
||||
views.composerEditTextOuterBorder.setBackgroundResource(borderResource)
|
||||
}
|
||||
|
||||
override fun replaceFormattedContent(text: CharSequence) {
|
||||
views.richTextComposerEditText.setHtml(text.toString())
|
||||
}
|
||||
|
||||
override fun collapse(animate: Boolean, transitionComplete: (() -> Unit)?) {
|
||||
if (currentConstraintSetId == R.layout.composer_rich_text_layout_constraint_set_compact) {
|
||||
// ignore we good
|
||||
return
|
||||
}
|
||||
currentConstraintSetId = R.layout.composer_rich_text_layout_constraint_set_compact
|
||||
applyNewConstraintSet(animate, transitionComplete)
|
||||
updateEditTextVisibility()
|
||||
}
|
||||
|
||||
override fun expand(animate: Boolean, transitionComplete: (() -> Unit)?) {
|
||||
if (currentConstraintSetId == R.layout.composer_rich_text_layout_constraint_set_expanded) {
|
||||
// ignore we good
|
||||
return
|
||||
}
|
||||
currentConstraintSetId = R.layout.composer_rich_text_layout_constraint_set_expanded
|
||||
applyNewConstraintSet(animate, transitionComplete)
|
||||
updateEditTextVisibility()
|
||||
}
|
||||
|
||||
override fun setTextIfDifferent(text: CharSequence?): Boolean {
|
||||
return editText.setTextIfDifferent(text)
|
||||
}
|
||||
|
||||
override fun toggleFullScreen(newValue: Boolean) {
|
||||
val constraintSetId =
|
||||
if (newValue) R.layout.composer_rich_text_layout_constraint_set_fullscreen else currentConstraintSetId
|
||||
ConstraintSet().also {
|
||||
it.clone(context, constraintSetId)
|
||||
it.applyTo(this)
|
||||
}
|
||||
|
||||
updateTextFieldBorder()
|
||||
updateEditTextVisibility()
|
||||
|
||||
updateEditTextFullScreenState(views.richTextComposerEditText, newValue)
|
||||
updateEditTextFullScreenState(views.plainTextComposerEditText, newValue)
|
||||
}
|
||||
|
||||
private fun updateEditTextFullScreenState(editText: EditText, isFullScreen: Boolean) {
|
||||
if (isFullScreen) {
|
||||
editText.maxLines = Int.MAX_VALUE
|
||||
// This is a workaround to fix incorrect scroll position when maximised
|
||||
post { editText.requestLayout() }
|
||||
} else {
|
||||
editText.maxLines = maxEditTextLinesWhenCollapsed
|
||||
}
|
||||
}
|
||||
|
||||
private fun applyNewConstraintSet(animate: Boolean, transitionComplete: (() -> Unit)?) {
|
||||
// val wasSendButtonInvisible = views.sendButton.isInvisible
|
||||
if (animate) {
|
||||
animateLayoutChange(animationDuration, transitionComplete)
|
||||
}
|
||||
ConstraintSet().also {
|
||||
it.clone(context, currentConstraintSetId)
|
||||
it.applyTo(this)
|
||||
}
|
||||
|
||||
// Might be updated by view state just after, but avoid blinks
|
||||
// views.sendButton.isInvisible = wasSendButtonInvisible
|
||||
}
|
||||
|
||||
override fun setInvisible(isInvisible: Boolean) {
|
||||
this.isInvisible = isInvisible
|
||||
}
|
||||
|
||||
private class TextChangeListener(
|
||||
private val onTextChanged: (s: Editable) -> Unit,
|
||||
private val onExpandedChanged: (isExpanded: Boolean) -> Unit,
|
||||
) : TextWatcher {
|
||||
private var previousTextWasExpanded = false
|
||||
|
||||
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {}
|
||||
override fun afterTextChanged(s: Editable) {
|
||||
onTextChanged.invoke(s)
|
||||
|
||||
val isExpanded = s.lines().count() > 1
|
||||
if (previousTextWasExpanded != isExpanded) {
|
||||
onExpandedChanged(isExpanded)
|
||||
}
|
||||
previousTextWasExpanded = isExpanded
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package io.element.android.x.textcomposer
|
||||
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.core.view.isVisible
|
||||
import io.element.android.x.element.resources.R as ElementR
|
||||
|
||||
@Composable
|
||||
fun TextComposer(
|
||||
callback: Callback,
|
||||
height: Dp,
|
||||
){
|
||||
AndroidView(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(height),
|
||||
factory = { context ->
|
||||
RichTextComposerLayout(context).apply {
|
||||
// Sets up listeners for View -> Compose communication
|
||||
this.callback = callback
|
||||
val messageComposerView = (this as MessageComposerView)
|
||||
setupComposer(messageComposerView)
|
||||
}
|
||||
},
|
||||
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)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun setupComposer(messageComposerView: MessageComposerView) {
|
||||
messageComposerView.editText.setHint(ElementR.string.room_message_placeholder)
|
||||
messageComposerView.emojiButton?.isVisible = true
|
||||
messageComposerView.sendButton.isVisible = true
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package io.element.android.x.textcomposer.tools
|
||||
|
||||
import android.text.Spanned
|
||||
import android.widget.EditText
|
||||
|
||||
fun EditText.setTextIfDifferent(newText: CharSequence?): Boolean {
|
||||
if (!isTextDifferent(newText, text)) {
|
||||
// Previous text is the same. No op
|
||||
return false
|
||||
}
|
||||
setText(newText)
|
||||
// Since the text changed we move the cursor to the end of the new text.
|
||||
// This allows us to fill in text programmatically with a different value,
|
||||
// but if the user is typing and the view is rebound we won't lose their cursor position.
|
||||
setSelection(newText?.length ?: 0)
|
||||
return true
|
||||
}
|
||||
|
||||
private fun isTextDifferent(str1: CharSequence?, str2: CharSequence?): Boolean {
|
||||
if (str1 === str2) {
|
||||
return false
|
||||
}
|
||||
if (str1 == null || str2 == null) {
|
||||
return true
|
||||
}
|
||||
val length = str1.length
|
||||
if (length != str2.length) {
|
||||
return true
|
||||
}
|
||||
if (str1 is Spanned) {
|
||||
return str1 != str2
|
||||
}
|
||||
for (i in 0 until length) {
|
||||
if (str1[i] != str2[i]) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package io.element.android.x.textcomposer.tools
|
||||
|
||||
import androidx.transition.Transition
|
||||
|
||||
open class SimpleTransitionListener : Transition.TransitionListener {
|
||||
override fun onTransitionEnd(transition: Transition) {
|
||||
// No op
|
||||
}
|
||||
|
||||
override fun onTransitionResume(transition: Transition) {
|
||||
// No op
|
||||
}
|
||||
|
||||
override fun onTransitionPause(transition: Transition) {
|
||||
// No op
|
||||
}
|
||||
|
||||
override fun onTransitionCancel(transition: Transition) {
|
||||
// No op
|
||||
}
|
||||
|
||||
override fun onTransitionStart(transition: Transition) {
|
||||
// No op
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package io.element.android.x.textcomposer.tools
|
||||
|
||||
import android.view.ViewGroup
|
||||
import androidx.transition.*
|
||||
|
||||
fun ViewGroup.animateLayoutChange(animationDuration: Long, transitionComplete: (() -> Unit)? = null) {
|
||||
val transition = TransitionSet().apply {
|
||||
ordering = TransitionSet.ORDERING_SEQUENTIAL
|
||||
addTransition(ChangeBounds())
|
||||
addTransition(Fade(Fade.IN))
|
||||
duration = animationDuration
|
||||
addListener(object : SimpleTransitionListener() {
|
||||
override fun onTransitionEnd(transition: Transition) {
|
||||
transitionComplete?.invoke()
|
||||
}
|
||||
})
|
||||
}
|
||||
TransitionManager.beginDelayedTransition((parent as? ViewGroup ?: this), transition)
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:constraintSet="@layout/composer_rich_text_layout_constraint_set_compact"
|
||||
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
|
||||
|
||||
<!-- ========================
|
||||
/!\ Constraints for this layout are defined in external layout files that are used as constraint set for animation.
|
||||
/!\ These 3 files must be modified to stay coherent!
|
||||
======================== -->
|
||||
<View
|
||||
android:id="@+id/related_message_background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="?colorSurface"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<View
|
||||
android:id="@+id/related_message_background_top_separator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="?vctr_list_separator"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageAvatar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:importantForAccessibility="no"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/composerRelatedMessageTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:textStyle="bold"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:text="@tools:sample/first_names"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/composerRelatedMessageContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="3"
|
||||
android:textColor="?vctr_message_text_color"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:text="@tools:sample/lorem"
|
||||
tools:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageActionIcon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:importantForAccessibility="no"
|
||||
app:tint="?vctr_content_primary"
|
||||
tools:ignore="MissingConstraints,MissingPrefix" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageImage"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:importantForAccessibility="no"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/composerRelatedMessageCloseButton"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/action_cancel"
|
||||
android:src="@drawable/ic_close_round"
|
||||
app:tint="?colorError"
|
||||
tools:ignore="MissingConstraints,MissingPrefix" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/composer_preview_barrier"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:barrierDirection="bottom"
|
||||
app:barrierMargin="8dp"
|
||||
app:constraint_referenced_ids="composerRelatedMessageContent,composerRelatedMessageActionIcon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/attachmentButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/option_send_files"
|
||||
android:paddingTop="2dp"
|
||||
android:src="@drawable/ic_attachment"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/composerEditTextOuterBorder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_composer_rich_edit_text_single_line" />
|
||||
|
||||
<io.element.android.wysiwyg.EditorEditText
|
||||
android:id="@+id/richTextComposerEditText"
|
||||
style="@style/Widget.Vector.EditText.RichTextComposer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top"
|
||||
android:nextFocusLeft="@id/richTextComposerEditText"
|
||||
android:nextFocusUp="@id/richTextComposerEditText"
|
||||
tools:hint="@string/room_message_placeholder"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<!-- Use a separate EditText for plain text editing while the rich text editor doesn't support this mode -->
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/plainTextComposerEditText"
|
||||
style="@style/Widget.Vector.EditText.RichTextComposer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top"
|
||||
android:nextFocusLeft="@id/plainTextComposerEditText"
|
||||
android:nextFocusUp="@id/plainTextComposerEditText"
|
||||
tools:hint="@string/room_message_placeholder"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/composerFullScreenButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/rich_text_editor_full_screen_toggle"
|
||||
android:src="@drawable/ic_composer_full_screen"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintEnd_toEndOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintTop_toTopOf="@id/composerEditTextOuterBorder" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sendButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_send"
|
||||
android:contentDescription="@string/action_send"
|
||||
android:src="@drawable/ic_send"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/richTextMenuScrollView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/sendButton"
|
||||
app:layout_constraintStart_toEndOf="@id/attachmentButton"
|
||||
app:layout_constraintTop_toTopOf="@id/sendButton">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/richTextMenu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<!--
|
||||
<ImageButton
|
||||
android:id="@+id/voiceMessageMicButton"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/a11y_start_voice_message"
|
||||
android:src="@drawable/ic_voice_mic" />
|
||||
-->
|
||||
|
||||
</merge>
|
||||
@@ -0,0 +1,233 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/composerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<View
|
||||
android:id="@+id/related_message_background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="?colorSurface"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:layout_height="40dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/related_message_background_top_separator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="?vctr_list_separator"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageAvatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/composerRelatedMessageTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toTopOf="@id/composerRelatedMessageContent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:text="@tools:sample/first_names" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/composerRelatedMessageContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageActionIcon"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="38dp"
|
||||
android:alpha="0"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintEnd_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="parent"
|
||||
app:tint="?vctr_content_primary"
|
||||
tools:ignore="MissingConstraints,MissingPrefix"
|
||||
tools:src="@drawable/ic_edit" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageImage"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="parent"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:src="@tools:sample/backgrounds/scenic" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/composerRelatedMessageCloseButton"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/action_cancel"
|
||||
android:src="@drawable/ic_close_round"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="parent"
|
||||
app:tint="?colorError"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/composer_preview_barrier"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:barrierDirection="bottom"
|
||||
app:barrierMargin="8dp"
|
||||
app:constraint_referenced_ids="composerRelatedMessageContent,composerRelatedMessageActionIcon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/attachmentButton"
|
||||
android:layout_width="@dimen/composer_attachment_size"
|
||||
android:layout_height="@dimen/composer_attachment_size"
|
||||
android:layout_margin="@dimen/composer_attachment_margin"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/option_send_files"
|
||||
android:src="@drawable/ic_attachment"
|
||||
app:layout_constraintVertical_bias="1"
|
||||
app:layout_constraintBottom_toBottomOf="@id/sendButton"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/sendButton"
|
||||
app:layout_goneMarginBottom="57dp"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/composerEditTextOuterBorder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:minHeight="40dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:background="@drawable/bg_composer_rich_edit_text_single_line"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/sendButton"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<io.element.android.wysiwyg.EditorEditText
|
||||
android:id="@+id/richTextComposerEditText"
|
||||
style="@style/Widget.Vector.EditText.RichTextComposer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/room_message_placeholder"
|
||||
android:nextFocusLeft="@id/richTextComposerEditText"
|
||||
android:nextFocusUp="@id/richTextComposerEditText"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintEnd_toEndOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintStart_toStartOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintTop_toTopOf="@id/composerEditTextOuterBorder"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/plainTextComposerEditText"
|
||||
style="@style/Widget.Vector.EditText.RichTextComposer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/room_message_placeholder"
|
||||
android:nextFocusLeft="@id/plainTextComposerEditText"
|
||||
android:nextFocusUp="@id/plainTextComposerEditText"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintEnd_toStartOf="@id/composerFullScreenButton"
|
||||
app:layout_constraintStart_toStartOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintTop_toTopOf="@id/composerEditTextOuterBorder"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/composerFullScreenButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintEnd_toEndOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
android:src="@drawable/ic_composer_full_screen"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/rich_text_editor_full_screen_toggle" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sendButton"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="@dimen/composer_min_height"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:background="@drawable/bg_send"
|
||||
android:contentDescription="@string/action_send"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_send"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintVertical_bias="1"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<HorizontalScrollView android:id="@+id/richTextMenuScrollView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/sendButton"
|
||||
app:layout_constraintStart_toEndOf="@id/attachmentButton"
|
||||
app:layout_constraintEnd_toStartOf="@id/sendButton"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintVertical_bias="1"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/richTextMenu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<!--
|
||||
<ImageButton
|
||||
android:id="@+id/voiceMessageMicButton"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/a11y_start_voice_message"
|
||||
android:src="@drawable/ic_voice_mic"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,230 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/composerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<View
|
||||
android:id="@+id/related_message_background"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="?colorSurface"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composer_preview_barrier"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/related_message_background_top_separator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:background="?vctr_list_separator"
|
||||
app:layout_constraintEnd_toEndOf="@id/related_message_background"
|
||||
app:layout_constraintStart_toStartOf="@id/related_message_background"
|
||||
app:layout_constraintTop_toTopOf="@id/related_message_background" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageAvatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintBottom_toTopOf="@id/composerRelatedMessageActionIcon"
|
||||
app:layout_constraintEnd_toStartOf="@id/composerRelatedMessageTitle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/composerRelatedMessageTitle"
|
||||
tools:src="@sample/user_round_avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/composerRelatedMessageTitle"
|
||||
style="@style/Widget.Vector.TextView.Body"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@id/composerRelatedMessageCloseButton"
|
||||
app:layout_constraintStart_toEndOf="@id/composerRelatedMessageAvatar"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="@tools:sample/first_names" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageImage"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="66dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="@id/composerRelatedMessageTitle"
|
||||
app:layout_constraintTop_toBottomOf="@id/composerRelatedMessageTitle"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:src="@tools:sample/backgrounds/scenic"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/composerRelatedMessageContent"
|
||||
style="@style/Widget.Vector.TextView.Body"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:textColor="?vctr_message_text_color"
|
||||
app:layout_constrainedHeight="true"
|
||||
app:layout_constraintEnd_toEndOf="@id/composerRelatedMessageTitle"
|
||||
app:layout_constraintStart_toStartOf="@id/composerRelatedMessageTitle"
|
||||
app:layout_constraintTop_toBottomOf="@id/composerRelatedMessageImage"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageActionIcon"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="38dp"
|
||||
android:alpha="1"
|
||||
android:importantForAccessibility="no"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintEnd_toEndOf="@id/composerRelatedMessageAvatar"
|
||||
app:layout_constraintStart_toStartOf="@id/composerRelatedMessageAvatar"
|
||||
app:layout_constraintTop_toBottomOf="@id/composerRelatedMessageAvatar"
|
||||
app:tint="?vctr_content_primary"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:src="@drawable/ic_edit" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/composerRelatedMessageCloseButton"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/action_cancel"
|
||||
android:src="@drawable/ic_close_round"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composer_preview_barrier"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tint="?colorError"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/composer_preview_barrier"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:barrierDirection="bottom"
|
||||
app:barrierMargin="8dp"
|
||||
app:constraint_referenced_ids="composerRelatedMessageContent,composerRelatedMessageActionIcon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/attachmentButton"
|
||||
android:layout_width="@dimen/composer_attachment_size"
|
||||
android:layout_height="@dimen/composer_attachment_size"
|
||||
android:layout_margin="@dimen/composer_attachment_margin"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/option_send_files"
|
||||
android:src="@drawable/ic_attachment"
|
||||
app:layout_constraintBottom_toBottomOf="@id/sendButton"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/sendButton"
|
||||
app:layout_goneMarginBottom="57dp"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/composerEditTextOuterBorder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:minHeight="40dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="0dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:background="@drawable/bg_composer_rich_edit_text_single_line"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
app:layout_constraintTop_toBottomOf="@id/composer_preview_barrier"
|
||||
app:layout_constraintBottom_toTopOf="@id/sendButton"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<io.element.android.wysiwyg.EditorEditText
|
||||
android:id="@+id/richTextComposerEditText"
|
||||
style="@style/Widget.Vector.EditText.RichTextComposer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/room_message_placeholder"
|
||||
android:nextFocusLeft="@id/richTextComposerEditText"
|
||||
android:nextFocusUp="@id/richTextComposerEditText"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintEnd_toStartOf="@id/composerFullScreenButton"
|
||||
app:layout_constraintStart_toStartOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintTop_toTopOf="@id/composerEditTextOuterBorder"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/plainTextComposerEditText"
|
||||
style="@style/Widget.Vector.EditText.RichTextComposer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/room_message_placeholder"
|
||||
android:nextFocusLeft="@id/plainTextComposerEditText"
|
||||
android:nextFocusUp="@id/plainTextComposerEditText"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintEnd_toStartOf="@id/composerFullScreenButton"
|
||||
app:layout_constraintStart_toStartOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintTop_toTopOf="@id/composerEditTextOuterBorder"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/composerFullScreenButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintEnd_toEndOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
android:src="@drawable/ic_composer_full_screen"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/rich_text_editor_full_screen_toggle" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sendButton"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="@dimen/composer_min_height"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:background="@drawable/bg_send"
|
||||
android:contentDescription="@string/action_send"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_send"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintTop_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<HorizontalScrollView android:id="@+id/richTextMenuScrollView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/sendButton"
|
||||
app:layout_constraintStart_toEndOf="@id/attachmentButton"
|
||||
app:layout_constraintEnd_toStartOf="@id/sendButton"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/richTextMenu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,234 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/composerLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<View
|
||||
android:id="@+id/related_message_background"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="?colorSurface"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:layout_height="40dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/related_message_background_top_separator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="?vctr_list_separator"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageAvatar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/composerRelatedMessageTitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toTopOf="@id/composerRelatedMessageContent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:text="@tools:sample/first_names" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/composerRelatedMessageContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageActionIcon"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="38dp"
|
||||
android:alpha="0"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintEnd_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="parent"
|
||||
app:tint="?vctr_content_primary"
|
||||
tools:ignore="MissingConstraints,MissingPrefix"
|
||||
tools:src="@drawable/ic_edit" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/composerRelatedMessageImage"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:importantForAccessibility="no"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="parent"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:src="@tools:sample/backgrounds/scenic" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/composerRelatedMessageCloseButton"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/action_cancel"
|
||||
android:src="@drawable/ic_close_round"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="parent"
|
||||
app:tint="?colorError"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/composer_preview_barrier"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:barrierDirection="bottom"
|
||||
app:barrierMargin="8dp"
|
||||
app:constraint_referenced_ids="composerRelatedMessageContent,composerRelatedMessageActionIcon"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/attachmentButton"
|
||||
android:layout_width="@dimen/composer_attachment_size"
|
||||
android:layout_height="@dimen/composer_attachment_size"
|
||||
android:layout_margin="@dimen/composer_attachment_margin"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/option_send_files"
|
||||
android:src="@drawable/ic_attachment"
|
||||
app:layout_constraintBottom_toBottomOf="@id/sendButton"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/sendButton"
|
||||
app:layout_goneMarginBottom="57dp"
|
||||
app:layout_constraintVertical_bias="1"
|
||||
tools:ignore="MissingPrefix" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/composerEditTextOuterBorder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:minHeight="40dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:background="@drawable/bg_composer_rich_edit_text_expanded"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/sendButton"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<io.element.android.wysiwyg.EditorEditText
|
||||
android:id="@+id/richTextComposerEditText"
|
||||
style="@style/Widget.Vector.EditText.RichTextComposer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:hint="@string/room_message_placeholder"
|
||||
android:nextFocusLeft="@id/richTextComposerEditText"
|
||||
android:nextFocusUp="@id/richTextComposerEditText"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:gravity="top"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintEnd_toStartOf="@id/composerFullScreenButton"
|
||||
app:layout_constraintStart_toStartOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintTop_toTopOf="@id/composerEditTextOuterBorder"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/plainTextComposerEditText"
|
||||
style="@style/Widget.Vector.EditText.RichTextComposer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:hint="@string/room_message_placeholder"
|
||||
android:nextFocusLeft="@id/plainTextComposerEditText"
|
||||
android:nextFocusUp="@id/plainTextComposerEditText"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:gravity="top"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintEnd_toStartOf="@id/composerFullScreenButton"
|
||||
app:layout_constraintStart_toStartOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintTop_toTopOf="@id/composerEditTextOuterBorder"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/composerFullScreenButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintEnd_toEndOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintBottom_toBottomOf="@id/composerEditTextOuterBorder"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
android:src="@drawable/ic_composer_full_screen"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/rich_text_editor_full_screen_toggle" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sendButton"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="@dimen/composer_min_height"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:background="@drawable/bg_send"
|
||||
android:contentDescription="@string/action_send"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_send"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintVertical_bias="1"
|
||||
tools:ignore="MissingPrefix"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<HorizontalScrollView android:id="@+id/richTextMenuScrollView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/sendButton"
|
||||
app:layout_constraintStart_toEndOf="@id/attachmentButton"
|
||||
app:layout_constraintEnd_toStartOf="@id/sendButton"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintVertical_bias="1"
|
||||
android:fillViewport="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/richTextMenu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<!--
|
||||
<ImageButton
|
||||
android:id="@+id/voiceMessageMicButton"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:contentDescription="@string/a11y_start_voice_message"
|
||||
android:src="@drawable/ic_voice_mic"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginHorizontal="2dp"
|
||||
android:background="@drawable/bg_rich_text_menu_button"
|
||||
app:tint="@color/selector_rich_text_menu_icon"
|
||||
tools:src="@drawable/ic_composer_bold"
|
||||
tools:ignore="ContentDescription" />
|
||||
@@ -20,6 +20,8 @@ rootProject.name = "ElementX"
|
||||
include(":app")
|
||||
include(":libraries:core")
|
||||
include(":libraries:matrix")
|
||||
include(":libraries:textcomposer")
|
||||
include(":libraries:elementresources")
|
||||
include(":features:login")
|
||||
include(":features:roomlist")
|
||||
include(":features:messages")
|
||||
|
||||
Reference in New Issue
Block a user