diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8de65f7..4d8a62b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -18,7 +18,7 @@ android { defaultConfig { applicationId = "com.example.remind" - minSdk = 24 + minSdk = 26 targetSdk = 33 versionCode = 1 versionName = "1.0" @@ -120,11 +120,8 @@ dependencies { //splash screen api implementation( "androidx.core:core-splashscreen:1.0.1") - //vico module - implementation("com.patrykandpatrick.vico:compose:1.12.0") - implementation("com.patrykandpatrick.vico:compose-m3:1.12.0") - implementation("com.patrykandpatrick.vico:core:1.12.0") - implementation("com.patrykandpatrick.vico:views:1.12.0") + //graph library + implementation("com.github.jaikeerthick:Composable-Graphs:v1.2.3") //serialization implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") diff --git a/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingPatience.kt b/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingPatience.kt index 8833888..1c5ff24 100644 --- a/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingPatience.kt +++ b/app/src/main/java/com/example/remind/feature/screens/auth/onboarding/OnBoardingPatience.kt @@ -16,7 +16,6 @@ import androidx.compose.material3.CheckboxDefaults import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.MutableState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -177,16 +176,22 @@ fun CheckReading( } } -@Preview +@Preview(showBackground = true) @Composable fun OnBoardingPreview() { Column( modifier = Modifier.fillMaxSize() ) { - BasicOnBoardingAppBar( - modifier = Modifier.fillMaxWidth(), - weight = 0.5f, - title = stringResource(id = R.string.사용자_정보) - ) + Column() { + Text( + text = stringResource(id = R.string.긴급_상황_발생_시_보호자에게_연락), + style = RemindTheme.typography.b3Medium.copy(color = RemindTheme.colors.black) + ) + Spacer(modifier = Modifier.height(4.dp)) + Text( + text = stringResource(id = R.string.긴급_상황_발생시_담당자가_보호자에게), + style = RemindTheme.typography.c1Regular.copy(color = RemindTheme.colors.grayscale_3, lineHeight = 6.sp) + ) + } } } \ No newline at end of file diff --git a/app/src/main/java/com/example/remind/feature/screens/patience/MedicineScreen.kt b/app/src/main/java/com/example/remind/feature/screens/patience/MedicineScreen.kt index 5affb14..87b7cb8 100644 --- a/app/src/main/java/com/example/remind/feature/screens/patience/MedicineScreen.kt +++ b/app/src/main/java/com/example/remind/feature/screens/patience/MedicineScreen.kt @@ -1,38 +1,176 @@ package com.example.remind.feature.screens.patience +import androidx.compose.foundation.Image +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.mutableIntStateOf -import androidx.compose.runtime.mutableStateListOf -import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Brush +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import com.example.remind.R import com.example.remind.core.designsystem.theme.RemindTheme -import com.patrykandpatrick.vico.compose.style.ChartStyle -import com.patrykandpatrick.vico.core.chart.line.LineChart -import com.patrykandpatrick.vico.core.entry.ChartEntryModelProducer -import com.patrykandpatrick.vico.core.entry.FloatEntry -import com.patrykandpatrick.vico.views.chart.line.lineSpec +import com.jaikeerthick.composable_graphs.composables.line.LineGraph +import com.jaikeerthick.composable_graphs.composables.line.model.LineData +import com.jaikeerthick.composable_graphs.composables.line.style.LineGraphColors +import com.jaikeerthick.composable_graphs.composables.line.style.LineGraphFillType +import com.jaikeerthick.composable_graphs.composables.line.style.LineGraphStyle +import com.jaikeerthick.composable_graphs.composables.line.style.LineGraphVisibility +import com.jaikeerthick.composable_graphs.style.LabelPosition + +@Composable +fun MedicineScreen() { + RemindTheme { + Box( + modifier = Modifier + .fillMaxWidth() + .border( + width = 1.dp, + shape = RoundedCornerShape(12.dp), + color = RemindTheme.colors.grayscale_2 + ) + .padding(30.dp) + ) { + Column( + modifier = Modifier + .align(Alignment.CenterStart) + .padding(top = 10.dp, bottom = 30.dp), + verticalArrangement = Arrangement.SpaceBetween + ) { + ScoreEx() + } + Spacer(modifier = Modifier.width(25.dp)) + GraphComponent( + modifier = Modifier + .align(Alignment.Center) + .padding(top = 10.dp, bottom = 30.dp, end = 40.dp) + ) + } + } +} + + //그래프 연습용 @Composable -fun MedicineScreen(){ -// val refreshDataset = remember { mutableIntStateOf(0) } -// val modelProducer = remember {ChartEntryModelProducer()} -// val datasetForModel = remember { mutableStateListOf() } -// val datasetLineSpec = remember{ arrayListOf() } -// LaunchedEffect(refreshDataset.intValue) { -// datasetForModel.clear() -// datasetLineSpec.clear() -// var xPos = 0f -// val dataPoints = arrayListOf() -// datasetLineSpec.add( -// ) -// } -// RemindTheme { -// -// } +fun GraphComponent( + modifier: Modifier = Modifier +){ + val xAxisData = listOf("Sun", "Mon", "Tues", "Wed", "Thur", "Fri", "Sat") // xAxisData : List, and GraphData accepts both Number and String types + val yAxisData = listOf(100, 75, 100, 25, 75, 50, 50) + val dataModel = mutableListOf() + for(i in xAxisData.indices) { + val lineData = LineData(xAxisData[i], yAxisData[i]) + dataModel.add(lineData) + } + Column() { + val style = LineGraphStyle( + visibility = LineGraphVisibility( + isXAxisLabelVisible = true, + isYAxisLabelVisible = false, + isCrossHairVisible = false + ), + colors = LineGraphColors( + lineColor = RemindTheme.colors.main_7, + pointColor = RemindTheme.colors.black, + clickHighlightColor = Color.Red, + fillType = LineGraphFillType.Gradient(brush = Brush.verticalGradient(listOf( + RemindTheme.colors.main_7, RemindTheme.colors.white + ))) + ), + yAxisLabelPosition = LabelPosition.LEFT + ) + LineGraph( + data = dataModel, + style = style, + onPointClick = {} + ) + } + +} + + + + +@Composable +fun ScoreEx( + modifier: Modifier = Modifier +) { + Column( + verticalArrangement = Arrangement.Center, + ) { + Text( + text = "0", + style = TextStyle( + fontSize = 10.sp + ) + ) + Spacer(modifier = modifier.height(3.dp)) + Image( + modifier = modifier.size(15.dp, 20.dp), + painter = painterResource(id = R.drawable.icadskfj), + contentDescription = null + ) + Text( + text = "25", + style = TextStyle( + fontSize = 10.sp + ) + ) + Spacer(modifier = modifier.height(3.dp)) + Image( + modifier = modifier.size(15.dp, 20.dp), + painter = painterResource(id = R.drawable.icadskfj), + contentDescription = null + ) + Text( + text = "50", + style = TextStyle( + fontSize = 10.sp + ) + ) + Spacer(modifier = modifier.height(3.dp)) + Image( + modifier = modifier.size(15.dp, 20.dp), + painter = painterResource(id = R.drawable.icadskfj), + contentDescription = null + ) + Text( + text = "75", + style = TextStyle( + fontSize = 10.sp + ) + ) + Spacer(modifier = modifier.height(3.dp)) + Image( + modifier = modifier.size(15.dp, 20.dp), + painter = painterResource(id = R.drawable.icadskfj), + contentDescription = null + ) + Text( + text = "100", + style = TextStyle( + fontSize = 10.sp + ) + ) + Spacer(modifier = modifier.height(3.dp)) + Image( + modifier = modifier.size(15.dp, 20.dp), + painter = painterResource(id = R.drawable.icadskfj), + contentDescription = null + ) + } } \ No newline at end of file diff --git a/app/src/main/res/drawable/icadskfj.png b/app/src/main/res/drawable/icadskfj.png new file mode 100644 index 0000000..65806fc Binary files /dev/null and b/app/src/main/res/drawable/icadskfj.png differ diff --git a/settings.gradle.kts b/settings.gradle.kts index bdba48a..7592f44 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,6 +11,7 @@ dependencyResolutionManagement { google() mavenCentral() maven { url = java.net.URI("https://devrepo.kakao.com/nexus/content/groups/public/") } + maven(url = "https://jitpack.io") } }