From b9444054f43d195334f2e11599a52b5877e97371 Mon Sep 17 00:00:00 2001 From: Megna Date: Fri, 29 Mar 2024 12:33:12 +0530 Subject: [PATCH 1/3] Added custom button style --- .../components/TUIMobileButtonBlock.kt | 8 +- .../components/TUIMobileOverlayFooter.kt | 17 +- .../tarkaui/components/base/TUIButton.kt | 145 ++++++++++++------ 3 files changed, 114 insertions(+), 56 deletions(-) diff --git a/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileButtonBlock.kt b/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileButtonBlock.kt index 7da7828e..52206e40 100644 --- a/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileButtonBlock.kt +++ b/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileButtonBlock.kt @@ -14,8 +14,8 @@ import com.tarkalabs.tarkaui.icons.ChevronDown24 import com.tarkalabs.tarkaui.icons.TarkaIcon import com.tarkalabs.tarkaui.icons.TarkaIcons.Regular import com.tarkalabs.tarkaui.components.base.ButtonSize.XL -import com.tarkalabs.tarkaui.components.base.ButtonStyle.OUTLINE -import com.tarkalabs.tarkaui.components.base.ButtonStyle.PRIMARY +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Outline +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Primary import com.tarkalabs.tarkaui.components.base.TUIButton import com.tarkalabs.tarkaui.components.base.TUIButtonTags import com.tarkalabs.tarkaui.theme.TUITheme @@ -61,7 +61,7 @@ fun TUIMobileButtonBlock( height = XL, label = outlineButtonLabel, onClick = { outlineButtonOnClick?.invoke() }, - buttonStyle = OUTLINE, + buttonStyle = Outline, leadingIcon = outlineLeadingIcon, trailingIcon = outlineTrailingIcon, modifier = if (primaryButtonWeight == null) Modifier.weight(1f) else Modifier.wrapContentWidth(), @@ -74,7 +74,7 @@ fun TUIMobileButtonBlock( height = XL, label = it, onClick = { primaryButtonOnClick?.invoke() }, - buttonStyle = PRIMARY, + buttonStyle = Primary, leadingIcon = primaryLeadingIcon, trailingIcon = primaryTrailingIcon, modifier = Modifier.weight( diff --git a/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileOverlayFooter.kt b/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileOverlayFooter.kt index f78b26fc..72082c10 100644 --- a/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileOverlayFooter.kt +++ b/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileOverlayFooter.kt @@ -16,8 +16,9 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import com.tarkalabs.tarkaui.components.base.ButtonStyle.ERROR -import com.tarkalabs.tarkaui.components.base.ButtonStyle.OUTLINE +import com.tarkalabs.tarkaui.components.base.ButtonStyle +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Error +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Outline import com.tarkalabs.tarkaui.components.base.IconButtonStyle import com.tarkalabs.tarkaui.components.base.TUIButton import com.tarkalabs.tarkaui.components.base.TUIIconButton @@ -134,14 +135,14 @@ fun TUIMobileOverlayFooterPreview() { TUIButton( label = "Cancel", onClick = {}, - buttonStyle = OUTLINE + buttonStyle = Outline ) }, rightContent = { TUIButton( label = "Delete", onClick = {}, - buttonStyle = ERROR + buttonStyle = Error ) } ) @@ -155,14 +156,14 @@ fun TUIMobileOverlayFooterPreview() { TUIButton( label = "Cancel", onClick = {}, - buttonStyle = OUTLINE + buttonStyle = Outline ) }, rightContent = { TUIButton( label = "Delete", onClick = {}, - buttonStyle = ERROR + buttonStyle = ButtonStyle.Error ) } ) @@ -173,7 +174,7 @@ fun TUIMobileOverlayFooterPreview() { TUIButton( label = "Delete", onClick = {}, - buttonStyle = ERROR + buttonStyle = Error ) } ) @@ -184,7 +185,7 @@ fun TUIMobileOverlayFooterPreview() { TUIButton( label = "Cancel", onClick = {}, - buttonStyle = OUTLINE + buttonStyle = Outline ) } ) diff --git a/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/base/TUIButton.kt b/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/base/TUIButton.kt index d90f49b0..1b181495 100644 --- a/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/base/TUIButton.kt +++ b/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/base/TUIButton.kt @@ -4,11 +4,11 @@ import com.tarkalabs.tarkaui.components.base.ButtonSize.L import com.tarkalabs.tarkaui.components.base.ButtonSize.M import com.tarkalabs.tarkaui.components.base.ButtonSize.S import com.tarkalabs.tarkaui.components.base.ButtonSize.XS -import com.tarkalabs.tarkaui.components.base.ButtonStyle.ERROR -import com.tarkalabs.tarkaui.components.base.ButtonStyle.GHOST -import com.tarkalabs.tarkaui.components.base.ButtonStyle.OUTLINE -import com.tarkalabs.tarkaui.components.base.ButtonStyle.PRIMARY -import com.tarkalabs.tarkaui.components.base.ButtonStyle.SECONDARY +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Error +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Ghost +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Outline +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Primary +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Secondary import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -40,14 +40,19 @@ import com.tarkalabs.tarkaui.icons.Add24 import com.tarkalabs.tarkaui.icons.TarkaIcon import com.tarkalabs.tarkaui.icons.TarkaIcons.Regular import com.tarkalabs.tarkaui.components.HorizontalSpacer +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Custom import com.tarkalabs.tarkaui.theme.TUITheme -enum class ButtonStyle { - PRIMARY, - SECONDARY, - GHOST, - ERROR, - OUTLINE; +sealed class ButtonStyle { + object Primary: ButtonStyle() + object Secondary: ButtonStyle() + object Ghost: ButtonStyle() + object Error: ButtonStyle() + object Outline: ButtonStyle() + data class Custom( + val containerColor: Color, + val contentColor: Color + ) : ButtonStyle() } enum class ButtonSize(val size: Dp) { @@ -106,7 +111,7 @@ enum class ButtonSize(val size: Dp) { * @param label The text to be displayed on the button. * @param modifier The modifier to apply to the button. * @param height The height size of the button. Default is [ButtonSize.M]. - * @param buttonStyle The style of the button. Default is [ButtonStyle.PRIMARY]. + * @param buttonStyle The style of the button. Default is [ButtonStyle.Primary]. * @param leadingIcon The drawable resource for the leading icon, if any. Default is null. * @param trailingIcon The drawable resource for the trailing icon, if any. Default is null. * @param onClick The callback function to be executed when the button is clicked. @@ -124,46 +129,53 @@ onClick = {} label: String, modifier: Modifier = Modifier, height: ButtonSize = M, - buttonStyle: ButtonStyle = PRIMARY, + buttonStyle: ButtonStyle = Primary, leadingIcon: TarkaIcon? = null, trailingIcon: TarkaIcon? = null, tags: TUIButtonTags = TUIButtonTags(), onClick: () -> Unit, ) { val buttonColor = when (buttonStyle) { - PRIMARY -> { + Primary -> { ButtonDefaults.buttonColors( containerColor = TUITheme.colors.primary, contentColor = TUITheme.colors.onPrimary ) } - SECONDARY -> { + Secondary -> { ButtonDefaults.buttonColors( containerColor = TUITheme.colors.secondary, contentColor = TUITheme.colors.onSecondary ) } - GHOST -> { + Ghost -> { ButtonDefaults.buttonColors( containerColor = Color.Transparent, contentColor = TUITheme.colors.secondary ) } - ERROR -> { + Error -> { ButtonDefaults.buttonColors( containerColor = TUITheme.colors.error, contentColor = TUITheme.colors.onPrimary, ) } - OUTLINE -> { + Outline -> { ButtonDefaults.buttonColors( containerColor = TUITheme.colors.surface, contentColor = TUITheme.colors.onSurface ) } + + is Custom -> { + ButtonDefaults.buttonColors( + containerColor = buttonStyle.containerColor, + contentColor = buttonStyle.contentColor, + ) + } } Button( @@ -176,7 +188,7 @@ onClick = {} isLeadingIconNull = leadingIcon == null, isTrailingIconNull = trailingIcon == null ), - border = if (buttonStyle == OUTLINE) BorderStroke( + border = if (buttonStyle == Outline) BorderStroke( width = 1.dp, color = TUITheme.colors.onSurface ) else null ) { @@ -226,24 +238,48 @@ data class TUIButtonTags( Column { Text("Primary Button", fontSize = 24.sp) Spacer(modifier = Modifier.height(20.dp)) - TUIButton(label = "Primary ", height = M, buttonStyle = PRIMARY, onClick = {}, trailingIcon = Regular.Add24) + TUIButton( + label = "Primary ", height = M, buttonStyle = Primary, onClick = {}, + trailingIcon = Regular.Add24 + ) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Primary ", height = L, buttonStyle = PRIMARY, onClick = {}, trailingIcon = Regular.Add24) + TUIButton( + label = "Primary ", height = L, buttonStyle = Primary, onClick = {}, + trailingIcon = Regular.Add24 + ) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Primary ", height = S, buttonStyle = PRIMARY, onClick = {}, trailingIcon = Regular.Add24) + TUIButton( + label = "Primary ", height = S, buttonStyle = Primary, onClick = {}, + trailingIcon = Regular.Add24 + ) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Primary ", height = XS, buttonStyle = PRIMARY, onClick = {}, trailingIcon = Regular.Add24) + TUIButton( + label = "Primary ", height = XS, buttonStyle = Primary, onClick = {}, + trailingIcon = Regular.Add24 + ) } Column { Text("Secondary Button", fontSize = 24.sp) Spacer(modifier = Modifier.height(20.dp)) - TUIButton(label = "Secondary ", height = M, buttonStyle = SECONDARY, onClick = {}, leadingIcon = Regular.Add24) + TUIButton( + label = "Secondary ", height = M, buttonStyle = Secondary, onClick = {}, + leadingIcon = Regular.Add24 + ) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Secondary ", height = L, buttonStyle = SECONDARY, onClick = {}, leadingIcon = Regular.Add24) + TUIButton( + label = "Secondary ", height = L, buttonStyle = Secondary, onClick = {}, + leadingIcon = Regular.Add24 + ) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Secondary ", height = S, buttonStyle = SECONDARY, onClick = {}, leadingIcon = Regular.Add24) + TUIButton( + label = "Secondary ", height = S, buttonStyle = Secondary, onClick = {}, + leadingIcon = Regular.Add24 + ) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Secondary ", height = XS, buttonStyle = SECONDARY, onClick = {}, leadingIcon = Regular.Add24) + TUIButton( + label = "Secondary ", height = XS, buttonStyle = Secondary, onClick = {}, + leadingIcon = Regular.Add24 + ) } } @@ -256,37 +292,58 @@ data class TUIButtonTags( Column(horizontalAlignment = Alignment.Start) { Text("Ghost Button", fontSize = 24.sp) Spacer(modifier = Modifier.height(20.dp)) - TUIButton(label = "Ghost Button", height = M, buttonStyle = GHOST, onClick = {}) + TUIButton(label = "Ghost Button", height = M, buttonStyle = Ghost, onClick = {}) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Ghost Button", height = L, buttonStyle = GHOST, onClick = {}) + TUIButton(label = "Ghost Button", height = L, buttonStyle = Ghost, onClick = {}) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Ghost Button", height = S, buttonStyle = GHOST, onClick = {}) + TUIButton(label = "Ghost Button", height = S, buttonStyle = Ghost, onClick = {}) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Ghost Button", height = XS, buttonStyle = GHOST, onClick = {}) + TUIButton(label = "Ghost Button", height = XS, buttonStyle = Ghost, onClick = {}) } Column { Text("Error Button", fontSize = 24.sp) Spacer(modifier = Modifier.height(20.dp)) - TUIButton(label = "Error Button", height = M, buttonStyle = ERROR, onClick = {}) + TUIButton(label = "Error Button", height = M, buttonStyle = Error, onClick = {}) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Error Button", height = L, buttonStyle = ERROR, onClick = {}) + TUIButton(label = "Error Button", height = L, buttonStyle = Error, onClick = {}) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Error Button", height = S, buttonStyle = ERROR, onClick = {}) + TUIButton(label = "Error Button", height = S, buttonStyle = Error, onClick = {}) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Error Button", height = XS, buttonStyle = ERROR, onClick = {}) + TUIButton(label = "Error Button", height = XS, buttonStyle = Error, onClick = {}) } } - Text("Outline Button", fontSize = 30.sp) - Spacer(modifier = Modifier.height(20.dp)) - TUIButton(label = "Outline Button", height = M, buttonStyle = OUTLINE, onClick = {}) - Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Outline Button", height = L, buttonStyle = OUTLINE, onClick = {}) - Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Outline Button", height = S, buttonStyle = OUTLINE, onClick = {}) - Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Outline Button", height = XS, buttonStyle = OUTLINE, onClick = {}) + Row( + horizontalArrangement = Arrangement.SpaceBetween, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 10.dp) + ) { + Column { + Text("Outline Button", fontSize = 30.sp) + Spacer(modifier = Modifier.height(20.dp)) + TUIButton(label = "Outline Button", height = M, buttonStyle = Outline, onClick = {}) + Spacer(modifier = Modifier.height(10.dp)) + TUIButton(label = "Outline Button", height = L, buttonStyle = Outline, onClick = {}) + Spacer(modifier = Modifier.height(10.dp)) + TUIButton(label = "Outline Button", height = S, buttonStyle = Outline, onClick = {}) + Spacer(modifier = Modifier.height(10.dp)) + TUIButton(label = "Outline Button", height = XS, buttonStyle = Outline, onClick = {}) + } + Column { + Spacer(modifier = Modifier.height(5.dp)) + Text("Custom Button", fontSize = 24.sp) + Spacer(modifier = Modifier.height(20.dp)) + TUIButton(label = "Custom Button", height = M, buttonStyle = Custom(contentColor = TUITheme.colors.onSecondaryAlt, containerColor = TUITheme.colors.secondaryAlt), onClick = {}) + Spacer(modifier = Modifier.height(10.dp)) + TUIButton(label = "Custom Button", height = L, buttonStyle = Custom(contentColor = TUITheme.colors.onSecondaryAlt, containerColor = TUITheme.colors.secondaryAlt), onClick = {}) + Spacer(modifier = Modifier.height(10.dp)) + TUIButton(label = "Custom Button", height = S, buttonStyle = Custom(contentColor = TUITheme.colors.onSecondaryAlt, containerColor = TUITheme.colors.secondaryAlt), onClick = {}) + Spacer(modifier = Modifier.height(10.dp)) + TUIButton(label = "Custom Button", height = XS, buttonStyle = Custom(contentColor = TUITheme.colors.onSecondaryAlt, containerColor = TUITheme.colors.secondaryAlt), onClick = {}) + } + } } } } \ No newline at end of file From 3a54477178e54d65ab7f60f95672eeb193203572 Mon Sep 17 00:00:00 2001 From: Megna Date: Fri, 29 Mar 2024 12:44:19 +0530 Subject: [PATCH 2/3] Screenshot test --- ...Test__customButtonTest_darkTheme_false.png | Bin 0 -> 8023 bytes ...tTest__customButtonTest_darkTheme_true.png | Bin 0 -> 8102 bytes .../tarkalabs/uicomponents/TUIButtonTest.kt | 6 ++-- .../screenshots/TUIButtonScreenShotTest.kt | 29 ++++++++++++------ 4 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 tarka-ui/screenshots/debug/screenshots-default/com.tarkalabs.uicomponents.screenshots.TUIButtonScreenShotTest__customButtonTest_darkTheme_false.png create mode 100644 tarka-ui/screenshots/debug/screenshots-default/com.tarkalabs.uicomponents.screenshots.TUIButtonScreenShotTest__customButtonTest_darkTheme_true.png diff --git a/tarka-ui/screenshots/debug/screenshots-default/com.tarkalabs.uicomponents.screenshots.TUIButtonScreenShotTest__customButtonTest_darkTheme_false.png b/tarka-ui/screenshots/debug/screenshots-default/com.tarkalabs.uicomponents.screenshots.TUIButtonScreenShotTest__customButtonTest_darkTheme_false.png new file mode 100644 index 0000000000000000000000000000000000000000..e699738613dd3e01946649c24dc819d80708a555 GIT binary patch literal 8023 zcmZvBWmH?w*L9HMTHFdnid%7q0x43oNTEoO;x0vs7777^6pBMB@GI`_mXfr^A-H>S zcY7}X^?rP_vXXm~xie?ZK6B>G-cj0`uL<#J@jxIDp{k0KE(nB%0ItJvuz*jzFEQ7^ z7n-N;>sO$PLHaG=2GjGEsvZvT3c#_3f}-%c2_{Y+h!kBo4^$2g z0kg=LlIBt=+tt(l^Um<160xr{E^iPNSHe`3xW(>7!25}!Lm@Z|@;GL}Bpo4`!AwQZ z4l&WtF>$7EJ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Px!M%(X;?s_OvEal@FSNEHWx zq`t{1cf4yXK&!8#EVC^k{f*R#DHTxw-#o9RAm70j*EQuUf8)ve6yT-v0%CN|o@fgS zpv&iugF1u&0=9v4n0ggegawY}$m?=Y1E)Xo-UVF_pTT;B!P}vvpy)C%lzEXZ3gE8+ zd4$=q&-4o~76L(bSPm#6HHu%yQQP?DF+fASaxk@5)+8`(hD?P*1q*K17>|dY`C3n4jI@No>lmGd#P2k-CUL}DNbNIgml_}h^LK8G zeB|@LJxV44o^#0h;;}0A(DbbppkFIoJD9%nNI{n!%6_%@e?nPY0Y(%V~MPV1cUdxH4;)@jVC#;sBtG zC9oL&J|!m)#l!+DkZ7Cri@gRE6^2@!$YV=<%;)Y&IAj^Ob%Nr?)0==dRc%GKbj+MI z?6fhT(o@6ZIBVSM0NH^}qhmUuO15_+vB3lk=tG+l0Gd4%n;B1EUhBm!onWv1m(3s_ zHX9H3)?__n28KPu6t=0eA6mOht4P}I!U6q%btccuv9?|owot*czZ;(iw$#Vh0oUQL zy(e%sX3HmLBJH*CZ~>D$KoulDbjpMFXMk)@KT zUb#<*PCGFbBR1_?nP}`OH9Ttp zIh6HhI|pDdRvyQX-wv;G$J6%nticdWkZPjN&SBod@-m7DSR=1M+7OZ4-wxqv5jJnx zXvnDHuMz>(g;=zZDltn(8Bk3yNuQuyQL^BbW7+-sZ#~0435E}|cvMhMyZ4W~8Lb&v zNp(br9YuZ%(IvPF%D-`o8&mo-)iw2Pj7~nR4?7Z>v;Qay(!JC0U&|o0XV4=nB_e$s zh9DA2T!}A4m056G_WGII!CJ5_)LM-oQ@af%0a*201>El8%3wgVRZV%W`qJ9S2E@jE{UrpUys4}c!htgkoJeSo{+R=% iq*>{o45p&B2Q*SGC;WlsJ}@ATgH)9@l`39AKK~#7t#6G0 literal 0 HcmV?d00001 diff --git a/tarka-ui/screenshots/debug/screenshots-default/com.tarkalabs.uicomponents.screenshots.TUIButtonScreenShotTest__customButtonTest_darkTheme_true.png b/tarka-ui/screenshots/debug/screenshots-default/com.tarkalabs.uicomponents.screenshots.TUIButtonScreenShotTest__customButtonTest_darkTheme_true.png new file mode 100644 index 0000000000000000000000000000000000000000..3ae30baf311f3053df2fd2b5ffc65764f0856c23 GIT binary patch literal 8102 zcmX9@1yoes8Xb`CPU#k;VdxG4DQS^Tr5k}6q*GBu38j$^0SW02C8cxd?rz@Uf2_Nh znS0MY@%6WNl$M4vE*2FQ1OmZTd8Y6J0zv8m-$OCbz<;c;m@DvsCZ_uaX-0lKT1Xbb0#0=?E1F3gS$%#O0cNaYn#8C>JI zRaJg2F2i*(x(j=W4RmFubbnT0U?9uMXb~U>$($vt*ov;tN{4qa zd$5A8Qu`lgJBCS?Y9ZVqE^Ie6_&=$@N$uB!zrHgcT}93vQII00kW zF(`xCFC8N)lHHP75ji1rO?tZ!y{;Z9Wdx~z3}RxCZCE$(8R@Xk#p+(M5Nxhr{~4wV zLH}2K@`%XDmjnvL8A+G=|NC)Ay-B!CJNqJuJ(7r7jcO%FSB5}bDkw6t4u1+ol!e&c zT}#TD+-_Bz23}Hyo^in*mCeYgBQWg+29dP`nzaKM_Quyyi0>GMlGsFa zHOKSWxF-fgH{@d6C&YxZOzk&#)?30QhK zj6M>5UMwvOUHhe6!Zq&}`|f_2%EGsZBN8k?#;m5g!K0y|F!wbh$zq@G7F=*lCn@wXKZC0M7c;$jJO|f{dKgV0w;&$-*}8#GjIU zPYOhF6d4(@L`6l3Ro`e#mePGS*Zp^#VrRex?h5tBW3fo`a82Mj@nRuAr)+E_?j#~4 z4EvN|9>$Rkr4RLPu-FLJCNNhWTo;Q{P$1#UnnKp`gFkEMvu^FtVrI;;x5w+>|X1 z*Zy}*5e-HNWla%P2zPU%XUC_s3xlPj#W-52;^zxZu$1;+Fzmoo6%@*4!TG9fJvXUR z@sv3Dl9x$E5+~P@YyL8J%I74=3y&>W2gh&Wr=cRSUtj0 z3R@9pE%;XqM@f`}2H8K8h)^5K#%>GjkA`*v&WpvE!>v&Q7AE0jc0i;5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D0+*O59w4+x_9*B}*psG3@i$JeweT5LhgQk~b-|>2SjXrX5 zd}@*eyx60{Y&@XLAt9lq^AEm2z%EF8)1S4dogT=zpSyr#fB-|8J^eED{Ve|r!;{uY z1&`@P&uIp>AMzEpG6YQjR#bp8l_mu9tDpGpj16)sgMCK_Wkyqd+!NeB4z0adUD2b@=*S3)?fstlAuhgGq;sX@{(TA12c# zF}nmj)x+|dh-i(4tks?{t6`x`k?dLm#bIpFCe~QJ&la{#BbbT)ZSI)sFmF(N_9k+T z`Po;JXPD#miNGSoWSxG=dW|Yp>8NK|LMe=gzI)qih)ZOl@U>!bv|<5n#k(93bu|BR zt7s*|WFBQ|Gb2xf%cDvQv}mfpMWBG0HMMkWQz7%QZtR{E>@d5C)}9+(Fz?*J2dn*S zom0w23RYES(_1AJKr;)n$mkON#}E@w)_;j)f8_~^3Qr#&!(yZ*vk3M4F$|#dPpz?jh#@Nm}bapqYlsh$%#O7hF?Yz l?M5MWN;fH#!G7f)DJ?BF`ray8A8_pu6-5n&QaSVB{{exNoE`uG literal 0 HcmV?d00001 diff --git a/tarka-ui/src/androidTest/java/com/tarkalabs/uicomponents/TUIButtonTest.kt b/tarka-ui/src/androidTest/java/com/tarkalabs/uicomponents/TUIButtonTest.kt index b4585161..33ded981 100644 --- a/tarka-ui/src/androidTest/java/com/tarkalabs/uicomponents/TUIButtonTest.kt +++ b/tarka-ui/src/androidTest/java/com/tarkalabs/uicomponents/TUIButtonTest.kt @@ -4,7 +4,7 @@ import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick -import com.tarkalabs.tarkaui.components.base.ButtonStyle.SECONDARY +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Secondary import com.tarkalabs.tarkaui.components.base.TUIButton import com.tarkalabs.tarkaui.components.base.TUIButtonTags import org.junit.Rule @@ -20,7 +20,7 @@ class TUIButtonTest { @Test fun button_Displayed() { composable.setContent { - TUIButton(label = "Button", tags = tags, onClick = { }, buttonStyle = SECONDARY) + TUIButton(label = "Button", tags = tags, onClick = { }, buttonStyle = Secondary) } composable.onNodeWithText("Button").assertIsDisplayed() } @@ -32,7 +32,7 @@ class TUIButtonTest { TUIButton( label = "Button", onClick = onClick, - buttonStyle = SECONDARY + buttonStyle = Secondary ) } composable.onNodeWithText("Button").performClick() diff --git a/tarka-ui/src/androidTest/java/com/tarkalabs/uicomponents/screenshots/TUIButtonScreenShotTest.kt b/tarka-ui/src/androidTest/java/com/tarkalabs/uicomponents/screenshots/TUIButtonScreenShotTest.kt index eab7eb35..4c64b635 100644 --- a/tarka-ui/src/androidTest/java/com/tarkalabs/uicomponents/screenshots/TUIButtonScreenShotTest.kt +++ b/tarka-ui/src/androidTest/java/com/tarkalabs/uicomponents/screenshots/TUIButtonScreenShotTest.kt @@ -1,12 +1,14 @@ package com.tarkalabs.uicomponents.screenshots import com.tarkalabs.tarkaui.components.base.ButtonSize.L -import com.tarkalabs.tarkaui.components.base.ButtonStyle.ERROR -import com.tarkalabs.tarkaui.components.base.ButtonStyle.GHOST -import com.tarkalabs.tarkaui.components.base.ButtonStyle.OUTLINE -import com.tarkalabs.tarkaui.components.base.ButtonStyle.PRIMARY -import com.tarkalabs.tarkaui.components.base.ButtonStyle.SECONDARY +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Custom +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Error +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Ghost +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Outline +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Primary +import com.tarkalabs.tarkaui.components.base.ButtonStyle.Secondary import com.tarkalabs.tarkaui.components.base.TUIButton +import com.tarkalabs.tarkaui.theme.TUITheme import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized @@ -31,22 +33,29 @@ class TUIButtonScreenShotTest( } @Test fun primaryButtonTest() = compareScreenshotFor(darkTheme, "_primaryButtonTest_$testName") { - TUIButton(label = "Primary button", buttonStyle = PRIMARY, height = L, onClick = {}) + TUIButton(label = "Primary button", buttonStyle = Primary, height = L, onClick = {}) } @Test fun secondaryButtonTest() = compareScreenshotFor(darkTheme, "_secondaryButtonTest_$testName") { - TUIButton(label = "Secondary button", buttonStyle = SECONDARY, height = L, onClick = {}) + TUIButton(label = "Secondary button", buttonStyle = Secondary, height = L, onClick = {}) } @Test fun ghostButtonTest() = compareScreenshotFor(darkTheme, "_ghostButtonTest_$testName") { - TUIButton(label = "Ghost button", buttonStyle = GHOST, height = L, onClick = {}) + TUIButton(label = "Ghost button", buttonStyle = Ghost, height = L, onClick = {}) } @Test fun errorButtonTest() = compareScreenshotFor(darkTheme, "_errorButtonTest_$testName"){ - TUIButton(label = "Error button", buttonStyle = ERROR, height = L, onClick = {}) + TUIButton(label = "Error button", buttonStyle = Error, height = L, onClick = {}) } @Test fun outlineButtonTest() = compareScreenshotFor(darkTheme, "_outlineButtonTest_$testName"){ - TUIButton(label = "Outline button", buttonStyle = OUTLINE, height = L, onClick = {}) + TUIButton(label = "Outline button", buttonStyle = Outline, height = L, onClick = {}) + } + + @Test fun customButtonTest() = compareScreenshotFor(darkTheme, "_customButtonTest_$testName"){ + TUIButton( + label = "Custom button", buttonStyle = Custom( + containerColor = TUITheme.colors.secondaryAlt, contentColor = TUITheme.colors.onSecondaryAlt + ), height = L, onClick = {}) } } \ No newline at end of file From 2fbe83410d57ae571c589f4bdeb218c259a20e98 Mon Sep 17 00:00:00 2001 From: Megna Date: Fri, 29 Mar 2024 12:47:29 +0530 Subject: [PATCH 3/3] Formatted code --- .../tarkaui/components/base/TUIButton.kt | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/base/TUIButton.kt b/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/base/TUIButton.kt index 1b181495..8a665d95 100644 --- a/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/base/TUIButton.kt +++ b/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/base/TUIButton.kt @@ -335,13 +335,25 @@ data class TUIButtonTags( Spacer(modifier = Modifier.height(5.dp)) Text("Custom Button", fontSize = 24.sp) Spacer(modifier = Modifier.height(20.dp)) - TUIButton(label = "Custom Button", height = M, buttonStyle = Custom(contentColor = TUITheme.colors.onSecondaryAlt, containerColor = TUITheme.colors.secondaryAlt), onClick = {}) + TUIButton(label = "Custom Button", height = M, buttonStyle = Custom( + contentColor = TUITheme.colors.onSecondaryAlt, + containerColor = TUITheme.colors.secondaryAlt + ), onClick = {}) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Custom Button", height = L, buttonStyle = Custom(contentColor = TUITheme.colors.onSecondaryAlt, containerColor = TUITheme.colors.secondaryAlt), onClick = {}) + TUIButton(label = "Custom Button", height = L, buttonStyle = Custom( + contentColor = TUITheme.colors.onSecondaryAlt, + containerColor = TUITheme.colors.secondaryAlt + ), onClick = {}) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Custom Button", height = S, buttonStyle = Custom(contentColor = TUITheme.colors.onSecondaryAlt, containerColor = TUITheme.colors.secondaryAlt), onClick = {}) + TUIButton(label = "Custom Button", height = S, buttonStyle = Custom( + contentColor = TUITheme.colors.onSecondaryAlt, + containerColor = TUITheme.colors.secondaryAlt + ), onClick = {}) Spacer(modifier = Modifier.height(10.dp)) - TUIButton(label = "Custom Button", height = XS, buttonStyle = Custom(contentColor = TUITheme.colors.onSecondaryAlt, containerColor = TUITheme.colors.secondaryAlt), onClick = {}) + TUIButton(label = "Custom Button", height = XS, buttonStyle = Custom( + contentColor = TUITheme.colors.onSecondaryAlt, + containerColor = TUITheme.colors.secondaryAlt + ), onClick = {}) } } }