Skip to content

Commit

Permalink
Merge pull request #168 from tarkalabs/raja/multilevelselectorchanges
Browse files Browse the repository at this point in the history
fix: Leading Icon and Selection checkbox added in TUIMultiLevelSelectionHe…
  • Loading branch information
rajajawahar authored Jan 12, 2024
2 parents 1cedc03 + 05b99c9 commit b0f9329
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tarkaui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ publishing {
run {
groupId = "com.tarkalabs"
artifactId = getLibraryArtifactId()
version = "1.0.0"
version = "1.0.1"
artifact("$buildDir/outputs/aar/${getLibraryArtifactId()}-release.aar")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.tarkalabs.tarkaicons.ApprovalsApp24
import com.tarkalabs.tarkaicons.TarkaIcon
import com.tarkalabs.tarkaicons.CheckmarkCircle24
import com.tarkalabs.tarkaicons.ChevronLeft24
import com.tarkalabs.tarkaicons.TarkaIcons
import com.tarkalabs.uicomponents.extentions.maxHeight
import com.tarkalabs.uicomponents.extentions.maxWidth
Expand All @@ -43,10 +43,8 @@ object TUIMultiLevelSelectorHeader {
*/
@Composable operator fun invoke(
modifier: Modifier = Modifier,
isSelected: Boolean,
title: String,
leadingIcon: TarkaIcon,
trailingIcon: TarkaIcon? = null,
isSelected: Boolean,
paddingValues: PaddingValues = PaddingValues(),
tags: TUIMultiLevelSelectorHeaderTags = TUIMultiLevelSelectorHeaderTags(),
onClick: () -> Unit,
Expand All @@ -63,8 +61,8 @@ object TUIMultiLevelSelectorHeader {
verticalAlignment = Alignment.CenterVertically
) {
Icon(
painter = painterResource(id = leadingIcon.iconRes),
contentDescription = leadingIcon.contentDescription,
painter = painterResource(id = TarkaIcons.Regular.ChevronLeft24.iconRes),
contentDescription = TarkaIcons.Regular.ChevronLeft24.contentDescription,
modifier = Modifier
.maxHeight(24)
.maxWidth(24),
Expand All @@ -80,10 +78,10 @@ object TUIMultiLevelSelectorHeader {
color = color
)
HorizontalSpacer(space = 12)
if (trailingIcon != null) {
if (isSelected) {
Icon(
painter = painterResource(id = trailingIcon.iconRes),
contentDescription = trailingIcon.contentDescription,
painter = painterResource(id = TarkaIcons.Filled.CheckmarkCircle24.iconRes),
contentDescription = TarkaIcons.Filled.CheckmarkCircle24.contentDescription,
modifier = Modifier
.maxHeight(24)
.maxWidth(24),
Expand All @@ -108,8 +106,6 @@ object TUIMultiLevelSelectorHeader {
TUIMultiLevelSelectorHeader(
modifier = Modifier.fillMaxWidth(),
isSelected = true,
leadingIcon = TarkaIcons.Filled.ApprovalsApp24,
trailingIcon = TarkaIcons.Filled.ApprovalsApp24,
title = "Hello There",
) {}

Expand All @@ -119,7 +115,6 @@ object TUIMultiLevelSelectorHeader {
modifier = Modifier.fillMaxWidth(),
isSelected = false,
title = "Hello There",
leadingIcon = TarkaIcons.Filled.ApprovalsApp24,
) {}

}
Expand Down

0 comments on commit b0f9329

Please sign in to comment.