0% found this document useful (0 votes)
29 views5 pages

Grade Calculator App in Jetpack Compose

The document defines a Jetpack Compose UI component called STICalculator that displays a grade calculator. It imports various Jetpack Compose modules for layouts, text, shapes, etc. The STICalculator composable contains a Scaffold with a Column of elements including text for the title and instructions, boxes to display sample grades and input fields, and buttons to clear or calculate the final grade.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views5 pages

Grade Calculator App in Jetpack Compose

The document defines a Jetpack Compose UI component called STICalculator that displays a grade calculator. It imports various Jetpack Compose modules for layouts, text, shapes, etc. The STICalculator composable contains a Scaffold with a Column of elements including text for the title and instructions, boxes to display sample grades and input fields, and buttons to clear or calculate the final grade.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

package [Link].

macasunodcj

import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]
import [Link]

@Composable
fun STICalculator() {
Scaffold { padding ->
Column(
modifier = Modifier
.fillMaxSize()
.padding([Link])

) {
Text(
modifier = [Link](),
text = "Grade Calculator",
fontSize = [Link],
fontWeight = [Link]
)
Spacer(modifier = [Link]([Link]))
Box(
modifier = Modifier
.fillMaxWidth()
.background(color = [Link], shape =
RoundedCornerShape([Link]))
.border(
width = [Link],
color = [Link],
shape = RoundedCornerShape([Link])
)
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding([Link]), horizontalArrangement =
[Link],
verticalAlignment = [Link]
) {
Text(
modifier = [Link](1f),
text = "Mobile Systems and Technologies",
color = [Link],
fontWeight = [Link],
textAlign = [Link],
fontSize = [Link]
)

Text(
modifier = Modifier
.weight(1f)
.fillMaxWidth(),
textAlign = [Link],
text = "97",
color = [Link],
fontWeight = [Link],
fontSize = [Link]

}
}
Spacer(modifier = [Link]([Link]))

Text(
modifier = [Link](),
text = "Input your grades",
fontSize = [Link],
fontWeight = [Link],
color = [Link]
)
Spacer(modifier = [Link]([Link]))
Box(
modifier = Modifier
.fillMaxWidth()
.background(color = [Link], shape =
RoundedCornerShape([Link]))
) {
Column(
modifier = Modifier
.padding([Link])
) {

Box(
modifier = Modifier
.fillMaxWidth()
.background(color = [Link], shape =
RoundedCornerShape([Link]))
.border(
width = [Link],
color = [Link],
shape = RoundedCornerShape([Link])
)
){
Text(
modifier = [Link]([Link]),
fontWeight = [Link],
text = "Prelim",
style = TextStyle(
letterSpacing = [Link],
)
)
}
Spacer(modifier = [Link]([Link]))

Box(
modifier = Modifier
.fillMaxWidth()
.background(color = [Link], shape =
RoundedCornerShape([Link]))
.border(
width = [Link],
color = [Link],
shape = RoundedCornerShape([Link])
)
){
Text(
modifier = [Link]([Link]),
fontWeight = [Link],
text = "Midterm",
style = TextStyle(
letterSpacing = [Link],
)
)
}
Spacer(modifier = [Link]([Link]))

Box(
modifier = Modifier
.fillMaxWidth()
.background(color = [Link], shape =
RoundedCornerShape([Link]))
.border(
width = [Link],
color = [Link],
shape = RoundedCornerShape([Link])
)
){
Text(
modifier = [Link]([Link]),
fontWeight = [Link],
text = "Pre-Final",
style = TextStyle(
letterSpacing = [Link],
)
)
}
Spacer(modifier = [Link]([Link]))

Box(
modifier = Modifier
.fillMaxWidth()
.background(color = [Link], shape =
RoundedCornerShape([Link]))
.border(
width = [Link],
color = [Link],
shape = RoundedCornerShape([Link])
)
){
Text(
modifier = [Link]([Link]),
fontWeight = [Link],
text = "Final",
style = TextStyle(
letterSpacing = [Link],
)
)
}
Spacer(modifier = [Link]([Link]))
Row(
modifier = [Link](),
horizontalArrangement = [Link],
verticalAlignment = [Link]
) {
Box(
modifier = Modifier
.height([Link])
.width([Link])
.background(color = [Link], shape =
RoundedCornerShape([Link]))
.border(
width = [Link],
color = [Link],
shape = RoundedCornerShape([Link])
)
) {
Text(
modifier = Modifier
.padding([Link])
.align([Link]),
fontWeight = [Link],
textAlign = [Link],
text = "Clear",
color = [Link],
style = TextStyle(
letterSpacing = [Link],
)
)
}

Spacer(modifier = [Link]([Link])) // Add spacer for


spacing between the boxes

Box(
modifier = Modifier
.height([Link])
.width([Link])
.background(color = [Link], shape =
RoundedCornerShape([Link]))
.border(
width = [Link],
color = [Link],
shape = RoundedCornerShape([Link])
)
) {
Text(
modifier = Modifier
.padding([Link])
.align([Link]),
fontWeight = [Link],
textAlign = [Link],
text = "Calculate",
style = TextStyle(
letterSpacing = [Link],
)
)
}
}
}
}
}
}
}

@Preview
@Composable
fun STICalculatorPreview(){
STICalculator()
}

You might also like