Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea/misc.xml
.DS_Store
/build
/captures
Expand Down
26 changes: 26 additions & 0 deletions .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions .idea/misc.xml

This file was deleted.

17 changes: 17 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
applicationId = "com.moneymong.moneymong"
minSdk = 24
targetSdk = 34
versionCode = 29
versionName = "1.4.0"
versionCode = 30
versionName = "2.0.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.moneymong.moneymong.design_system.theme.Body2
import com.moneymong.moneymong.design_system.R
import com.moneymong.moneymong.design_system.theme.Body3

@Composable
fun MDSButton(
Expand All @@ -30,7 +32,7 @@ fun MDSButton(
@DrawableRes iconResource: Int? = null,
enabled: Boolean = true,
contentHorizontalPadding: Dp = 0.dp,
cornerShape : Dp = 10.dp,
cornerShape: Dp = 10.dp,
) {
val backgroundColor = if (enabled) type.backgroundColor else disabledBackgroundColor
val contentColor = if (enabled) type.contentColor else disabledContentColor
Expand All @@ -57,19 +59,31 @@ fun MDSButton(
),
horizontalArrangement = Arrangement.spacedBy(6.dp)
) {
Text(
text = text,
color = contentColor,
style = Body3,
)
if (iconResource != null) {
Icon(
modifier = Modifier.size(18.dp),
modifier = Modifier.size(20.dp),
painter = painterResource(id = iconResource),
contentDescription = "Button icon",
tint = contentColor
)
}
Text(
text = text,
color = contentColor,
style = Body2,
)
}
}
}

@Preview
@Composable
private fun MDSButtonPreview() {
MDSButton(
onClick = {},
text = "Button",
type = MDSButtonType.PRIMARY,
size = MDSButtonSize.LARGE,
iconResource = R.drawable.ic_scan
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import com.moneymong.moneymong.design_system.theme.Gray02
import com.moneymong.moneymong.design_system.theme.Gray03
import com.moneymong.moneymong.design_system.theme.Gray04
import com.moneymong.moneymong.design_system.theme.Gray05
import com.moneymong.moneymong.design_system.theme.Gray08
import com.moneymong.moneymong.design_system.theme.White

enum class MDSButtonType(val backgroundColor: Color, val contentColor: Color) {

PRIMARY(backgroundColor = Blue04, contentColor = White),
SECONDARY(backgroundColor = Blue01, contentColor = Blue04),
NEGATIVE(backgroundColor = Gray02, contentColor = Gray05),
THIRDARY(backgroundColor = Gray08, contentColor = White)
}

val disabledBackgroundColor = Gray03
Expand Down
Loading