From af7d5337f057f3471be9efb1e52dff5dbf534b52 Mon Sep 17 00:00:00 2001 From: Pauline Auvray Date: Wed, 1 Feb 2023 16:58:35 +0100 Subject: [PATCH] [#111] Review: Set OdsDropdownMenuTrailing class to internal and rename it to OdsExposedDropdownMenuTrailing --- .../ods/compose/component/menu/OdsExposedDropdownMenu.kt | 4 ++-- .../compose/component/textfield/OdsTextFieldsCommon.kt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/src/main/java/com/orange/ods/compose/component/menu/OdsExposedDropdownMenu.kt b/lib/src/main/java/com/orange/ods/compose/component/menu/OdsExposedDropdownMenu.kt index 90fde3cd4..09d1b72ab 100644 --- a/lib/src/main/java/com/orange/ods/compose/component/menu/OdsExposedDropdownMenu.kt +++ b/lib/src/main/java/com/orange/ods/compose/component/menu/OdsExposedDropdownMenu.kt @@ -24,7 +24,7 @@ import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.PreviewParameter import com.orange.ods.compose.component.OdsComponentApi -import com.orange.ods.compose.component.textfield.OdsDropdownMenuTrailing +import com.orange.ods.compose.component.textfield.OdsExposedDropdownMenuTrailing import com.orange.ods.compose.component.textfield.OdsTextField import com.orange.ods.compose.component.utilities.BasicPreviewParameterProvider import com.orange.ods.compose.component.utilities.Preview @@ -68,7 +68,7 @@ fun OdsExposedDropdownMenu( readOnly = true, label = label, leadingIcon = selectedItem.value.icon, - trailing = OdsDropdownMenuTrailing(expanded = if (enabled) expanded else false, enabled = enabled), + trailing = OdsExposedDropdownMenuTrailing(expanded = if (enabled) expanded else false, enabled = enabled), enabled = enabled ) OdsDropdownMenu( diff --git a/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextFieldsCommon.kt b/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextFieldsCommon.kt index efd64e3eb..a486f9f54 100644 --- a/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextFieldsCommon.kt +++ b/lib/src/main/java/com/orange/ods/compose/component/textfield/OdsTextFieldsCommon.kt @@ -58,7 +58,7 @@ fun OdsTextFieldCharacterCounter(valueLength: Int, maxChars: Int, enabled: Boole sealed class OdsTextFieldTrailing class OdsTextTrailing(val text: String) : OdsTextFieldTrailing() class OdsIconTrailing(val painter: Painter, val contentDescription: String? = null, val onClick: () -> Unit = {}) : OdsTextFieldTrailing() -class OdsDropdownMenuTrailing(val expanded: Boolean, val enabled: Boolean) : OdsTextFieldTrailing() +internal class OdsExposedDropdownMenuTrailing(val expanded: Boolean, val enabled: Boolean) : OdsTextFieldTrailing() @Composable internal fun OdsTextFieldBottomRow(isError: Boolean, errorMessage: String?, characterCounter: (@Composable () -> Unit)?) { @@ -105,7 +105,7 @@ internal fun getTrailing(trailing: OdsTextFieldTrailing, value: String, enabled: ) } } - is OdsDropdownMenuTrailing -> { + is OdsExposedDropdownMenuTrailing -> { { if (enabled) { ExposedDropdownMenuDefaults.TrailingIcon( @@ -141,7 +141,7 @@ internal fun getTrailingPreview(parameter: OdsTextFieldPreviewParameter, value: val trailing = when (parameter.previewTrailingType) { OdsTextTrailing::class -> OdsTextTrailing(text = "units") OdsIconTrailing::class -> OdsIconTrailing(painter = painterResource(id = android.R.drawable.ic_input_add)) - OdsDropdownMenuTrailing::class -> OdsDropdownMenuTrailing(expanded = false, enabled = true) + OdsExposedDropdownMenuTrailing::class -> OdsExposedDropdownMenuTrailing(expanded = false, enabled = true) else -> null } @@ -160,7 +160,7 @@ internal class OdsTextFieldPreviewParameterProvider : BasicPreviewParameterProvi private val previewParameterValues: List get() { val booleanValues = listOf(true, false) - val trailings = listOf(null, OdsTextTrailing::class, OdsIconTrailing::class, OdsDropdownMenuTrailing::class) + val trailings = listOf(null, OdsTextTrailing::class, OdsIconTrailing::class, OdsExposedDropdownMenuTrailing::class) return booleanValues.flatMap { hasCounter -> booleanValues.flatMap { hasErrorMessage ->