Skip to content
Snippets Groups Projects
Commit 39101dd1 authored by Jonas Broeckmann's avatar Jonas Broeckmann
Browse files

Cleanup a bit

parent 31094f49
No related branches found
No related tags found
No related merge requests found
import com.android.build.api.dsl.ApplicationBuildType
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
......@@ -39,7 +37,7 @@ android {
}
buildTypes {
fun ApplicationBuildType.debugCredentials(
fun com.android.build.api.dsl.ApplicationBuildType.debugCredentials(
portalUsername: Any?,
portalPassword: Any?,
kaffeekasseDeviceId: Any?,
......@@ -52,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(
......@@ -62,18 +60,18 @@ 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 ->
// debugCredentials(
// properties["i11.portal.debug.username"],
// properties["i11.portal.debug.password"],
// properties["i11.kaffeekasse.debug.deviceid"],
// properties["i11.kaffeekasse.debug.apikey"]
// )
// }
com.android.build.gradle.internal.cxx.configure.gradleLocalProperties(rootDir, providers).let { properties ->
debugCredentials(
properties["i11.portal.debug.username"],
properties["i11.portal.debug.password"],
properties["i11.kaffeekasse.debug.deviceid"],
properties["i11.kaffeekasse.debug.apikey"]
)
}
}
release {
......@@ -107,6 +105,9 @@ android {
kotlin {
compilerOptions {
freeCompilerArgs.addAll(
"-Xcontext-receivers",
)
optIn.addAll(
"androidx.compose.ui.ExperimentalComposeUiApi",
"androidx.compose.foundation.ExperimentalFoundationApi",
......
......@@ -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 {
......
......@@ -2,9 +2,14 @@ package net.novagamestudios.kaffeekasse.model.session
import kotlinx.serialization.Serializable
/**
* A user of the kaffeekasse that can be logged in.
*
* @param user The user name
* @param displayName The display name of the user. This is usually the first and last name separated by a space.
*/
@Serializable
data class User(
val user: String? = null,
val displayName: String? = null
) : java.io.Serializable
......@@ -17,12 +17,12 @@ import io.woong.compose.grid.SimpleGridCells
import io.woong.compose.grid.VerticalGrid
@Composable
inline fun <T> LazyBasicCardGrid(
fun <T> LazyBasicCardGrid(
items: List<T>,
modifier: Modifier = Modifier,
scrollable: Boolean = true,
spacerForFAB: Boolean = false,
crossinline itemContent: @Composable LazyGridItemScope.(T) -> Unit
itemContent: @Composable LazyGridItemScope.(T) -> Unit
) = LazyVerticalGrid(
columns = GridCells.Adaptive(170.dp),
modifier,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment