Skip to content

Commit 140d855

Browse files
Build issue fixed.
1 parent 735eddc commit 140d855

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

coremodule/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ publishing {
3838
register<MavenPublication>("release") {
3939
afterEvaluate {
4040
from(components["release"])
41+
groupId = "com.github.Vimalraj-Vijay"
42+
artifactId = "CoreModule"
43+
version = libs.versions.coreModuleDependencyVersion
4144
}
4245
}
4346
}
@@ -48,6 +51,8 @@ dependencies {
4851
implementation(libs.androidx.core.ktx)
4952
implementation(libs.androidx.appcompat)
5053
implementation(libs.material)
54+
implementation(libs.androidx.runtime.android)
55+
implementation(libs.androidx.material3.android)
5156
testImplementation(libs.junit)
5257
androidTestImplementation(libs.androidx.junit)
5358
androidTestImplementation(libs.androidx.espresso.core)

coremodule/src/main/java/com/vimalraj/coremodule/views/GenericAlertDialog.kt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,27 @@ import androidx.compose.material3.Icon
66
import androidx.compose.material3.Text
77
import androidx.compose.material3.TextButton
88
import androidx.compose.runtime.Composable
9+
import androidx.compose.ui.graphics.Color
910
import androidx.compose.ui.graphics.vector.ImageVector
10-
import androidx.compose.ui.res.colorResource
11-
import androidx.compose.ui.res.stringResource
1211
import androidx.compose.ui.text.font.FontStyle
1312
import androidx.compose.ui.unit.sp
14-
import com.vimalraj.coremodule.R
1513

1614
@Composable
1715
fun GenericAlertDialog(
1816
onDismissRequest: () -> Unit,
1917
onConfirmation: () -> Unit,
2018
dialogTitle: String,
2119
dialogText: String,
22-
icon: ImageVector,
20+
confirmText: String = "",
21+
dismissText: String = "",
22+
icon: ImageVector?,
23+
iconColor: Color
2324
) {
2425
AlertDialog(
2526
icon = {
26-
Icon(icon, contentDescription = null, tint = colorResource(R.color.red))
27+
if (icon != null) {
28+
Icon(icon, contentDescription = null, tint = iconColor)
29+
}
2730
},
2831
title = {
2932
Text(text = dialogTitle, fontSize = 22.sp, fontStyle = FontStyle.Normal)
@@ -40,7 +43,7 @@ fun GenericAlertDialog(
4043
onConfirmation()
4144
}
4245
) {
43-
Text(stringResource(R.string.confirm))
46+
Text(confirmText)
4447
}
4548
},
4649
dismissButton = {
@@ -49,7 +52,7 @@ fun GenericAlertDialog(
4952
onDismissRequest()
5053
}
5154
) {
52-
Text(stringResource(R.string.dismiss))
55+
Text(dismissText)
5356
}
5457
}
5558
)

gradle/libs.versions.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ appcompat = "1.7.0"
1010
material = "1.12.0"
1111
activityCompose = "1.9.3"
1212
composeBom = "2024.12.01"
13+
runtimeAndroid = "1.7.6"
14+
material3Android = "1.3.1"
15+
coreModuleDependencyVersion = "0.0.1"
1316

1417
[libraries]
1518
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
@@ -28,6 +31,8 @@ androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-toolin
2831
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
2932
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
3033
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
34+
androidx-runtime-android = { group = "androidx.compose.runtime", name = "runtime-android", version.ref = "runtimeAndroid" }
35+
androidx-material3-android = { group = "androidx.compose.material3", name = "material3-android", version.ref = "material3Android" }
3136

3237
[plugins]
3338
android-application = { id = "com.android.application", version.ref = "agp" }

0 commit comments

Comments
 (0)