Skip to content

Commit

Permalink
resolved merge confict
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-wls committed Nov 26, 2024
2 parents 9f68876 + a8098e9 commit 9c6ac81
Show file tree
Hide file tree
Showing 46 changed files with 667 additions and 183 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

**Describe the bug**
### Describe the bug
A clear and concise description of what the bug is.

**To Reproduce**
Expand All @@ -20,8 +20,8 @@ Steps to reproduce the behavior:
**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
### Screenshots
If applicable, add screenshots to help explain your problem.

**Additional context**
### Additional context
Add any other context about the problem here.
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Feel free to leave out sections that are not appropriate for your PR. -->

### Problem Description


### Changes
<!-- Descripe your changes on a high level. If you feel like technical details would be helpful for the reviewer, please add them here. -->


### Steps for testing


### Screenshots
5 changes: 5 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
pull_request:
workflow_dispatch:

permissions:
id-token: write
contents: read
checks: write

jobs:
end-to-end-tests:
name: E2E Tests
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
pull_request:
workflow_dispatch:

permissions:
id-token: write
contents: read
checks: write

jobs:
jUnit:
name: JUnit Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class MainActivity : AppCompatActivity(),

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()

// When the user is logged in, immediately display the course overview.
val startDestination = runBlocking {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
`kotlin-dsl`
kotlin("jvm") version "1.8.10"
kotlin("plugin.serialization") version "1.8.10"
kotlin("plugin.serialization") version "2.0.21"
// id("java-gradle-plugin")
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package de.tum.informatics.www1.artemis.native_app.core.test.test_setup

val DefaultTimeoutMillis: Long get() = System.getenv("DEFAULT_TIMEOUT")?.toLong() ?: 10000L
val DefaultTimeoutMillis: Long get() = System.getenv("DEFAULT_TIMEOUT")?.toLong() ?: 15000L
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,22 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.ime
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeContent
import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyGridItemScope
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
Expand Down Expand Up @@ -71,7 +81,9 @@ fun CourseItemGrid(
columns = GridCells.Fixed(columnCount),
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
contentPadding = PaddingValues(bottom = 90.dp)
contentPadding = PaddingValues(
bottom = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
)
) {
items(courses, key = { it.course.id ?: 0L }) { course ->
courseItem(course, courseItemModifier, isCompact)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
Expand Down Expand Up @@ -140,7 +144,8 @@ internal fun RegisterForCourseScreen(
RegisterForCourseContent(
modifier = Modifier
.fillMaxSize()
.padding(padding)
.padding(top = padding.calculateTopPadding())
.consumeWindowInsets(WindowInsets.systemBars)
.padding(horizontal = 8.dp),
courses = courses,
serverUrl = properServerUrl,
Expand Down Expand Up @@ -235,6 +240,7 @@ private fun RegisterForCourseContent(
.fillMaxSize()
.testTag(TEST_TAG_REGISTRABLE_COURSE_LIST),
columns = GridCells.Fixed(columnCount),
contentPadding = WindowInsets.systemBars.asPaddingValues(),
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ package de.tum.informatics.www1.artemis.native_app.feature.courseview.ui
import android.os.Parcelable
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
Expand Down Expand Up @@ -71,7 +75,13 @@ internal fun <T> WeeklyItemsLazyColumn(
}
}

LazyColumn(modifier = modifier, verticalArrangement = verticalArrangement) {
LazyColumn(
modifier = modifier,
verticalArrangement = verticalArrangement,
contentPadding = PaddingValues(
bottom = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
)
) {
weeklyItemGroups.forEachIndexed { index, weeklyItems ->
item {
WeeklyItemsSectionHeader(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import androidx.compose.animation.slideInHorizontally
import androidx.compose.animation.slideOutHorizontally
import androidx.compose.animation.togetherWith
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
Expand Down Expand Up @@ -331,7 +334,8 @@ internal fun CourseUiScreen(
BasicDataStateUi(
modifier = Modifier
.fillMaxSize()
.padding(padding),
.padding(top = padding.calculateTopPadding())
.consumeWindowInsets(WindowInsets.systemBars),
dataState = courseDataState,
loadingText = stringResource(id = R.string.course_ui_loading_course_loading),
failureText = stringResource(id = R.string.course_ui_loading_course_failed),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
Expand Down Expand Up @@ -188,7 +193,8 @@ internal fun CoursesOverview(
BasicDataStateUi(
modifier = Modifier
.fillMaxSize()
.padding(padding),
.padding(top = padding.calculateTopPadding())
.consumeWindowInsets(WindowInsets.systemBars),
dataState = coursesDataState,
loadingText = stringResource(id = R.string.courses_loading_loading),
failureText = stringResource(id = R.string.courses_loading_failure),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ package de.tum.informatics.www1.artemis.native_app.feature.lectureview

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons
Expand All @@ -31,7 +35,12 @@ internal fun AttachmentsTab(
onClickOpenLinkAttachment: (Attachment) -> Unit
) {
if (attachments.isNotEmpty()) {
LazyColumn(modifier = modifier) {
LazyColumn(
modifier = modifier,
contentPadding = PaddingValues(
bottom = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
)
) {
items(attachments) { attachment ->
AttachmentItem(
modifier = Modifier.fillMaxWidth(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ internal fun LectureScreen(
) { padding ->
val bodyModifier = Modifier
.fillMaxSize()
.padding(padding)
.padding(top = padding.calculateTopPadding())

contentBody(
bodyModifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ package de.tum.informatics.www1.artemis.native_app.feature.lectureview

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.LazyListState
Expand Down Expand Up @@ -50,7 +55,10 @@ internal fun OverviewTab(
LazyColumn(
modifier = modifier.testTag(TEST_TAG_OVERVIEW_LIST),
verticalArrangement = Arrangement.spacedBy(16.dp),
state = state
state = state,
contentPadding = PaddingValues(
bottom = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
)
) {
if (description != null) {
item {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.ClickableText
import androidx.compose.foundation.verticalScroll
Expand Down Expand Up @@ -273,7 +278,9 @@ private fun LoginUiScreen(
NavHost(
modifier = Modifier
.fillMaxSize()
.padding(paddingValues),
.imePadding()
.consumeWindowInsets(WindowInsets.systemBars)
.padding(top = paddingValues.calculateTopPadding()),
navController = nestedNavController,
startDestination = if (hasSelectedInstance) NestedDestination.HOME.destination else NestedDestination.INSTANCE_SELECTION.destination
) {
Expand Down Expand Up @@ -463,7 +470,11 @@ private fun AccountUi(
ClickableText(
modifier = Modifier
.align(Alignment.CenterHorizontally)
.padding(bottom = 8.dp),
.padding(
bottom = WindowInsets.systemBars
.asPaddingValues()
.calculateBottomPadding()
),
text = AnnotatedString(stringResource(id = R.string.account_change_artemis_instance_label)),
style = MaterialTheme.typography.bodyMedium.copy(color = MaterialTheme.colorScheme.linkTextColor),
onClick = { onNavigateToInstanceSelection() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand Down Expand Up @@ -88,8 +89,9 @@ internal fun NotificationSettingsUi(modifier: Modifier, onDone: () -> Unit) {
Column(
modifier = Modifier
.fillMaxSize()
.padding(padding)
.padding(8.dp)
.imePadding()
.padding(top = padding.calculateTopPadding())
.padding(horizontal = 8.dp)
.verticalScroll(rememberScrollState())
) {
de.tum.informatics.www1.artemis.native_app.feature.push.ui.PushNotificationSettingsUi(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
Expand Down Expand Up @@ -79,7 +83,9 @@ internal fun InstanceSelectionScreen(
columns = GridCells.Fixed(columnCount),
horizontalArrangement = Arrangement.spacedBy(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
contentPadding = PaddingValues(bottom = 16.dp)
contentPadding = PaddingValues(
bottom = WindowInsets.systemBars.asPaddingValues().calculateBottomPadding()
)
) {
items(availableInstances) { instance ->
val item = GridCellItem.ArtemisInstanceGridCellItem(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package de.tum.informatics.www1.artemis.native_app.feature.login.login
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.rememberScrollState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Divider
Expand Down Expand Up @@ -92,7 +93,7 @@ internal fun RegisterUi(
}

Column(
modifier = modifier,
modifier = modifier.imePadding(),
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
val textFieldModifier = Modifier
Expand Down
Loading

0 comments on commit 9c6ac81

Please sign in to comment.