Compare commits
2 Commits
50eb19a464
...
15cadb76c6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15cadb76c6 | ||
|
|
41b54f15ea |
@@ -39,6 +39,7 @@ import androidx.compose.runtime.remember
|
|||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.scale
|
||||||
import androidx.compose.ui.text.style.TextDecoration
|
import androidx.compose.ui.text.style.TextDecoration
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.content.ContextCompat.startActivity
|
import androidx.core.content.ContextCompat.startActivity
|
||||||
@@ -212,7 +213,7 @@ fun StundenplanContent(activity: ComponentActivity, loadedLessons: List<List<Les
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
//Else creation of a Box containing all the information from the LessonData object
|
//Else creation of a Box containing all the information from the LessonData object
|
||||||
else if (dailyLessons != emptyList<LessonData>()) {
|
else if (dailyLessons != emptyList<LessonData>() && dailyLessons.size != extraIndex) {
|
||||||
LessonBox(subject = dailyLessons[extraIndex].subject, teacher = dailyLessons[extraIndex].teacher, room = dailyLessons[extraIndex].room)
|
LessonBox(subject = dailyLessons[extraIndex].subject, teacher = dailyLessons[extraIndex].teacher, room = dailyLessons[extraIndex].room)
|
||||||
//ExtraIndex counted up only here as it does only index the lessons and NOT the breaks
|
//ExtraIndex counted up only here as it does only index the lessons and NOT the breaks
|
||||||
extraIndex++
|
extraIndex++
|
||||||
@@ -371,7 +372,9 @@ fun InfoColumn(loadedLessons: List<List<LessonData>>, breakAmnt: Int, breaksStar
|
|||||||
) {
|
) {
|
||||||
//"Pause" String instead of indexing
|
//"Pause" String instead of indexing
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.align(Alignment.Center),
|
modifier = Modifier
|
||||||
|
.align(Alignment.Center)
|
||||||
|
.scale(1.1f),
|
||||||
text = "Pause",
|
text = "Pause",
|
||||||
textDecoration = TextDecoration.Underline,
|
textDecoration = TextDecoration.Underline,
|
||||||
style = MaterialTheme.typography.labelLarge
|
style = MaterialTheme.typography.labelLarge
|
||||||
@@ -380,7 +383,8 @@ fun InfoColumn(loadedLessons: List<List<LessonData>>, breakAmnt: Int, breaksStar
|
|||||||
Text(
|
Text(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.BottomCenter)
|
.align(Alignment.BottomCenter)
|
||||||
.padding(3.dp),
|
.padding(3.dp)
|
||||||
|
.scale(0.8f),
|
||||||
text = formattedBreakTime,
|
text = formattedBreakTime,
|
||||||
style = MaterialTheme.typography.labelMedium
|
style = MaterialTheme.typography.labelMedium
|
||||||
)
|
)
|
||||||
@@ -407,7 +411,9 @@ fun InfoColumn(loadedLessons: List<List<LessonData>>, breakAmnt: Int, breaksStar
|
|||||||
) {
|
) {
|
||||||
//String with the indexing of the lessons
|
//String with the indexing of the lessons
|
||||||
Text(
|
Text(
|
||||||
modifier = Modifier.align(Alignment.Center),
|
modifier = Modifier
|
||||||
|
.align(Alignment.Center)
|
||||||
|
.scale(1.1f),
|
||||||
text = "${i + 1 - lessonNegIncrement}:",
|
text = "${i + 1 - lessonNegIncrement}:",
|
||||||
textDecoration = TextDecoration.Underline,
|
textDecoration = TextDecoration.Underline,
|
||||||
style = MaterialTheme.typography.labelLarge
|
style = MaterialTheme.typography.labelLarge
|
||||||
@@ -416,7 +422,8 @@ fun InfoColumn(loadedLessons: List<List<LessonData>>, breakAmnt: Int, breaksStar
|
|||||||
Text(
|
Text(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.BottomCenter)
|
.align(Alignment.BottomCenter)
|
||||||
.padding(3.dp),
|
.padding(3.dp)
|
||||||
|
.scale(0.8f),
|
||||||
text = substringHelper(extraIndex, firstLesson, lessonLength, lessonTimeIncrement),
|
text = substringHelper(extraIndex, firstLesson, lessonLength, lessonTimeIncrement),
|
||||||
style = MaterialTheme.typography.labelMedium
|
style = MaterialTheme.typography.labelMedium
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -492,7 +492,7 @@ fun TimeTableSetupContent(activity: ComponentActivity, loadedLessons: List<Lesso
|
|||||||
lessons = lessons + LessonData("", "", "")
|
lessons = lessons + LessonData("", "", "")
|
||||||
}
|
}
|
||||||
while (currentLessonAmount.toInt() < lessons.size) {
|
while (currentLessonAmount.toInt() < lessons.size) {
|
||||||
lessons = lessons.drop(1)
|
lessons = lessons.dropLast(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
lessons.forEachIndexed { index, lessonData ->
|
lessons.forEachIndexed { index, lessonData ->
|
||||||
@@ -555,6 +555,7 @@ fun TimeTableSetupContent(activity: ComponentActivity, loadedLessons: List<Lesso
|
|||||||
colors = inputFieldColors,
|
colors = inputFieldColors,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
saveLessonsUsage(activity, lessons, state)
|
||||||
}
|
}
|
||||||
//save an empty list into DataStore currentLessonAmount == 0
|
//save an empty list into DataStore currentLessonAmount == 0
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user