Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
FelberMartin committed Jan 10, 2025
2 parents 24de40f + 1c736af commit 9ff4b2b
Show file tree
Hide file tree
Showing 280 changed files with 7,560 additions and 3,092 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] "
title: ""
labels: bug
assignees: ''

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE] "
title: ""
labels: feature
assignees: ''

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ captures
*.apk
/app/release/output-metadata.json

# Kotlin 2.0
.kotlin/

# Keystore files
*.jks
passwords
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@ FROM builder as app-image

COPY . .

ARG buildNumber=1
ENV bamboo_buildNumber=$buildNumber

ENTRYPOINT ["./gradlew"]
RUN ./gradlew build -Dskip.e2e=true -Dskip.debugVariants=true -Dskip.flavor.unrestricted=true
13 changes: 3 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")

import com.google.firebase.appdistribution.gradle.firebaseAppDistribution
import java.io.FileInputStream
import java.util.Properties
Expand All @@ -16,20 +14,15 @@ plugins {
id("com.google.gms.google-services")
id("com.google.firebase.appdistribution")
id("com.google.android.gms.oss-licenses-plugin")
id("io.sentry.android.gradle") version "4.14.0"
id("io.sentry.android.gradle") version "4.14.1"
id("artemis.android.room")
}

android {
namespace = "de.tum.informatics.www1.artemis.native_app.android"

val versionName = "1.0.0"
val versionCode =
if (!System.getenv("bamboo_buildNumber")
.isNullOrEmpty()
) System.getenv("bamboo_buildNumber")
?.toString()
?.toIntOrNull() ?: deriveVersionCodeFromGit() else deriveVersionCodeFromGit()
val versionName = "1.1.1"
val versionCode = deriveVersionCodeFromGit()

setProperty("archivesBaseName", "artemis-android-$versionName-$versionCode")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,19 @@ import android.app.Application
import android.app.NotificationChannel
import android.os.Bundle
import androidx.core.app.NotificationManagerCompat
import coil.ImageLoader
import coil.ImageLoaderFactory
import coil.memory.MemoryCache
import de.tum.informatics.www1.artemis.native_app.android.db.dbModule
import de.tum.informatics.www1.artemis.native_app.core.common.CurrentActivityListener
import de.tum.informatics.www1.artemis.native_app.core.data.dataModule
import de.tum.informatics.www1.artemis.native_app.core.datastore.datastoreModule
import de.tum.informatics.www1.artemis.native_app.core.device.deviceModule
import de.tum.informatics.www1.artemis.native_app.core.ui.uiModule
import de.tum.informatics.www1.artemis.native_app.core.websocket.websocketModule
import de.tum.informatics.www1.artemis.native_app.feature.courseregistration.courseRegistrationModule
import de.tum.informatics.www1.artemis.native_app.feature.courseview.courseViewModule
import de.tum.informatics.www1.artemis.native_app.feature.dashboard.dashboardModule
import de.tum.informatics.www1.artemis.native_app.feature.exerciseview.exerciseModule
import de.tum.informatics.www1.artemis.native_app.feature.lectureview.lectureModule
import de.tum.informatics.www1.artemis.native_app.feature.login.loginModule
import de.tum.informatics.www1.artemis.native_app.feature.metis.communicationModule
import coil3.ImageLoader
import coil3.PlatformContext
import coil3.SingletonImageLoader
import coil3.memory.MemoryCache
import de.tum.informatics.www1.artemis.native_app.core.common.ArtemisNotificationChannel
import de.tum.informatics.www1.artemis.native_app.feature.push.pushModule
import de.tum.informatics.www1.artemis.native_app.feature.quiz.quizParticipationModule
import de.tum.informatics.www1.artemis.native_app.feature.settings.settingsModule
import de.tum.informatics.www1.artemis.native_app.core.common.CurrentActivityListener
import io.sentry.Sentry
import kotlinx.coroutines.flow.MutableStateFlow
import org.koin.android.ext.koin.androidContext
import org.koin.androidx.workmanager.koin.workManagerFactory
import org.koin.core.context.startKoin

class ArtemisApplication : Application(), ImageLoaderFactory, CurrentActivityListener {
class ArtemisApplication : Application(), SingletonImageLoader.Factory, CurrentActivityListener {

override val currentActivity = MutableStateFlow<Activity?>(null)

Expand All @@ -48,24 +33,7 @@ class ArtemisApplication : Application(), ImageLoaderFactory, CurrentActivityLis
androidContext(this@ArtemisApplication)
workManagerFactory()

modules(
dataModule,
uiModule,
datastoreModule,
deviceModule,
websocketModule,
courseRegistrationModule,
courseViewModule,
dashboardModule,
loginModule,
exerciseModule,
communicationModule,
quizParticipationModule,
settingsModule,
lectureModule,
pushModule,
dbModule
)
modules(appModule)
}

ArtemisNotificationChannel.entries.forEach { notificationChannel ->
Expand All @@ -84,11 +52,11 @@ class ArtemisApplication : Application(), ImageLoaderFactory, CurrentActivityLis
registerActivityLifecycleCallbacks(this)
}

override fun newImageLoader(): ImageLoader =
override fun newImageLoader(context: PlatformContext): ImageLoader =
ImageLoader.Builder(this)
.memoryCache {
MemoryCache.Builder(this)
.maxSizePercent(0.25)
MemoryCache.Builder()
.maxSizePercent(context, 0.25)
.build()
}
.build()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package de.tum.informatics.www1.artemis.native_app.android

import de.tum.informatics.www1.artemis.native_app.android.db.dbModule
import de.tum.informatics.www1.artemis.native_app.core.data.dataModule
import de.tum.informatics.www1.artemis.native_app.core.datastore.datastoreModule
import de.tum.informatics.www1.artemis.native_app.core.device.deviceModule
import de.tum.informatics.www1.artemis.native_app.core.ui.uiModule
import de.tum.informatics.www1.artemis.native_app.core.websocket.websocketModule
import de.tum.informatics.www1.artemis.native_app.feature.courseregistration.courseRegistrationModule
import de.tum.informatics.www1.artemis.native_app.feature.courseview.courseViewModule
import de.tum.informatics.www1.artemis.native_app.feature.dashboard.dashboardModule
import de.tum.informatics.www1.artemis.native_app.feature.exerciseview.exerciseModule
import de.tum.informatics.www1.artemis.native_app.feature.lectureview.lectureModule
import de.tum.informatics.www1.artemis.native_app.feature.login.loginModule
import de.tum.informatics.www1.artemis.native_app.feature.metis.communicationModule
import de.tum.informatics.www1.artemis.native_app.feature.push.pushModule
import de.tum.informatics.www1.artemis.native_app.feature.quiz.quizParticipationModule
import de.tum.informatics.www1.artemis.native_app.feature.settings.settingsModule
import org.koin.dsl.module

val appModule = module { includes(
dataModule,
uiModule,
datastoreModule,
deviceModule,
websocketModule,
courseRegistrationModule,
courseViewModule,
dashboardModule,
loginModule,
exerciseModule,
communicationModule,
quizParticipationModule,
settingsModule,
lectureModule,
pushModule,
dbModule
)}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import de.tum.informatics.www1.artemis.native_app.feature.push.communication_not
CommunicationMessageEntity::class
],
exportSchema = true,
version = 11,
version = 12,
)
@TypeConverters(RoomTypeConverters::class)
abstract class AppDatabase : RoomDatabase() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import org.koin.dsl.module

val dbModule = module {
single { DatabaseProvider(androidContext()) }
single<de.tum.informatics.www1.artemis.native_app.feature.metis.shared.MetisDatabaseProvider> { MetisDatabaseProviderImpl(get()) }
single<MetisDatabaseProvider> { MetisDatabaseProviderImpl(get()) }
single<PushCommunicationDatabaseProvider> { PushCommunicationDatabaseProviderImpl(get()) }
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.navigation.navOptions
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
import de.tum.informatics.www1.artemis.native_app.android.BuildConfig
import de.tum.informatics.www1.artemis.native_app.android.R
import de.tum.informatics.www1.artemis.native_app.android.ui.theme.AppTheme
import de.tum.informatics.www1.artemis.native_app.core.common.withPrevious
import de.tum.informatics.www1.artemis.native_app.core.datastore.AccountService
import de.tum.informatics.www1.artemis.native_app.core.datastore.ServerConfigurationService
Expand All @@ -36,6 +37,8 @@ import de.tum.informatics.www1.artemis.native_app.core.ui.LocalLinkOpener
import de.tum.informatics.www1.artemis.native_app.core.ui.LocalWindowSizeClassProvider
import de.tum.informatics.www1.artemis.native_app.core.ui.WindowSizeClassProvider
import de.tum.informatics.www1.artemis.native_app.core.ui.alert.TextAlertDialog
import de.tum.informatics.www1.artemis.native_app.core.ui.markdown.link_resolving.LocalMarkdownLinkResolver
import de.tum.informatics.www1.artemis.native_app.core.ui.remote_images.LocalArtemisImageProvider
import de.tum.informatics.www1.artemis.native_app.feature.courseregistration.courseRegistration
import de.tum.informatics.www1.artemis.native_app.feature.courseregistration.navigateToCourseRegistration
import de.tum.informatics.www1.artemis.native_app.feature.courseview.ui.course_overview.course
Expand All @@ -53,7 +56,7 @@ import de.tum.informatics.www1.artemis.native_app.feature.lectureview.navigateTo
import de.tum.informatics.www1.artemis.native_app.feature.login.LoginScreen
import de.tum.informatics.www1.artemis.native_app.feature.login.loginScreen
import de.tum.informatics.www1.artemis.native_app.feature.login.navigateToLogin
import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.visiblemetiscontextreporter.ProvideLocalVisibleMetisContextManager
import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.visiblemetiscontextreporter.LocalVisibleMetisContextManager
import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.visiblemetiscontextreporter.VisibleMetisContext
import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.visiblemetiscontextreporter.VisibleMetisContextManager
import de.tum.informatics.www1.artemis.native_app.feature.metis.shared.visiblemetiscontextreporter.VisibleMetisContextReporter
Expand All @@ -73,6 +76,7 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import org.koin.android.ext.android.get
import org.koin.compose.koinInject

/**
* Main and only activity used in the android app.
Expand Down Expand Up @@ -134,8 +138,8 @@ class MainActivity : AppCompatActivity(),

setContent {
AppTheme {
ProvideLocalVisibleMetisContextManager(
visibleMetisContextManager = visibleMetisContextManager
CompositionLocalProvider(
LocalVisibleMetisContextManager provides visibleMetisContextManager,
) {
val navController = rememberNavController()

Expand Down Expand Up @@ -251,7 +255,9 @@ class MainActivity : AppCompatActivity(),

CompositionLocalProvider(
LocalWindowSizeClassProvider provides windowSizeClassProvider,
LocalLinkOpener provides linkOpener
LocalLinkOpener provides linkOpener,
LocalArtemisImageProvider provides koinInject(),
LocalMarkdownLinkResolver provides koinInject()
) {
// Use jetpack compose navigation for the navigation logic.
NavHost(navController = navController, startDestination = startDestination) {
Expand Down
Loading

0 comments on commit 9ff4b2b

Please sign in to comment.