kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
refactor: migrate `ShareFragment` to Compose
rodzic
04d94a6eb1
commit
0b92ff6441
|
@ -173,7 +173,8 @@ private fun MainAppBar(
|
|||
TopAppBar(
|
||||
title = {
|
||||
when {
|
||||
currentDestination == null || isTopLevelRoute -> {
|
||||
currentDestination == null || isTopLevelRoute ||
|
||||
currentDestination.hasRoute<Route.Messages>() -> {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Icon(
|
||||
imageVector = ImageVector.vectorResource(id = R.drawable.app_icon),
|
||||
|
@ -192,6 +193,9 @@ private fun MainAppBar(
|
|||
currentDestination.hasRoute<Route.QuickChat>() ->
|
||||
Text(stringResource(id = R.string.quick_chat))
|
||||
|
||||
currentDestination.hasRoute<Route.Share>() ->
|
||||
Text(stringResource(id = R.string.share_to))
|
||||
|
||||
else -> Text("Node name here") // TODO show destNode longName
|
||||
}
|
||||
},
|
||||
|
|
|
@ -111,6 +111,8 @@ sealed interface Route {
|
|||
@Serializable
|
||||
data class Messages(val contactKey: String, val message: String = "") : Route
|
||||
@Serializable data object QuickChat : Route
|
||||
@Serializable
|
||||
data class Share(val message: String) : Route
|
||||
|
||||
@Serializable
|
||||
data class RadioConfig(val destNum: Int? = null) : Route
|
||||
|
@ -386,5 +388,13 @@ fun NavGraph(
|
|||
val parentEntry = remember { navController.getBackStackEntry<Route.RadioConfig>() }
|
||||
PaxcounterConfigScreen(hiltViewModel<RadioConfigViewModel>(parentEntry))
|
||||
}
|
||||
composable<Route.Share> { backStackEntry ->
|
||||
val message = backStackEntry.toRoute<Route.Share>().message
|
||||
ShareScreen(model) {
|
||||
navController.navigate(Route.Messages(it, message)) {
|
||||
popUpTo<Route.Share> { inclusive = true }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,116 +17,104 @@
|
|||
|
||||
package com.geeksville.mesh.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material.Button
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.Send
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.tooling.preview.PreviewScreenSizes
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import com.geeksville.mesh.android.Logging
|
||||
import com.geeksville.mesh.databinding.ShareFragmentBinding
|
||||
import com.geeksville.mesh.R
|
||||
import com.geeksville.mesh.model.Contact
|
||||
import com.geeksville.mesh.model.UIViewModel
|
||||
import com.geeksville.mesh.ui.theme.AppTheme
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@AndroidEntryPoint
|
||||
class ShareFragment : ScreenFragment("Messages"), Logging {
|
||||
@Composable
|
||||
fun ShareScreen(
|
||||
viewModel: UIViewModel = hiltViewModel(),
|
||||
onConfirm: (String) -> Unit
|
||||
) {
|
||||
val contactList by viewModel.contactList.collectAsStateWithLifecycle()
|
||||
|
||||
private val model: UIViewModel by activityViewModels()
|
||||
private var _binding: ShareFragmentBinding? = null
|
||||
|
||||
// This property is only valid between onCreateView and onDestroyView.
|
||||
private val binding get() = _binding!!
|
||||
|
||||
private val contacts get() = model.contactList.value
|
||||
private var selectedContact = mutableStateOf("")
|
||||
|
||||
private fun shareMessage(contact: Contact) {
|
||||
debug("calling MessagesFragment filter:${contact.contactKey}")
|
||||
// parentFragmentManager.navigateToMessages(
|
||||
// contact.contactKey,
|
||||
// arguments?.getString("message").toString()
|
||||
// )
|
||||
}
|
||||
|
||||
private fun onClick(contact: Contact) {
|
||||
if (selectedContact.value == contact.contactKey) {
|
||||
selectedContact.value = ""
|
||||
binding.shareButton.isEnabled = false
|
||||
} else {
|
||||
selectedContact.value = contact.contactKey
|
||||
binding.shareButton.isEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = ShareFragmentBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
@Suppress("LongMethod", "CyclomaticComplexMethod")
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
binding.toolbar.setNavigationOnClickListener {
|
||||
parentFragmentManager.popBackStack()
|
||||
}
|
||||
|
||||
binding.shareButton.isEnabled = false
|
||||
|
||||
binding.shareButton.setOnClickListener {
|
||||
debug("User clicked shareButton")
|
||||
val contact = contacts.find { c -> c.contactKey == selectedContact.value }
|
||||
if (contact != null) {
|
||||
shareMessage(contact)
|
||||
}
|
||||
}
|
||||
|
||||
binding.contactListView.setContent {
|
||||
val contacts by model.contactList.collectAsStateWithLifecycle()
|
||||
AppTheme {
|
||||
ShareContactListView(
|
||||
contacts = contacts,
|
||||
selectedContact = selectedContact.value,
|
||||
onClick = ::onClick,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
ShareScreen(
|
||||
contacts = contactList,
|
||||
onConfirm = onConfirm,
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ShareContactListView(
|
||||
fun ShareScreen(
|
||||
contacts: List<Contact>,
|
||||
selectedContact: String,
|
||||
onClick: (Contact) -> Unit,
|
||||
onConfirm: (String) -> Unit
|
||||
) {
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.fillMaxSize(),
|
||||
contentPadding = PaddingValues(6.dp),
|
||||
) {
|
||||
items(contacts, key = { it.contactKey }) { contact ->
|
||||
val selected = contact.contactKey == selectedContact
|
||||
ContactItem(
|
||||
contact = contact,
|
||||
selected = selected,
|
||||
onClick = { onClick(contact) },
|
||||
onLongClick = {},
|
||||
var selectedContact by remember { mutableStateOf("") }
|
||||
|
||||
Column {
|
||||
LazyColumn(
|
||||
modifier = Modifier.weight(1f),
|
||||
contentPadding = PaddingValues(6.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
items(contacts, key = { it.contactKey }) { contact ->
|
||||
val selected = contact.contactKey == selectedContact
|
||||
ContactItem(
|
||||
contact = contact,
|
||||
selected = selected,
|
||||
onClick = { selectedContact = contact.contactKey },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Button(
|
||||
onClick = {
|
||||
onConfirm(selectedContact)
|
||||
},
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(24.dp),
|
||||
enabled = selectedContact.isNotEmpty(),
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Default.Send,
|
||||
contentDescription = stringResource(id = R.string.share)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@PreviewScreenSizes
|
||||
@Composable
|
||||
private fun ShareScreenPreview() {
|
||||
AppTheme {
|
||||
ShareScreen(
|
||||
contacts = listOf(
|
||||
Contact(
|
||||
contactKey = "0^all",
|
||||
shortName = stringResource(R.string.some_username),
|
||||
longName = stringResource(R.string.unknown_username),
|
||||
lastMessageTime = "3 minutes ago",
|
||||
lastMessageText = stringResource(R.string.sample_message),
|
||||
unreadCount = 2,
|
||||
messageCount = 10,
|
||||
isMuted = true,
|
||||
),
|
||||
),
|
||||
onConfirm = {},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M22,15c0,-1.66 -1.34,-3 -3,-3h-1.5v-0.5C17.5,8.46 15.04,6 12,6c-0.77,0 -1.49,0.17 -2.16,0.46L20.79,17.4c0.73,-0.55 1.21,-1.41 1.21,-2.4zM2,14c0,2.21 1.79,4 4,4h9.73l-8,-8H6c-2.21,0 -4,1.79 -4,4z"
|
||||
android:fillAlpha=".3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.35,10.04C18.67,6.59 15.64,4 12,4c-1.33,0 -2.57,0.36 -3.65,0.97l1.49,1.49C10.51,6.17 11.23,6 12,6c3.04,0 5.5,2.46 5.5,5.5v0.5H19c1.66,0 3,1.34 3,3 0,0.99 -0.48,1.85 -1.21,2.4l1.41,1.41c1.09,-0.92 1.8,-2.27 1.8,-3.81 0,-2.64 -2.05,-4.78 -4.65,-4.96zM3,5.27l2.77,2.77h-0.42C2.34,8.36 0,10.91 0,14c0,3.31 2.69,6 6,6h11.73l2,2 1.41,-1.41L4.41,3.86 3,5.27zM7.73,10l8,8H6c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4h1.73z"/>
|
||||
</vector>
|
|
@ -1,14 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.21,12.04l-1.53,-0.11 -0.3,-1.5C16.88,7.86 14.62,6 12,6 9.94,6 8.08,7.14 7.12,8.96l-0.5,0.95 -1.07,0.11C3.53,10.24 2,11.95 2,14c0,2.21 1.79,4 4,4h13c1.65,0 3,-1.35 3,-3 0,-1.55 -1.22,-2.86 -2.79,-2.96zM10,17l-3.5,-3.5 1.41,-1.41L10,14.18l4.6,-4.6 1.41,1.41L10,17z"
|
||||
android:fillAlpha=".3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.35,10.04C18.67,6.59 15.64,4 12,4 9.11,4 6.6,5.64 5.35,8.04 2.34,8.36 0,10.91 0,14c0,3.31 2.69,6 6,6h13c2.76,0 5,-2.24 5,-5 0,-2.64 -2.05,-4.78 -4.65,-4.96zM19,18L6,18c-2.21,0 -4,-1.79 -4,-4 0,-2.05 1.53,-3.76 3.56,-3.97l1.07,-0.11 0.5,-0.95C8.08,7.14 9.94,6 12,6c2.62,0 4.88,1.86 5.39,4.43l0.3,1.5 1.53,0.11c1.56,0.1 2.78,1.41 2.78,2.96 0,1.65 -1.35,3 -3,3zM10,14.18l-2.09,-2.09L6.5,13.5 10,17l6.01,-6.01 -1.41,-1.41z"/>
|
||||
</vector>
|
|
@ -1,15 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.21,12.04l-1.53,-0.11 -0.3,-1.5C16.88,7.86 14.62,6 12,6 9.94,6 8.08,7.14 7.12,8.96l-0.5,0.95 -1.07,0.11C3.53,10.24 2,11.95 2,14c0,2.21 1.79,4 4,4h13c1.65,0 3,-1.35 3,-3 0,-1.55 -1.22,-2.86 -2.79,-2.96zM13.45,13v3h-2.91v-3L8,13l4,-4 4,4h-2.55z"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillAlpha="0.3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.35,10.04C18.67,6.59 15.64,4 12,4 9.11,4 6.6,5.64 5.35,8.04 2.34,8.36 0,10.91 0,14c0,3.31 2.69,6 6,6h13c2.76,0 5,-2.24 5,-5 0,-2.64 -2.05,-4.78 -4.65,-4.96zM19,18H6c-2.21,0 -4,-1.79 -4,-4 0,-2.05 1.53,-3.76 3.56,-3.97l1.07,-0.11 0.5,-0.95C8.08,7.14 9.94,6 12,6c2.62,0 4.88,1.86 5.39,4.43l0.3,1.5 1.53,0.11c1.56,0.1 2.78,1.41 2.78,2.96 0,1.65 -1.35,3 -3,3zM8,13h2.55v3h2.9v-3H16l-4,-4z"/>
|
||||
</vector>
|
|
@ -1,25 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,4c-4.42,0 -8,3.58 -8,8s3.58,8 8,8s8,-3.58 8,-8S16.42,4 12,4zM8.46,14.45L7.1,13.83c0.28,-0.61 0.41,-1.24 0.4,-1.86c-0.01,-0.63 -0.14,-1.24 -0.4,-1.8l1.36,-0.63c0.35,0.75 0.53,1.56 0.54,2.4C9.01,12.8 8.83,13.64 8.46,14.45zM11.53,16.01l-1.3,-0.74c0.52,-0.92 0.78,-1.98 0.78,-3.15c0,-1.19 -0.27,-2.33 -0.8,-3.4l1.34,-0.67c0.64,1.28 0.96,2.65 0.96,4.07C12.51,13.55 12.18,14.86 11.53,16.01zM14.67,17.33l-1.35,-0.66c0.78,-1.6 1.18,-3.18 1.18,-4.69c0,-1.51 -0.4,-3.07 -1.18,-4.64l1.34,-0.67C15.56,8.45 16,10.23 16,11.98C16,13.72 15.56,15.52 14.67,17.33z"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillAlpha="0.3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12c0,5.52 4.48,10 10,10s10,-4.48 10,-10C22,6.48 17.52,2 12,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8s8,3.58 8,8S16.42,20 12,20z"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M7.1,10.18c0.26,0.56 0.39,1.16 0.4,1.8c0.01,0.63 -0.13,1.25 -0.4,1.86l1.37,0.62c0.37,-0.81 0.55,-1.65 0.54,-2.5c-0.01,-0.84 -0.19,-1.65 -0.54,-2.4L7.1,10.18z"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M13.33,7.33c0.78,1.57 1.18,3.14 1.18,4.64c0,1.51 -0.4,3.09 -1.18,4.69l1.35,0.66c0.88,-1.81 1.33,-3.61 1.33,-5.35c0,-1.74 -0.45,-3.53 -1.33,-5.31L13.33,7.33z"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M10.2,8.72c0.53,1.07 0.8,2.21 0.8,3.4c0,1.17 -0.26,2.23 -0.78,3.15l1.3,0.74c0.65,-1.15 0.98,-2.45 0.98,-3.89c0,-1.42 -0.32,-2.79 -0.96,-4.07L10.2,8.72z"/>
|
||||
</vector>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M5,18.31l3,-1.16L8,5.45L5,6.46zM16,18.55l3,-1.01L19,5.69l-3,1.17z"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillAlpha="0.3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20.5,3l-0.16,0.03L15,5.1 9,3 3.36,4.9c-0.21,0.07 -0.36,0.25 -0.36,0.48L3,20.5c0,0.28 0.22,0.5 0.5,0.5l0.16,-0.03L9,18.9l6,2.1 5.64,-1.9c0.21,-0.07 0.36,-0.25 0.36,-0.48L21,3.5c0,-0.28 -0.22,-0.5 -0.5,-0.5zM8,17.15l-3,1.16L5,6.46l3,-1.01v11.7zM14,18.53l-4,-1.4L10,5.47l4,1.4v11.66zM19,17.54l-3,1.01L16,6.86l3,-1.16v11.84z"/>
|
||||
</vector>
|
|
@ -1,14 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,4L4,4v13.17L5.17,16L20,16L20,4zM18,14L6,14v-2h12v2zM18,11L6,11L6,9h12v2zM18,8L6,8L6,6h12v2z"
|
||||
android:fillAlpha=".3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M20,18c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14zM4,17.17L4,4h16v12L5.17,16L4,17.17zM6,12h12v2L6,14zM6,9h12v2L6,11zM6,6h12v2L6,8z"/>
|
||||
</vector>
|
|
@ -1,18 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M9,8.5m-1.5,0a1.5,1.5 0,1 1,3 0a1.5,1.5 0,1 1,-3 0"
|
||||
android:fillAlpha=".3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M4.34,17h9.32c-0.84,-0.58 -2.87,-1.25 -4.66,-1.25s-3.82,0.67 -4.66,1.25z"
|
||||
android:fillAlpha=".3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M9,12c1.93,0 3.5,-1.57 3.5,-3.5S10.93,5 9,5 5.5,6.57 5.5,8.5 7.07,12 9,12zM9,7c0.83,0 1.5,0.67 1.5,1.5S9.83,10 9,10s-1.5,-0.67 -1.5,-1.5S8.17,7 9,7zM9,13.75c-2.34,0 -7,1.17 -7,3.5L2,19h14v-1.75c0,-2.33 -4.66,-3.5 -7,-3.5zM4.34,17c0.84,-0.58 2.87,-1.25 4.66,-1.25s3.82,0.67 4.66,1.25L4.34,17zM16.04,13.81c1.16,0.84 1.96,1.96 1.96,3.44L18,19h4v-1.75c0,-2.02 -3.5,-3.17 -5.96,-3.44zM15,12c1.93,0 3.5,-1.57 3.5,-3.5S16.93,5 15,5c-0.54,0 -1.04,0.13 -1.5,0.35 0.63,0.89 1,1.98 1,3.15s-0.37,2.26 -1,3.15c0.46,0.22 0.96,0.35 1.5,0.35z"/>
|
||||
</vector>
|
|
@ -1,16 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:autoMirrored="true">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M4,8.25l7.51,1 -7.5,-3.22zM4.01,17.97l7.5,-3.22 -7.51,1z"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillAlpha="0.3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M2.01,3L2,10l15,2 -15,2 0.01,7L23,12 2.01,3zM4,8.25L4,6.03l7.51,3.22 -7.51,-1zM4.01,17.97v-2.22l7.51,-1 -7.51,3.22z"/>
|
||||
</vector>
|
|
@ -1,14 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M5,19h14L19,5L5,5v14zM7.5,12c0,-0.2 0.02,-0.39 0.04,-0.58l-1.27,-0.99c-0.11,-0.09 -0.15,-0.26 -0.07,-0.39l1.2,-2.07c0.08,-0.13 0.23,-0.18 0.37,-0.13l1.49,0.6c0.31,-0.25 0.66,-0.44 1.02,-0.6l0.22,-1.59c0.03,-0.14 0.15,-0.25 0.3,-0.25h2.4c0.15,0 0.27,0.11 0.3,0.25l0.22,1.59c0.37,0.15 0.7,0.35 1.01,0.59l1.49,-0.6c0.14,-0.05 0.29,0 0.37,0.13l1.2,2.07c0.08,0.13 0.04,0.29 -0.07,0.39l-1.27,0.99c0.03,0.2 0.04,0.39 0.04,0.59 0,0.2 -0.02,0.39 -0.04,0.58l1.27,0.99c0.11,0.09 0.15,0.26 0.07,0.39l-1.2,2.07c-0.08,0.13 -0.23,0.18 -0.37,0.13l-1.49,-0.6c-0.31,0.24 -0.65,0.44 -1.01,0.59l-0.22,1.59c-0.03,0.15 -0.15,0.26 -0.3,0.26h-2.4c-0.15,0 -0.27,-0.11 -0.3,-0.25l-0.22,-1.59c-0.37,-0.15 -0.7,-0.35 -1.01,-0.59l-1.49,0.6c-0.14,0.05 -0.29,0 -0.37,-0.13l-1.2,-2.07c-0.08,-0.13 -0.04,-0.29 0.07,-0.39l1.27,-0.99c-0.03,-0.2 -0.05,-0.39 -0.05,-0.59z"
|
||||
android:fillAlpha=".3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M6.21,13.97l1.2,2.07c0.08,0.13 0.23,0.18 0.37,0.13l1.49,-0.6c0.31,0.24 0.64,0.44 1.01,0.59l0.22,1.59c0.03,0.14 0.15,0.25 0.3,0.25h2.4c0.15,0 0.27,-0.11 0.3,-0.26l0.22,-1.59c0.36,-0.15 0.7,-0.35 1.01,-0.59l1.49,0.6c0.14,0.05 0.29,0 0.37,-0.13l1.2,-2.07c0.08,-0.13 0.04,-0.29 -0.07,-0.39l-1.27,-0.99c0.03,-0.19 0.04,-0.39 0.04,-0.58 0,-0.2 -0.02,-0.39 -0.04,-0.59l1.27,-0.99c0.11,-0.09 0.15,-0.26 0.07,-0.39l-1.2,-2.07c-0.08,-0.13 -0.23,-0.18 -0.37,-0.13l-1.49,0.6c-0.31,-0.24 -0.64,-0.44 -1.01,-0.59l-0.22,-1.59c-0.03,-0.14 -0.15,-0.25 -0.3,-0.25h-2.4c-0.15,0 -0.27,0.11 -0.3,0.26l-0.22,1.59c-0.36,0.15 -0.71,0.34 -1.01,0.58l-1.49,-0.6c-0.14,-0.05 -0.29,0 -0.37,0.13l-1.2,2.07c-0.08,0.13 -0.04,0.29 0.07,0.39l1.27,0.99c-0.03,0.2 -0.05,0.39 -0.05,0.59 0,0.2 0.02,0.39 0.04,0.59l-1.27,0.99c-0.11,0.1 -0.14,0.26 -0.06,0.39zM12,10.29c0.94,0 1.71,0.77 1.71,1.71s-0.77,1.71 -1.71,1.71 -1.71,-0.77 -1.71,-1.71 0.77,-1.71 1.71,-1.71zM19,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.11,0 2,-0.9 2,-2L21,5c0,-1.1 -0.89,-2 -2,-2zM19,19L5,19L5,5h14v14z"/>
|
||||
</vector>
|
|
@ -1,63 +0,0 @@
|
|||
<?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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/colorAdvancedBackground">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/MyToolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/toolbarBackground"
|
||||
android:title="@string/share_to"
|
||||
app:title="@string/share_to"
|
||||
app:layout_constraintHeight_min="?attr/actionBarSize"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:navigationIcon="?android:attr/homeAsUpIndicator"
|
||||
app:titleMargin="4dp" />
|
||||
|
||||
<androidx.compose.ui.platform.ComposeView
|
||||
android:id="@+id/contactListView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="8dp"
|
||||
android:contentDescription="@string/text_messages"
|
||||
app:layout_constraintBottom_toTopOf="@+id/quickChatView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/toolbar">
|
||||
|
||||
</androidx.compose.ui.platform.ComposeView>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/quickChatView"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/shareButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/quickChatLayout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal" />
|
||||
</HorizontalScrollView>
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/shareButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:contentDescription="@string/share_message"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:srcCompat="@drawable/ic_twotone_send_24" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Ładowanie…
Reference in New Issue