1
1
package com.example.runningavater.growth
2
2
3
+ import androidx.compose.foundation.background
3
4
import androidx.compose.foundation.layout.Arrangement
4
5
import androidx.compose.foundation.layout.Box
5
6
import androidx.compose.foundation.layout.Column
@@ -19,26 +20,31 @@ import androidx.compose.ui.text.style.TextAlign
19
20
import androidx.compose.ui.unit.dp
20
21
import androidx.compose.ui.unit.sp
21
22
import androidx.compose.ui.viewinterop.AndroidView
23
+ import com.example.runningavater.ui.theme.GranulatedSugar
24
+ import com.example.runningavater.ui.theme.NuclearMango
25
+ import com.example.runningavater.ui.theme.SungYellow
22
26
import com.github.mikephil.charting.components.Description
23
27
import com.github.mikephil.charting.data.PieData
24
28
import com.github.mikephil.charting.data.PieDataSet
25
29
import com.github.mikephil.charting.data.PieEntry
26
30
27
31
@Composable
28
- fun GrowthScreen () {
32
+ fun GrowthScreen (backgroundColor : Color = SungYellow ) {
29
33
Column (
30
34
modifier =
31
35
Modifier
32
- .padding(16 .dp)
36
+ // .padding(16.dp)
37
+ .background(backgroundColor)
33
38
.fillMaxSize(),
34
39
) {
35
40
Text (
36
41
text = " 成長記録" ,
37
- fontSize = 20 .sp,
42
+ fontSize = 30 .sp,
38
43
modifier =
39
44
Modifier
40
- .padding(bottom = 16 .dp)
45
+ .padding(32 .dp)
41
46
.fillMaxWidth(),
47
+ color = NuclearMango ,
42
48
textAlign = TextAlign .Center ,
43
49
)
44
50
Box (
@@ -80,13 +86,15 @@ fun PieChart(modifier: Modifier = Modifier) {
80
86
81
87
val pieDataSet =
82
88
PieDataSet (pieEntryList, " " ).apply {
83
- colors = listOf (Color . Green , Color . Red ).map { it.toArgb() }
89
+ colors = listOf (NuclearMango , GranulatedSugar ).map { it.toArgb() }
84
90
}
85
91
AndroidView (
86
92
factory = { context ->
87
93
com.github.mikephil.charting.charts.PieChart (context).apply {
88
94
description = Description ().apply { text = " " }
89
95
centerText = " 達成度"
96
+ setCenterTextSize(18f )
97
+ setCenterTextColor(NuclearMango .toArgb())
90
98
setEntryLabelTextSize(11f )
91
99
data = PieData (pieDataSet).apply { setValueTextSize(20f ) }
92
100
// アニメーションを指定
0 commit comments