feat: swipe to reply spark (not used yet)
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
7c9b9addc6
commit
47d4ecd0a6
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,74 @@
|
|||
package chat.revolt.sheets.spark
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import chat.revolt.R
|
||||
import chat.revolt.components.vectorassets.SwipeToReplySpark
|
||||
|
||||
@Composable
|
||||
fun SwipeToReplySparkSheet(
|
||||
onDismissSheet: () -> Unit = {},
|
||||
onOpenOptions: () -> Unit = {},
|
||||
) {
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Image(SwipeToReplySpark, contentDescription = null)
|
||||
|
||||
Spacer(Modifier) // Counts towards the vertical arrangement
|
||||
|
||||
Text(
|
||||
text = stringResource(R.string.spark_swipe_to_reply),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
)
|
||||
|
||||
Text(
|
||||
text = stringResource(R.string.spark_swipe_to_reply_description),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
Button(
|
||||
onClick = onDismissSheet,
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
Text(stringResource(R.string.spark_swipe_to_reply_cta))
|
||||
}
|
||||
TextButton(
|
||||
onClick = onOpenOptions,
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
Text(stringResource(R.string.spark_swipe_to_reply_customise))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
private fun SwipeToReplySparkSheetPreview() {
|
||||
Box(Modifier.padding(16.dp)) {
|
||||
SwipeToReplySparkSheet()
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue