Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into BPKR-215_Android_Graphic_p…
Browse files Browse the repository at this point in the history
…romo_contribution
  • Loading branch information
Saidu Ernest Kamara committed Sep 22, 2023
2 parents 9fb961b + dcf06d1 commit 8c37f39
Show file tree
Hide file tree
Showing 67 changed files with 27 additions and 22 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fun PriceMapMarkerStory(modifier: Modifier = Modifier) {
title = stringArrayResource(R.array.map_marker_prices)[index],
status = markerStatus(index),
state = rememberMarkerState(position = latLng),
onClick = { focusedMarker = index; viewedMarkers += index },
onClick = { focusedMarker = index; viewedMarkers += index; false },
)
}
}
Expand All @@ -88,7 +88,7 @@ fun IconMapMarkerStory(modifier: Modifier = Modifier) {
status = markerStatus(index),
icon = if (index == 2) BpkIcon.Cafe else BpkIcon.Landmark,
state = rememberMarkerState(position = latLng),
onClick = { focusedMarker = index },
onClick = { focusedMarker = index; false },
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ package net.skyscanner.backpack.compose.chipgroup.multiple.internal
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.height
Expand Down Expand Up @@ -69,13 +69,13 @@ internal fun BpkMultiSelectChipGroupImpl(
LazyRow(
modifier = Modifier.selectableGroup(),
state = rememberLazyListState(),
horizontalArrangement = Arrangement.spacedBy(BpkSpacing.Md),
) {
items(items = chips) { chip ->
ChipItem(
chip = chip,
style = style,
modifier = Modifier
.padding(PaddingValues(BpkSpacing.Sm))
.semantics { role = Role.Checkbox },)
}
}
Expand All @@ -85,13 +85,14 @@ internal fun BpkMultiSelectChipGroupImpl(
BpkMultiChipGroupType.Wrap -> {
FlowRow(
modifier = modifier.selectableGroup(),
horizontalArrangement = Arrangement.spacedBy(BpkSpacing.Md),
verticalArrangement = Arrangement.spacedBy(BpkSpacing.Md),
) {
chips.forEach { chip ->
ChipItem(
chip = chip,
style = style,
modifier = Modifier
.padding(PaddingValues(BpkSpacing.Sm))
.semantics { role = Role.Checkbox },)
}
}
Expand All @@ -108,12 +109,12 @@ private fun StickyChip(
val interactionSource = remember { MutableInteractionSource() }
Row(
modifier = modifier
.padding(PaddingValues(BpkSpacing.Sm))
.padding(end = BpkSpacing.Md)
.height(IntrinsicSize.Min),
) {
BpkChipImpl(
modifier = Modifier
.padding(PaddingValues(end = BpkSpacing.Md))
.padding(end = BpkSpacing.Md)
.semantics {
role = Role.Button
contentDescription = chip.text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@

package net.skyscanner.backpack.compose.chipgroup.single.internal

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
Expand Down Expand Up @@ -52,6 +51,7 @@ internal fun BpkSingleSelectChipGroupImpl(
LazyRow(
modifier = modifier.selectableGroup(),
state = rememberLazyListState(),
horizontalArrangement = Arrangement.spacedBy(BpkSpacing.Md),
) {
itemsIndexed(items = chips) { index, chip ->
ChipItem(chip, index == selectedIndex, style) {
Expand All @@ -64,6 +64,8 @@ internal fun BpkSingleSelectChipGroupImpl(
BpkSingleChipGroupType.Wrap -> {
FlowRow(
modifier = modifier.selectableGroup(),
horizontalArrangement = Arrangement.spacedBy(BpkSpacing.Md),
verticalArrangement = Arrangement.spacedBy(BpkSpacing.Md),
) {
chips.forEachIndexed { index, chip ->
ChipItem(chip, index == selectedIndex, style) {
Expand All @@ -85,7 +87,6 @@ private fun ChipItem(
) {
BpkChip(
modifier = modifier
.padding(PaddingValues(BpkSpacing.Sm))
.semantics { role = Role.RadioButton },
text = chip.text,
icon = chip.icon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ enum class BpkIconMarkerStatus {
Disabled,
}

/**
* @param onClick Callback invoked when the marker is clicked. Return true to consume the event, for example to disable the default centre map on marker behaviour.
*/
@Composable
fun BpkIconMapMarker(
contentDescription: String,
Expand All @@ -55,8 +58,8 @@ fun BpkIconMapMarker(
state: MarkerState = rememberMarkerState(),
tag: Any? = null,
visible: Boolean = true,
zIndex: Float = 0.0f,
onClick: (Marker) -> Unit = {},
zIndex: Float? = null,
onClick: (Marker) -> Boolean = { false },
) {
val iconBitmap = rememberCapturedComposeBitmapDescriptor(icon, status) {
IconMarkerLayout(status = status, icon = icon)
Expand All @@ -67,9 +70,9 @@ fun BpkIconMapMarker(
tag = tag,
title = contentDescription,
visible = visible,
zIndex = zIndex,
zIndex = if (status == BpkIconMarkerStatus.Focused && zIndex == null) 1.0f else zIndex ?: 0.0f,
icon = iconBitmap,
onClick = { onClick(it); false },
onClick = onClick,
) {}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ fun BpkPriceMapMarker(
state: MarkerState = rememberMarkerState(),
tag: Any? = null,
visible: Boolean = true,
zIndex: Float = 0.0f,
onClick: (Marker) -> Unit = {},
zIndex: Float? = null,
onClick: (Marker) -> Boolean = { false },
) {
val icon = rememberCapturedComposeBitmapDescriptor(title, status) {
PriceMarkerLayout(title = title, status = status)
Expand All @@ -70,9 +70,9 @@ fun BpkPriceMapMarker(
tag = tag,
title = title,
visible = visible,
zIndex = if (status == BpkPriceMarkerStatus.Focused && zIndex == 0.0f) 1.0f else zIndex,
zIndex = if (status == BpkPriceMarkerStatus.Focused && zIndex == null) 1.0f else zIndex ?: 0.0f,
icon = icon,
onClick = { onClick(it); false },
onClick = onClick,
) {}
}

Expand Down
Binary file modified docs/compose/Chip/screenshots/default.png
Binary file modified docs/compose/Chip/screenshots/default_dm.png
Binary file modified docs/compose/Chip/screenshots/on-dark.png
Binary file modified docs/compose/Chip/screenshots/on-dark_dm.png
Binary file modified docs/compose/Chip/screenshots/on-image.png
Binary file modified docs/compose/Chip/screenshots/on-image_dm.png
Binary file modified docs/compose/ChipGroup/screenshots/multi-select-rail.png
Binary file modified docs/compose/ChipGroup/screenshots/multi-select-rail_dm.png
Binary file modified docs/compose/ChipGroup/screenshots/multi-select-wrap.png
Binary file modified docs/compose/ChipGroup/screenshots/multi-select-wrap_dm.png
Binary file modified docs/compose/ChipGroup/screenshots/single-select-rail.png
Binary file modified docs/compose/ChipGroup/screenshots/single-select-rail_dm.png
Binary file modified docs/compose/ChipGroup/screenshots/single-select-wrap.png
Binary file modified docs/compose/ChipGroup/screenshots/single-select-wrap_dm.png
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ lint = "31.1.1" # android plugin, lint and sdk-common need to be updated togeth
androidSdkCommon = "31.1.1" # if the Gradle plugin version is X.Y.Z, then the lint version is (X+23).Y.Z.

detekt = "1.23.1"
lifecycle = "2.6.1"
lifecycle = "2.6.2"
threeTenAbp = "1.4.5"
androidXJunit = "1.1.5"
coroutines = "1.7.3"
Expand All @@ -27,7 +27,7 @@ plugin-nexusPublishing = "io.github.gradle-nexus:publish-plugin:1.3.0"
plugin-detekt = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
plugin-ksp = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" }

detektRules-compose = "io.nlopez.compose.rules:detekt:0.2.2"
detektRules-compose = "io.nlopez.compose.rules:detekt:0.2.3"
detektRules-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
detektRules-libraries = { module = "io.gitlab.arturbosch.detekt:detekt-rules-libraries", version.ref = "detekt" }

Expand All @@ -36,7 +36,7 @@ androidx-annotations = "androidx.annotation:annotation:1.7.0"
androidx-cardView = "androidx.cardview:cardview:1.0.0"
androidx-constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.4"
androidx-swiperefreshLayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
androidx-coreKts = "androidx.core:core-ktx:1.10.1"
androidx-coreKts = "androidx.core:core-ktx:1.12.0"

androidx-lifecycleKtx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle" }
androidx-lifecycleViewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel", version.ref = "lifecycle" }
Expand Down Expand Up @@ -80,7 +80,7 @@ kotlin-compilerTestingKsp = { module = "com.github.tschuchortdev:kotlin-compile-
lint-lint = { module = "com.android.tools.lint:lint", version.ref = "lint" }
lint-api = { module = "com.android.tools.lint:lint-api", version.ref = "lint" }

compose-bom = { group = "androidx.compose", name = "compose-bom", version = "2023.09.00" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version = "2023.09.01" }
compose-ui = { group = "androidx.compose.ui", name = "ui" }
compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }
compose-runtime = { group = "androidx.compose.runtime", name = "runtime" }
Expand Down

0 comments on commit 8c37f39

Please sign in to comment.