Skip to content

Commit

Permalink
Merge pull request #10 from Team-ReMind/feat/onboarding
Browse files Browse the repository at this point in the history
[feat] 환자 온보딩 수정 완료
  • Loading branch information
seunghee17 authored May 16, 2024
2 parents 32012fc + e6d83b1 commit 61eba76
Show file tree
Hide file tree
Showing 5 changed files with 180 additions and 39 deletions.
9 changes: 3 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {

defaultConfig {
applicationId = "com.example.remind"
minSdk = 24
minSdk = 26
targetSdk = 33
versionCode = 1
versionName = "1.0"
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
)
}
}
}
Original file line number Diff line number Diff line change
@@ -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<FloatEntry>() }
// val datasetLineSpec = remember{ arrayListOf<LineChart.LineSpec>() }
// LaunchedEffect(refreshDataset.intValue) {
// datasetForModel.clear()
// datasetLineSpec.clear()
// var xPos = 0f
// val dataPoints = arrayListOf<FloatEntry>()
// datasetLineSpec.add(
// )
// }
// RemindTheme {
//
// }
fun GraphComponent(
modifier: Modifier = Modifier
){
val xAxisData = listOf("Sun", "Mon", "Tues", "Wed", "Thur", "Fri", "Sat") // xAxisData : List<GraphData>, and GraphData accepts both Number and String types
val yAxisData = listOf(100, 75, 100, 25, 75, 50, 50)
val dataModel = mutableListOf<LineData>()
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
)
}
}
Binary file added app/src/main/res/drawable/icadskfj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

Expand Down

0 comments on commit 61eba76

Please sign in to comment.