Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • some-cleanup
  • v1.0.0
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.1.0
  • v1.1.1
  • v1.2.0
  • v1.2.2
  • v1.2.3
  • v1.2.4
12 results

Target

Select target project
  • jonas.broeckmann/kaffeekasse
1 result
Select Git revision
  • master
  • some-cleanup
  • v1.0.0
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.1.0
  • v1.1.1
  • v1.2.0
  • v1.2.2
  • v1.2.3
  • v1.2.4
12 results
Show changes
Commits on Source (9)
Showing
with 47 additions and 286 deletions
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/dictionaries
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
.gradle/
.idea/
.kotlin/
/app/release
/build/
/captures
*.iml
.externalNativeBuild
.cxx
local.properties
......
......@@ -11,7 +11,7 @@ image: eclipse-temurin:19-jdk-jammy
variables:
APP_VERSION: "1.2.4"
APP_VERSION: "1.2.5"
APP_APK: "kaffeekasse-${APP_VERSION}.apk"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/kaffeekasse/${APP_VERSION}"
......
# Default ignored files
/shelf/
/workspace.xml
.name
# GitHub Copilot persisted chat sessions
/copilot/chatSessions
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="RIGHT_MARGIN" value="130" />
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="19" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="19" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveExternalAnnotations" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AndroidLintUnsafeImplicitIntentLaunch" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinJpsPluginSettings">
<option name="version" value="2.0.10" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectMigrations">
<option name="MigrateToGradleLocalJavaHome">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</component>
</project>
\ No newline at end of file
<project version="4">
<component name="EntryPointsManager">
<list size="1">
<item index="0" class="java.lang.String" itemvalue="androidx.compose.runtime.Composable" />
</list>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="19" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
import com.android.build.api.dsl.ApplicationBuildType
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
......@@ -10,15 +8,14 @@ plugins {
android {
namespace = "net.novagamestudios.kaffeekasse"
compileSdk = 34
buildToolsVersion = "34.0.0"
compileSdk = 35
defaultConfig {
applicationId = "net.novagamestudios.kaffeekasse"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.2.4"
versionName = "1.2.5"
minSdk = 26
targetSdk = 35
// Check that the version in environment matches the version in build.gradle.kts
System.getenv()["APP_VERSION"]?.let { versionFromEnv ->
......@@ -33,12 +30,14 @@ android {
useSupportLibrary = true
}
}
buildFeatures {
compose = true
buildConfig = true
}
buildTypes {
fun ApplicationBuildType.debugCredentials(
fun com.android.build.api.dsl.ApplicationBuildType.debugCredentials(
portalUsername: Any?,
portalPassword: Any?,
kaffeekasseDeviceId: Any?,
......@@ -51,7 +50,7 @@ android {
buildConfigField("String", "I11_KAFFEEKASSE_DEBUG_APIKEY", kaffeekasseApiKey.toStringField())
}
fun ApplicationBuildType.releaseConfig() {
fun com.android.build.api.dsl.ApplicationBuildType.releaseConfig() {
// isMinifyEnabled = true
// isShrinkResources = true
proguardFiles(
......@@ -61,11 +60,11 @@ android {
debugCredentials(null, null, null, null)
}
fun ApplicationBuildType.debugConfig() {
fun com.android.build.api.dsl.ApplicationBuildType.debugConfig() {
proguardFiles(
"proguard-rules.pro"
)
com.android.build.gradle.internal.cxx.configure.gradleLocalProperties(rootDir).let { properties ->
com.android.build.gradle.internal.cxx.configure.gradleLocalProperties(rootDir, providers).let { properties ->
debugCredentials(
properties["i11.portal.debug.username"],
properties["i11.portal.debug.password"],
......@@ -89,10 +88,12 @@ android {
signingConfig = signingConfigs.getByName("debug")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_19
targetCompatibility = JavaVersion.VERSION_19
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
......@@ -106,9 +107,11 @@ kotlin {
compilerOptions {
freeCompilerArgs.addAll(
"-Xcontext-receivers",
"-opt-in=androidx.compose.ui.ExperimentalComposeUiApi",
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi",
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api",
)
optIn.addAll(
"androidx.compose.ui.ExperimentalComposeUiApi",
"androidx.compose.foundation.ExperimentalFoundationApi",
"androidx.compose.material3.ExperimentalMaterial3Api",
)
}
}
......
......@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
......
......@@ -126,6 +126,7 @@ class App : Application(), RepositoryProvider, CoroutineScope by MainScope() + C
hiwiTrackerRepository
)
override val loginRepository = LoginRepository(
coroutineScope = this,
credentialsRepository = credentials,
settings = settingsRepository,
portal = portalRepository,
......
......@@ -2,4 +2,4 @@ package net.novagamestudios.kaffeekasse.model.credentials
val Login.isValid get() = username.isNotBlank() && password.isNotBlank()
val DeviceCredentials.isValid get() = deviceId.isNotBlank() && apiKey.isNotBlank()
val DeviceCredentials.isValid get() = deviceId.isNotBlank() && apiKey.isNotBlank() && deviceId.length == ((2 + 1) * 6 - 1)
......@@ -3,6 +3,12 @@ package net.novagamestudios.kaffeekasse.model.session
import kotlinx.serialization.Serializable
import net.novagamestudios.kaffeekasse.model.kaffeekasse.KnownItemGroup
/**
* A device (i.e. a tablet) that is used to interact with the Kaffeekasse.
*
* @property name The name of the device
* @property itemTypeId Represents the placement of the device
*/
@Serializable
data class Device(
val name: String?,
......
package net.novagamestudios.kaffeekasse.model.session
/**
* Represents a session.
*/
sealed interface Session : java.io.Serializable {
val data: String?
/**
* An empty session. No device or user is logged in.
*/
data object Empty : Session {
override val data: String? get() = null
}
/**
* A session with a logged in device. No user is logged in.
*/
interface WithDevice : Session {
val device: Device
}
/**
* A session with a logged in user. No device is logged in.
*/
interface WithRealUser : Session {
val realUser: User
}
/**
* A session with a logged in device and user.
*/
interface WithDeviceAndUser : Session, WithDevice, WithRealUser
companion object {
......