Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sketch general issues (WPB-8810) (WPB-8811) (WPB-8812) #2919

Merged
merged 5 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ fun EnabledMessageComposer(
additionalOptionStateHolder.toRichTextEditing()
},
onCloseRichEditingButtonClicked = additionalOptionStateHolder::toAttachmentAndAdditionalOptionsMenu,
onDrawingModeClicked = additionalOptionStateHolder::toDrawingMode
onDrawingModeClicked = {
showAdditionalOptionsMenu()
additionalOptionStateHolder.toDrawingMode()
}
)
}
Box(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import com.wire.android.ui.common.button.WireTertiaryIconButton
import com.wire.android.ui.common.button.wireSendPrimaryButtonColors
import com.wire.android.ui.common.colorsScheme
import com.wire.android.ui.common.dimensions
import com.wire.android.ui.theme.wireColorScheme
import com.wire.android.ui.theme.wireDimensions
import com.wire.android.ui.theme.wireTypography
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -104,7 +105,7 @@ fun DrawingCanvasBottomSheet(
onDismissRequest = onDismissEvent,
properties = ModalBottomSheetProperties(
isFocusable = true,
securePolicy = SecureFlagPolicy.SecureOn,
securePolicy = SecureFlagPolicy.Inherit,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black screen issue fix

shouldDismissOnBackPress = false
)
) {
Expand Down Expand Up @@ -162,6 +163,7 @@ internal fun DrawingTopBar(
Text(
text = conversationTitle,
style = MaterialTheme.wireTypography.title01,
color = MaterialTheme.wireColorScheme.onBackground,
modifier = Modifier.align(Alignment.CenterVertically),
maxLines = MAX_LINES_TOPBAR,
overflow = TextOverflow.Ellipsis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.graphics.nativeCanvas
import androidx.compose.ui.input.pointer.AwaitPointerEventScope
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.input.pointer.positionChangedIgnoreConsumed
import androidx.compose.ui.input.pointer.positionChanged
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.res.imageResource
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -172,7 +172,7 @@ private suspend fun AwaitPointerEventScope.handleGestures(
do {
val event = awaitPointerEvent()
onDraw(event.changes.first().position)
val hasNewLineDraw = event.changes.first().positionChangedIgnoreConsumed()
val hasNewLineDraw = event.changes.first().positionChanged()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several undo actions to execute fix.

if (hasNewLineDraw) {
event.changes.first().consume()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.navigationBarsIgnoringVisibility
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.windowInsetsBottomHeight
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
Expand All @@ -47,6 +52,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Devices
import androidx.compose.ui.tooling.preview.Preview
import com.wire.android.ui.common.bottomsheet.MenuModalSheetContent
import com.wire.android.ui.common.bottomsheet.MenuModalSheetHeader
Expand All @@ -57,6 +63,7 @@ import com.wire.android.ui.common.dimensions
import com.wire.android.ui.theme.WireColorPalette
import com.wire.android.ui.theme.WireTheme

@OptIn(ExperimentalLayoutApi::class)
@Composable
fun DrawingToolPicker(
sheetState: WireModalSheetState,
Expand Down Expand Up @@ -106,6 +113,13 @@ fun DrawingToolPicker(
}
)
}
Spacer(
Modifier
.background(colorsScheme().background)
.windowInsetsBottomHeight(
WindowInsets.navigationBarsIgnoringVisibility
)
)
}
}

Expand Down Expand Up @@ -179,7 +193,7 @@ private const val GRID_CELLS = 6
private fun Color.isWhite() = this == Color.White

@OptIn(ExperimentalMaterial3Api::class)
@Preview
@Preview(showSystemUi = true, device = Devices.NEXUS_5)
@Composable
fun PreviewDrawingToolPickerSelectedNonWhite() {
WireTheme {
Expand Down
Loading