From e6d83b177abb4fdce991e920cc0867aa3e613d04 Mon Sep 17 00:00:00 2001 From: seunghee17 Date: Fri, 17 May 2024 00:00:59 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20=ED=99=98=EC=9E=90=20=EC=98=A8?= =?UTF-8?q?=EB=B3=B4=EB=94=A9=20=EC=88=98=EC=A0=95=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 9 +- .../auth/onboarding/OnBoardingPatience.kt | 19 +- .../screens/patience/MedicineScreen.kt | 190 +++++++++++++++--- app/src/main/res/drawable/icadskfj.png | Bin 0 -> 3553 bytes settings.gradle.kts | 1 + 5 files changed, 180 insertions(+), 39 deletions(-) create mode 100644 app/src/main/res/drawable/icadskfj.png 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 0000000000000000000000000000000000000000..65806fcad689600f58243a891561b4c698e5b138 GIT binary patch literal 3553 zcmV<74Ic7|P)OhB(P$7sB#{^b zVpJLvL_yR-Whr5kEiklUY^QXf)0xgp=e>FN-TnAG%YDmqT3YyvoBZb7d*8k1eCIpg zZ#j2>H`&1f6K}?Y;SC;qY|NNw{oC96@<%T)bI}IFG1kK3EeU517!MH|C4}*0T(R~| zxt+V7+q3S4Pwm_p;|(0I3pD4P9lUnqXiwY1XUsf4W*3sRtknQ=v~mtTU{SXQSwf2$ zk@;km1W7UG(US2}yu|MHO2*FiV_$lNjg2KZ&EvE{^RWx8!)^Pvb`<;_PFr#bYd4zE zZUe0YK;ax9do}@HLx9_;XF^XzBUvQiQ-JppPoKw+lFc-(6lx5L^S5*pc}x`eeWRfziWZ1NrY2zFg@4$(Y4>3 z`RD5fec;D^9~|gBdN*5RnOHNT06Td!vZ?{I6mZ%CHKutT&=j}^E$&5h@8#PF{QXF# zxI4Yj_PNzp9Qo^MgWf;3YRlTLxqq2!%vKDY2dw=pX_s_srl71^Ta`x&y1v_brpb8J zcr7fZ>wxUgPGI6eB(Ef;L$fUx42~UrY9(wdW|t?wJJ2`OI{y!+AFHr>hyZ^^W29)n z#Guq7P%R4^uVw4&*3;(|ZTgz0=lYq%SC(Bzzb#Uihch`pxai|=@4M%>4;PPfPHQF5 zL(TI)%5}v<=x8CQ`w-o6sWW0RF;)C!mS)pb_v>ZBmPHS~+!^azEe{dT6Me7ud9rxjo9>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bfQY|MWa1q``F+-ysnJVJG z2WIj7-V%}YOsf0gUBsX(`7 zk(0@gOl(GzpmK|t_I(St{P74DSO%ATWB_j&>4Zs%MiwItA&=Gkkz~a)4i3$D*z?d~ z9DHFGmtE9?b;GvQaYW7^k{<;G*eyp`S_t6Ihj1&oE4Tip^iwqU+IZYCHsY+E+5c3& zHQAIS(0N+wT$2fhfLpZJ6?S0Oz=F|?cWh_|b7?IN{q2LLpU9x=lr(ziEtJ@e2>sII zGgRC?`{W!xusM;Xj)+)(AQ+C|mdFTnxoAF9u{Uhre%&+2P6}EakAAiA9>;R;&9++k z964mJSv#d|DB!lxI#Xb!**fg$?G|ITt|eeySO~yE!(7FG;lMJi36{w`a$a{Sq76le z%0g5LxP8&PZ>T&Xilo;BEvl)GAfv)byMOr)K@2# zTB?V-uB%L|oGj`JRp+a0CjnPt$+A}r;V(wq4eTAGH&$-ci`D>o#g8@Oc-M8sn;!XE z^I0f)I~Y@?8<&-riNqE%A*P6J(-fslENe!_mX)!Z0hyX**{d!E*qB0{sC5D%3u4%> zL=-k71SE~cO7^CHXVuO073Mg=Cj~8z{+_NY4$sa8IOcsv7BR6JER!)bu)?Calq;nKG-KEY3fYempvc0wY9 zm<$HHamAxYTMkDHo7jWah2MztcVXMIRtQAO*R7d@b3I}i-o^z$|dJyD1q3*F==~m zl2e)%lNwi_NSIaz(|sseBtlxmZX7Aciv-I;7L+{7uCX_VDN6!;5H3S z>66MKie?cv=6J#;qnJHub~fGJnVWxd)B7lJUqE&>b#jVeUl-^G@Z!+S%X4CCqGP?i z=+0%MB7LTcBHL&(qpTPBx&Cf<{i=zm+QDV%{v0?Rux|+TiW7jI#L14UUO&*rLF+aG bZV+00000NkvXXu0mjfT6fDT literal 0 HcmV?d00001 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") } }