mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-15 07:28:30 +00:00
Add media send feature module.
This commit is contained in:
@@ -13,6 +13,7 @@ import androidx.compose.material3.ripple
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.layout.layout
|
||||
import androidx.compose.ui.res.dimensionResource
|
||||
import androidx.compose.ui.semantics.Role
|
||||
import androidx.compose.ui.semantics.contentDescription
|
||||
@@ -60,3 +61,13 @@ fun Modifier.clickableContainer(
|
||||
Modifier
|
||||
}
|
||||
)
|
||||
|
||||
fun Modifier.ensureWidthIsAtLeastHeight(): Modifier {
|
||||
return this.layout { measurable, constraints ->
|
||||
val placeable = measurable.measure(constraints)
|
||||
val size = maxOf(placeable.width, placeable.height)
|
||||
layout(size, size) {
|
||||
placeable.placeRelative((size - placeable.width) / 2, (size - placeable.height) / 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,10 +15,13 @@ import androidx.compose.material3.SheetValue
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||
import androidx.compose.ui.unit.LayoutDirection
|
||||
import org.signal.core.ui.compose.theme.SignalTheme
|
||||
import kotlin.random.Random
|
||||
|
||||
object Previews {
|
||||
/**
|
||||
@@ -88,4 +91,11 @@ object Previews {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun rememberRandomColor(): Color {
|
||||
return remember {
|
||||
Color(Random.nextFloat(), Random.nextFloat(), Random.nextFloat(), 1f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.signal.core.ui.R
|
||||
*/
|
||||
enum class SignalIcons(private val icon: SignalIcon) : SignalIcon by icon {
|
||||
ArrowStart(icon(R.drawable.symbol_arrow_start_24)),
|
||||
ArrowEnd(icon(R.drawable.symbol_arrow_end_24)),
|
||||
At(icon(R.drawable.symbol_at_24)),
|
||||
Backup(icon(R.drawable.symbol_backup_24)),
|
||||
Camera(icon(R.drawable.symbol_camera_24)),
|
||||
@@ -40,6 +41,7 @@ enum class SignalIcons(private val icon: SignalIcon) : SignalIcon by icon {
|
||||
ChevronRight(icon(R.drawable.symbol_chevron_right_24)),
|
||||
Copy(icon(R.drawable.symbol_copy_android_24)),
|
||||
Edit(icon(R.drawable.symbol_edit_24)),
|
||||
Emoji(icon(R.drawable.symbol_emoji_24)),
|
||||
ErrorCircle(icon(R.drawable.symbol_error_circle_fill_24)),
|
||||
FlashAuto(icon(R.drawable.symbol_flash_auto_24)),
|
||||
FlashOff(icon(R.drawable.symbol_flash_slash_24)),
|
||||
|
||||
10
core/ui/src/main/res/drawable/symbol_arrow_end_24.xml
Normal file
10
core/ui/src/main/res/drawable/symbol_arrow_end_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M20.13 12c0 0.23-0.1 0.45-0.26 0.62l-6.5 6.5c-0.34 0.34-0.9 0.34-1.24 0-0.34-0.34-0.34-0.9 0-1.24l5.13-5.13-1.76 0.13H4.25c-0.48 0-0.88-0.4-0.88-0.88s0.4-0.88 0.88-0.88H15.5l1.76 0.13-5.13-5.13c-0.34-0.34-0.34-0.9 0-1.24 0.34-0.34 0.9-0.34 1.24 0l6.5 6.5c0.16 0.17 0.25 0.39 0.25 0.62Z" />
|
||||
</vector>
|
||||
18
core/ui/src/main/res/drawable/symbol_emoji_24.xml
Normal file
18
core/ui/src/main/res/drawable/symbol_emoji_24.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M8.43 14.94c-0.3-0.37-0.86-0.42-1.23-0.11-0.37 0.3-0.43 0.85-0.12 1.23 1.17 1.41 2.94 2.32 4.92 2.32s3.75-0.9 4.92-2.32c0.3-0.38 0.25-0.93-0.12-1.23-0.37-0.31-0.92-0.26-1.23 0.11-0.85 1.03-2.13 1.69-3.57 1.69s-2.72-0.66-3.57-1.69Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M15.25 7.75c-0.5 0-0.88 0.3-1.12 0.66-0.25 0.37-0.38 0.84-0.38 1.34 0 0.5 0.13 0.97 0.38 1.34 0.24 0.36 0.62 0.66 1.12 0.66 0.5 0 0.88-0.3 1.12-0.66 0.25-0.37 0.38-0.84 0.38-1.34 0-0.5-0.13-0.97-0.38-1.34-0.24-0.36-0.62-0.66-1.12-0.66Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M7.63 8.41c0.24-0.36 0.62-0.66 1.12-0.66 0.5 0 0.88 0.3 1.12 0.66 0.25 0.37 0.38 0.84 0.38 1.34 0 0.5-0.13 0.97-0.38 1.34-0.24 0.36-0.62 0.66-1.12 0.66-0.5 0-0.88-0.3-1.12-0.66-0.25-0.37-0.38-0.84-0.38-1.34 0-0.5 0.13-0.97 0.38-1.34Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12 1.13C6 1.13 1.12 5.99 1.12 12 1.13 18 6 22.88 12 22.88c6 0 10.88-4.87 10.88-10.88C22.88 6 18 1.12 12 1.12ZM2.87 12c0-5.04 4.09-9.13 9.13-9.13 5.04 0 9.13 4.09 9.13 9.13 0 5.04-4.09 9.13-9.13 9.13-5.04 0-9.13-4.09-9.13-9.13Z"/>
|
||||
</vector>
|
||||
Reference in New Issue
Block a user