Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ dependencies {
implementation(libs.room.base)
ksp(libs.room.compiler)

implementation(libs.confettiKit)

implementation(libs.kotlinx.serialization.core)

// for tests
Expand Down
43 changes: 41 additions & 2 deletions app/src/main/java/at/bitfire/icsdroid/ui/nav/MainApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ import android.accounts.AccountManager
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.AcUnit
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.core.content.IntentCompat
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.rememberVectorPainter
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.zIndex
import androidx.core.app.ShareCompat
import androidx.core.content.IntentCompat
import androidx.core.os.BundleCompat
import androidx.lifecycle.viewmodel.navigation3.rememberViewModelStoreNavEntryDecorator
import androidx.navigation3.runtime.entry
Expand All @@ -31,10 +37,20 @@ import at.bitfire.icsdroid.R
import at.bitfire.icsdroid.service.ComposableStartupService
import at.bitfire.icsdroid.ui.partials.AlertDialog
import at.bitfire.icsdroid.ui.screen.AddSubscriptionScreen
import at.bitfire.icsdroid.ui.screen.InfoScreen
import at.bitfire.icsdroid.ui.screen.EditSubscriptionScreen
import at.bitfire.icsdroid.ui.screen.InfoScreen
import at.bitfire.icsdroid.ui.screen.SubscriptionsScreen
import io.github.vinceglb.confettikit.compose.ConfettiKit
import io.github.vinceglb.confettikit.core.Angle
import io.github.vinceglb.confettikit.core.Party
import io.github.vinceglb.confettikit.core.Position
import io.github.vinceglb.confettikit.core.Rotation
import io.github.vinceglb.confettikit.core.Spread
import io.github.vinceglb.confettikit.core.emitter.Emitter
import io.github.vinceglb.confettikit.core.models.Shape
import io.github.vinceglb.confettikit.core.models.Size
import java.util.ServiceLoader
import kotlin.time.Duration

/**
* Computes the correct initial destination from some intent:
Expand Down Expand Up @@ -102,6 +118,29 @@ fun MainApp(
else repeat(depth) { backStack.removeAt(backStack.lastIndex) }
}

ConfettiKit(
modifier = Modifier.fillMaxSize().zIndex(999f),
parties = listOf(
Party(
speed = 0f,
maxSpeed = 10f,
damping = 0.3f,
size = listOf(Size(20, mass = 2f)),
angle = Angle.BOTTOM,
spread = Spread.ROUND,
colors = listOf(0xb9d0eb, 0xa4abb3, 0x85b8f2),
emitter = Emitter(duration = Duration.INFINITE).perSecond(3),
position = Position.Relative(0.0, 0.0).between(Position.Relative(1.0, 0.0)),
shapes = listOf(
Shape.Vector(rememberVectorPainter(Icons.Default.AcUnit))
),
rotation = Rotation.disabled(),
fadeOutEnabled = false,
timeToLive = 15_000
)
)
)

NavDisplay(
entryDecorators = listOf(
rememberSceneSetupNavEntryDecorator(),
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ compose-material = "1.7.8"
compose-material3 = "1.3.2"
compose-runtime = "1.9.1"
compose-ui = "1.9.1"
confetti-kit = "0.6.0"
datastore = "1.1.7"
desugaring = "2.1.5"
hilt = "2.57.1"
Expand Down Expand Up @@ -61,6 +62,7 @@ compose-dialogs-color = { module = "com.maxkeppeler.sheets-compose-dialogs:color
compose-dialogs-core = { module = "com.maxkeppeler.sheets-compose-dialogs:core", version.ref = "compose-dialogs" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
compose-materialIconsExtended = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose-material" }
confettiKit = { module = "io.github.vinceglb:confettikit", version.ref = "confetti-kit" }
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose-ui" }
compose-ui-toolingPreview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose-ui" }
compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata", version.ref = "compose-runtime" }
Expand Down