mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 18:45:19 +00:00
Adding the ability to copy in message details
Cleaning up icons
This commit is contained in:
parent
2704bc717d
commit
4aa68c9f49
@ -117,6 +117,7 @@ import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companio
|
||||
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.ON_DELETE
|
||||
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.ON_REPLY
|
||||
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.ON_RESEND
|
||||
import org.thoughtcrime.securesms.conversation.v2.MessageDetailActivity.Companion.ON_COPY
|
||||
import org.thoughtcrime.securesms.conversation.v2.dialogs.BlockedDialog
|
||||
import org.thoughtcrime.securesms.conversation.v2.dialogs.LinkPreviewDialog
|
||||
import org.thoughtcrime.securesms.conversation.v2.input_bar.InputBarButton
|
||||
@ -2204,6 +2205,7 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
||||
ON_REPLY -> reply(set)
|
||||
ON_RESEND -> resendMessage(set)
|
||||
ON_DELETE -> deleteMessages(set)
|
||||
ON_COPY -> copyMessages(set)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -95,6 +95,7 @@ class MessageDetailActivity : PassphraseRequiredActionBarActivity() {
|
||||
const val ON_REPLY = 1
|
||||
const val ON_RESEND = 2
|
||||
const val ON_DELETE = 3
|
||||
const val ON_COPY = 4
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?, ready: Boolean) {
|
||||
@ -126,6 +127,7 @@ class MessageDetailActivity : PassphraseRequiredActionBarActivity() {
|
||||
onReply = if (state.canReply) { { setResultAndFinish(ON_REPLY) } } else null,
|
||||
onResend = state.error?.let { { setResultAndFinish(ON_RESEND) } },
|
||||
onDelete = { setResultAndFinish(ON_DELETE) },
|
||||
onCopy = { setResultAndFinish(ON_COPY) },
|
||||
onClickImage = { viewModel.onClickImage(it) },
|
||||
onAttachmentNeedsDownload = viewModel::onAttachmentNeedsDownload,
|
||||
)
|
||||
@ -147,6 +149,7 @@ fun MessageDetails(
|
||||
onReply: (() -> Unit)? = null,
|
||||
onResend: (() -> Unit)? = null,
|
||||
onDelete: () -> Unit = {},
|
||||
onCopy: () -> Unit = {},
|
||||
onClickImage: (Int) -> Unit = {},
|
||||
onAttachmentNeedsDownload: (DatabaseAttachment) -> Unit = { _ -> }
|
||||
) {
|
||||
@ -183,6 +186,7 @@ fun MessageDetails(
|
||||
onReply,
|
||||
onResend,
|
||||
onDelete,
|
||||
onCopy
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -218,7 +222,8 @@ fun CellMetadata(
|
||||
fun CellButtons(
|
||||
onReply: (() -> Unit)? = null,
|
||||
onResend: (() -> Unit)? = null,
|
||||
onDelete: () -> Unit = {},
|
||||
onDelete: () -> Unit,
|
||||
onCopy: () -> Unit
|
||||
) {
|
||||
Cell(modifier = Modifier.padding(horizontal = LocalDimensions.current.spacing)) {
|
||||
Column {
|
||||
@ -230,6 +235,14 @@ fun CellButtons(
|
||||
)
|
||||
Divider()
|
||||
}
|
||||
|
||||
LargeItemButton(
|
||||
R.string.copy,
|
||||
R.drawable.ic_copy,
|
||||
onClick = onCopy
|
||||
)
|
||||
Divider()
|
||||
|
||||
onResend?.let {
|
||||
LargeItemButton(
|
||||
R.string.resend,
|
||||
@ -238,6 +251,7 @@ fun CellButtons(
|
||||
)
|
||||
Divider()
|
||||
}
|
||||
|
||||
LargeItemButton(
|
||||
R.string.delete,
|
||||
R.drawable.ic_delete,
|
||||
@ -319,6 +333,20 @@ fun ExpandButton(modifier: Modifier = Modifier, onClick: () -> Unit) {
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
fun PreviewMessageDetailsButtons(
|
||||
@PreviewParameter(SessionColorsParameterProvider::class) colors: ThemeColors
|
||||
) {
|
||||
PreviewTheme(colors) {
|
||||
CellButtons(
|
||||
onReply = {},
|
||||
onResend = {},
|
||||
onDelete = {},
|
||||
onCopy = {}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 233 B |
Binary file not shown.
Before Width: | Height: | Size: 152 B |
Binary file not shown.
Before Width: | Height: | Size: 230 B |
Binary file not shown.
Before Width: | Height: | Size: 354 B |
Binary file not shown.
Before Width: | Height: | Size: 457 B |
@ -1,10 +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="M16,1L4,1c-1.1,0 -2,0.9 -2,2v14h2L4,3h12L16,1zM15,5l6,6v10c0,1.1 -0.9,2 -2,2L7.99,23C6.89,23 6,22.1 6,21l0.01,-14c0,-1.1 0.89,-2 1.99,-2h7zM14,12h5.5L14,6.5L14,12z"/>
|
||||
</vector>
|
12
app/src/main/res/drawable/ic_copy.xml
Normal file
12
app/src/main/res/drawable/ic_copy.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="50"
|
||||
android:viewportHeight="50">
|
||||
<path
|
||||
android:pathData="M14.295,11.247H18.146V6.687C18.146,4.876 19.089,3.851 20.999,3.851H29.237V13.259C29.237,15.691 30.518,16.956 32.935,16.956H41.606V33.231C41.606,35.059 40.648,36.068 38.738,36.068H35.057V39.918H39.074C43.272,39.918 45.458,37.697 45.458,33.471V17.892C45.458,15.308 44.92,13.658 43.368,12.067L33.565,2.093C32.096,0.587 30.328,0 28.065,0H20.679C16.481,0 14.295,2.218 14.295,6.448V11.247ZM32.452,12.773V5.46L40.604,13.741H33.404C32.73,13.741 32.452,13.447 32.452,12.773Z"
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M4.571,43.552C4.571,47.798 6.744,50 10.955,50H29.353C33.563,50 35.737,47.779 35.737,43.552V28.424C35.737,25.791 35.403,24.559 33.756,22.88L23.103,12.062C21.52,10.448 20.172,10.082 17.805,10.082H10.955C6.76,10.082 4.571,12.283 4.571,16.529V43.552ZM8.422,43.313V16.753C8.422,14.957 9.365,13.932 11.278,13.932H17.318V24.693C17.318,27.509 18.711,28.882 21.491,28.882H31.882V43.313C31.882,45.14 30.923,46.149 29.03,46.149H11.262C9.365,46.149 8.422,45.14 8.422,43.313ZM21.872,25.486C21.061,25.486 20.715,25.143 20.715,24.328V14.688L31.347,25.486H21.872Z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
@ -20,15 +20,15 @@
|
||||
<TextView
|
||||
android:id="@+id/copyConversationId"
|
||||
style="@style/BottomSheetActionItem"
|
||||
android:drawableStart="@drawable/ic_content_copy_white_24dp"
|
||||
android:drawableStart="@drawable/ic_copy"
|
||||
android:drawableTint="?attr/colorControlNormal"
|
||||
android:visibility="gone"
|
||||
android:visibility="visible"
|
||||
android:text="@string/accountIDCopy" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/copyCommunityUrl"
|
||||
style="@style/BottomSheetActionItem"
|
||||
android:drawableStart="@drawable/ic_content_copy_white_24dp"
|
||||
android:drawableStart="@drawable/ic_copy"
|
||||
android:drawableTint="?attr/colorControlNormal"
|
||||
android:visibility="gone"
|
||||
android:text="@string/communityUrlCopy" />
|
||||
|
@ -5,6 +5,6 @@
|
||||
<item
|
||||
android:title="@string/accountIDCopy"
|
||||
android:id="@+id/menu_copy_account_id"
|
||||
android:icon="@drawable/ic_content_copy_white_24dp"
|
||||
android:icon="@drawable/ic_copy"
|
||||
android:contentDescription="@string/AccessibilityId_accountIdCopy" />
|
||||
</menu>
|
@ -42,7 +42,7 @@
|
||||
<item name="menu_save_icon">@drawable/ic_baseline_save_24</item>
|
||||
<item name="menu_photo_library_icon">@drawable/ic_baseline_photo_library_24</item>
|
||||
<item name="menu_delete_icon">@drawable/ic_baseline_delete_24</item>
|
||||
<item name="menu_copy_icon">@drawable/ic_baseline_file_copy_24</item>
|
||||
<item name="menu_copy_icon">@drawable/ic_copy</item>
|
||||
<item name="menu_reply_icon">@drawable/ic_baseline_reply_24</item>
|
||||
<item name="menu_select_icon">@drawable/ic_baseline_check_circle_outline_24</item>
|
||||
<item name="menu_selectall_icon">@drawable/ic_baseline_select_all_24</item>
|
||||
|
Loading…
Reference in New Issue
Block a user