Use CompoundIcon and remove ic_send.xml
This commit is contained in:
committed by
Benoit Marty
parent
6a9bcb8d1e
commit
184e9928f5
@@ -45,7 +45,6 @@ internal val iconsOther = listOf(
|
||||
R.drawable.ic_plus,
|
||||
R.drawable.ic_quote,
|
||||
R.drawable.ic_reply,
|
||||
R.drawable.ic_send,
|
||||
R.drawable.ic_sign_out,
|
||||
R.drawable.ic_strikethrough,
|
||||
R.drawable.ic_take_photo_camera,
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
<!--
|
||||
~ Copyright (c) 2023 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.
|
||||
-->
|
||||
|
||||
<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="M23.106,13.447L2.345,23.822C0.946,24.522 -0.51,23.022 0.174,21.653C0.174,21.653 2.747,16.457 3.455,15.096C4.163,13.734 4.973,13.499 12.497,12.526C12.775,12.49 13.003,12.28 13.003,12C13.003,11.72 12.775,11.509 12.497,11.474C4.973,10.501 4.163,10.266 3.455,8.904C2.747,7.544 0.174,2.347 0.174,2.347C-0.51,0.979 0.946,-0.522 2.345,0.178L23.106,10.554C24.298,11.149 24.298,12.851 23.106,13.447Z"
|
||||
android:fillColor="@android:color/white"/>
|
||||
</vector>
|
||||
@@ -30,14 +30,15 @@ import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import io.element.android.compound.icons.CompoundIcons
|
||||
import io.element.android.compound.icons.compoundicons.Check
|
||||
import io.element.android.compound.icons.compoundicons.Send
|
||||
import io.element.android.compound.theme.ElementTheme
|
||||
import io.element.android.libraries.designsystem.preview.ElementPreview
|
||||
import io.element.android.libraries.designsystem.preview.PreviewsDayNight
|
||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||
import io.element.android.libraries.designsystem.theme.components.IconButton
|
||||
import io.element.android.libraries.designsystem.utils.CommonDrawables
|
||||
import io.element.android.libraries.textcomposer.model.MessageComposerMode
|
||||
import io.element.android.compound.theme.ElementTheme
|
||||
import io.element.android.libraries.designsystem.icons.CompoundDrawables
|
||||
import io.element.android.libraries.ui.strings.CommonStrings
|
||||
|
||||
@Composable
|
||||
@@ -53,9 +54,9 @@ internal fun SendButton(
|
||||
onClick = onClick,
|
||||
enabled = canSendMessage,
|
||||
) {
|
||||
val iconId = when (composerMode) {
|
||||
is MessageComposerMode.Edit -> CompoundDrawables.ic_check
|
||||
else -> CommonDrawables.ic_send
|
||||
val iconVector = when (composerMode) {
|
||||
is MessageComposerMode.Edit -> CompoundIcons.Check
|
||||
else -> CompoundIcons.Send
|
||||
}
|
||||
val iconSize = when (composerMode) {
|
||||
is MessageComposerMode.Edit -> 24.dp
|
||||
@@ -81,7 +82,7 @@ internal fun SendButton(
|
||||
.height(iconSize)
|
||||
.padding(start = iconStartPadding)
|
||||
.align(Alignment.Center),
|
||||
resourceId = iconId,
|
||||
imageVector = iconVector,
|
||||
contentDescription = contentDescription,
|
||||
// Exception here, we use Color.White instead of ElementTheme.colors.iconOnSolidPrimary
|
||||
tint = if (canSendMessage) Color.White else ElementTheme.colors.iconDisabled
|
||||
|
||||
Reference in New Issue
Block a user