Skip to content

Commit

Permalink
Merge pull request #124 from tarkalabs/nilesh/fix
Browse files Browse the repository at this point in the history
 Fixed padding issue in TUITextRow
  • Loading branch information
rajajawahar authored Sep 15, 2023
2 parents 79bd118 + 021c0c7 commit 63d4618
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 79 deletions.
107 changes: 30 additions & 77 deletions example/src/main/java/com/tarkalabs/ui/UIComponentListActivity.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.tarkalabs.ui

import android.os.Bundle
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
Expand All @@ -9,11 +10,10 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.tarkalabs.tarkaicons.Checkmark16
import com.tarkalabs.tarkaicons.TarkaIcons
import com.tarkalabs.uicomponents.components.TUICheckBoxRow
import com.tarkalabs.uicomponents.components.TUIRadioButtonRow
import com.tarkalabs.uicomponents.components.base.ToggleRowStyle
import com.tarkalabs.tarkaicons.ChevronRight20
import com.tarkalabs.tarkaicons.TarkaIcons.Regular
import com.tarkalabs.uicomponents.components.TUITextRow
import com.tarkalabs.uicomponents.components.TextRowStyle.Title
import com.tarkalabs.uicomponents.theme.TUITheme

class UIComponentListActivity : ComponentActivity() {
Expand All @@ -30,80 +30,33 @@ class UIComponentListActivity : ComponentActivity() {
.background(color = TUITheme.colors.surface)
// .padding(30.dp)
) {
TUICheckBoxRow(
checked = true,
enabled = false,
icon = TarkaIcons.Filled.Checkmark16,
title = "Title",
style = ToggleRowStyle.Title,
modifier = Modifier,
paddingValues = PaddingValues(bottom = 8.dp, start = 16.dp, end = 16.dp)
) {
}
TUICheckBoxRow(
checked = true,
enabled = false,
icon = TarkaIcons.Filled.Checkmark16,
title = "Title",
style = ToggleRowStyle.TitleWithDescription("Description"),
modifier = Modifier,
paddingValues = PaddingValues(bottom = 8.dp, start = 16.dp, end = 16.dp)
) {
}

TUICheckBoxRow(
checked = true,
enabled = true,
icon = TarkaIcons.Filled.Checkmark16,
title = "Title",
style = ToggleRowStyle.Title,
modifier = Modifier,
paddingValues = PaddingValues(bottom = 8.dp, start = 16.dp, end = 16.dp)
) {
}
TUICheckBoxRow(
checked = true,
enabled = true,
icon = TarkaIcons.Filled.Checkmark16,
title = "Title",
style = ToggleRowStyle.TitleWithDescription("Description"),
modifier = Modifier,
paddingValues = PaddingValues(bottom = 8.dp, start = 16.dp, end = 16.dp)
) {
}

TUIRadioButtonRow(
selected = true,
enabled = true,
title = "Title",
style = ToggleRowStyle.TitleWithDescription("Description"),
paddingValues = PaddingValues(bottom = 8.dp, start = 16.dp, end = 16.dp)
) {
}
TUIRadioButtonRow(
selected = false,
enabled = true,
title = "Title",
style = ToggleRowStyle.TitleWithDescription("Description"),
paddingValues = PaddingValues(bottom = 8.dp, start = 16.dp, end = 16.dp)
) {
}
TUIRadioButtonRow(
selected = true,
enabled = true,
title = "Title",
style = ToggleRowStyle.Title,
paddingValues = PaddingValues(bottom = 8.dp, start = 16.dp, end = 16.dp)
) {
}
TUIRadioButtonRow(
selected = false,
enabled = true,
title = "Title",
style = ToggleRowStyle.Title,
paddingValues = PaddingValues(bottom = 8.dp, start = 16.dp, end = 16.dp)
) {
}
TUITextRow(title = "Title",
style = Title,
infoIcon = Regular.ChevronRight20,
onTextRowClick = {
Log.d("TAG", "TUITextRowPreview: ")
}, onInfoIconClick = null,
paddingValues = PaddingValues(horizontal = 20.dp, vertical = 0.dp)
)

TUITextRow(title = "Title",
style = Title,
infoIcon = Regular.ChevronRight20,
onTextRowClick = {
Log.d("TAG", "TUITextRowPreview: ")
}, onInfoIconClick = null,
paddingValues = PaddingValues(horizontal = 20.dp, vertical = 0.dp)
)
TUITextRow(title = "Title",
style = Title,
infoIcon = Regular.ChevronRight20,
onTextRowClick = {
Log.d("TAG", "TUITextRowPreview: ")
}, onInfoIconClick = null,
paddingValues = PaddingValues(horizontal = 20.dp, vertical = 0.dp)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ import com.tarkalabs.uicomponents.theme.TUITheme
Row(
modifier
.defaultMinSize(minHeight = 40.dp)
.padding(paddingValues)
.testTag(tags.parentTag)
.then(if (onTextRowClick == null) Modifier else Modifier.clickable { onTextRowClick() }),
.then(if (onTextRowClick == null) Modifier else Modifier.clickable { onTextRowClick() })
.padding(paddingValues),
verticalAlignment = Alignment.CenterVertically) {
Column(Modifier.weight(1f)) {
when (style) {
Expand Down

0 comments on commit 63d4618

Please sign in to comment.