Skip to content
Open
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.15.0 (unreleased)

- Update Kotlin to 2.4.10.
- Compile against Android SDK 37.

## 1.14.1

- Fix publish structure for Sonatype bundles.
Expand Down
1 change: 0 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ kotlin {
api(libs.androidx.sqlite.sqlite)
implementation(libs.androidx.sqlite.async)

implementation(libs.uuid)
implementation(libs.kotlin.stdlib)
implementation(libs.ktor.client.contentnegotiation)
implementation(libs.ktor.serialization.json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ internal fun SQLiteStatement.bind(parameters: List<Any?>?) {
}

else -> {
if (parameter != null) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We handle a null case above, so this always evaluates to true.

throw IllegalArgumentException("Unsupported parameter type: ${parameter::class}, at index $index")
}
throw IllegalArgumentException("Unsupported parameter type: ${parameter::class}, at index $index")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ kotlin {
sourceSets {
commonMain.dependencies {
api(projects.core)
implementation(compose.runtime)
implementation(libs.compose.runtime)
}
val commonNonWebMain = create("commonNonWebMain") {
dependsOn(commonMain.get())
Expand All @@ -46,7 +46,7 @@ kotlin {
}

androidMain.dependencies {
implementation(compose.foundation)
implementation(libs.compose.foundation)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion demos/android-supabase-todolist/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ dependencies {
implementation(projects.core) // "com.powersync:core:latest.release"
implementation(projects.integrations.supabase) // "com.powersync:connector-supabase:latest.release"
implementation(projects.compose) // "com.powersync:compose:latest.release"
implementation(libs.uuid)
implementation(libs.kermit)
implementation(libs.androidx.material.icons.extended)
implementation(libs.androidx.activity.ktx)
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-todolist/androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {

dependencies {
implementation(projects.demos.supabaseTodolist.shared)
implementation(compose.material)
implementation(libs.compose.material)
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies {

implementation(projects.demos.supabaseTodolist.shared)

implementation(compose.material)
implementation(libs.compose.material)
implementation(libs.androidx.core)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.service)
Expand Down
14 changes: 6 additions & 8 deletions demos/supabase-todolist/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
version = "1.0-SNAPSHOT"

kotlin {
androidLibrary {
android {
namespace = "com.powersync.demos.shared"
compileSdk =
libs.versions.android.compileSdk
Expand Down Expand Up @@ -49,12 +49,10 @@ kotlin {
api(projects.core) // "com.powersync:core"
implementation(projects.integrations.supabase) // "com.powersync:connector-supabase"
implementation(projects.compose) // "com.powersync:compose"
implementation(libs.uuid)
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.components.resources)
implementation(compose.materialIconsExtended)
implementation(libs.compose.runtime)
implementation(libs.compose.foundation)
implementation(libs.compose.material)
implementation(libs.compose.components.resources)
implementation(libs.kmp.lifecycle.compose)
implementation(libs.supabase.client)
api(libs.koin.core)
Expand All @@ -68,7 +66,7 @@ kotlin {
}

jvmMain.dependencies {
implementation(compose.desktop.common)
implementation(libs.compose.desktop)
implementation(libs.kotlinx.coroutines.swing)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="#000000"
android:pathData="M440,520L200,520L200,440L440,440L440,200L520,200L520,440L760,440L760,520L520,520L520,760L440,760L440,520Z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:autoMirrored="true">
<path
android:fillColor="#000000"
android:pathData="M313,520L537,744L480,800L160,480L480,160L537,216L313,440L800,440L800,520L313,520Z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="#000000"
android:pathData="M260,800Q169,800 104.5,737Q40,674 40,583Q40,505 87,444Q134,383 210,366Q235,274 310,217Q385,160 480,160Q597,160 678.5,241.5Q760,323 760,440L760,440L760,440Q829,448 874.5,499.5Q920,551 920,620Q920,695 867.5,747.5Q815,800 740,800L260,800ZM260,720L740,720Q782,720 811,691Q840,662 840,620Q840,578 811,549Q782,520 740,520L680,520L680,440Q680,357 621.5,298.5Q563,240 480,240Q397,240 338.5,298.5Q280,357 280,440L280,440L260,440Q202,440 161,481Q120,522 120,580Q120,638 161,679Q202,720 260,720ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480L480,480L480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480L480,480L480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="#000000"
android:pathData="M792,904L686,800L260,800Q168,800 104,736Q40,672 40,580Q40,503 87.5,443Q135,383 210,366Q213,358 216,350.5Q219,343 222,334L56,168L112,112L848,848L792,904ZM260,720L606,720L284,398Q282,409 281,419Q280,429 280,440L260,440Q202,440 161,481Q120,522 120,580Q120,638 161,679Q202,720 260,720ZM445,559Q445,559 445,559Q445,559 445,559Q445,559 445,559Q445,559 445,559L445,559Q445,559 445,559Q445,559 445,559L445,559L445,559ZM864,750L806,694Q823,680 831.5,661.5Q840,643 840,620Q840,578 811,549Q782,520 740,520L680,520L680,440Q680,357 621.5,298.5Q563,240 480,240Q453,240 428,246.5Q403,253 380,267L322,209Q357,185 396.5,172.5Q436,160 480,160Q597,160 678.5,241.5Q760,323 760,440L760,440L760,440Q829,448 874.5,499.5Q920,551 920,620Q920,659 905,692.5Q890,726 864,750ZM593,481L593,481L593,481Q593,481 593,481Q593,481 593,481Q593,481 593,481Q593,481 593,481L593,481L593,481Q593,481 593,481Q593,481 593,481Q593,481 593,481Q593,481 593,481Z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="#000000"
android:pathData="M160,800L160,720L269,720Q218,676 189,614Q160,552 160,480Q160,368 228,282.5Q296,197 400,170L400,254Q330,279 285,340.5Q240,402 240,480Q240,534 261.5,579.5Q283,625 320,658L320,560L400,560L400,800L160,800ZM600,800Q550,800 515,765Q480,730 480,680Q480,632 513,597.5Q546,563 594,561Q611,525 644.5,502.5Q678,480 720,480Q773,480 811.5,514.5Q850,549 858,600L858,600Q900,600 930,629Q960,658 960,699Q960,741 931,770.5Q902,800 860,800L600,800ZM716,440Q709,399 689,364Q669,329 640,302L640,400L560,400L560,160L800,160L800,240L691,240Q734,278 761.5,329Q789,380 797,440L716,440ZM600,720L860,720Q868,720 874,714Q880,708 880,700Q880,692 874,686Q868,680 860,680L790,680L790,630Q790,601 769.5,580.5Q749,560 720,560Q691,560 670.5,580.5Q650,601 650,630L650,640L600,640Q583,640 571.5,651.5Q560,663 560,680Q560,697 571.5,708.5Q583,720 600,720ZM720,640Q720,640 720,640Q720,640 720,640Q720,640 720,640Q720,640 720,640L720,640L720,640Q720,640 720,640Q720,640 720,640Q720,640 720,640Q720,640 720,640L720,640L720,640Q720,640 720,640Q720,640 720,640Q720,640 720,640Q720,640 720,640Z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="#000000"
android:pathData="M280,840Q247,840 223.5,816.5Q200,793 200,760L200,240L160,240L160,160L360,160L360,120L600,120L600,160L800,160L800,240L760,240L760,760Q760,793 736.5,816.5Q713,840 680,840L280,840ZM680,240L280,240L280,760Q280,760 280,760Q280,760 280,760L680,760Q680,760 680,760Q680,760 680,760L680,240ZM360,680L440,680L440,320L360,320L360,680ZM520,680L600,680L600,320L520,320L520,680ZM280,240L280,240L280,760Q280,760 280,760Q280,760 280,760L280,760Q280,760 280,760Q280,760 280,760L280,240Z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="#000000"
android:pathData="M120,560L120,480Q194,480 259.5,451.5Q325,423 374,374Q423,325 451.5,259.5Q480,194 480,120L560,120Q560,211 525.5,291Q491,371 431,431Q371,491 291,525.5Q211,560 120,560ZM120,400L120,320Q203,320 261.5,261.5Q320,203 320,120L400,120Q400,236 318,318Q236,400 120,400ZM120,240L120,120L240,120Q240,170 205,205Q170,240 120,240ZM400,840Q400,749 434.5,669Q469,589 529,529Q589,469 669,434.5Q749,400 840,400L840,480Q766,480 700.5,508.5Q635,537 586,586Q537,635 508.5,700.5Q480,766 480,840L400,840ZM560,840Q560,724 642,642Q724,560 840,560L840,640Q757,640 698.5,698.5Q640,757 640,840L560,840ZM720,840Q720,790 755,755Q790,720 840,720L840,840L720,840Z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="#000000"
android:pathData="M120,720L120,640L840,640L840,720L120,720ZM120,520L120,440L840,440L840,520L120,520ZM120,320L120,240L840,240L840,320L120,320Z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="#000000"
android:pathData="M300,920L336,820L260,820L310,680L410,680L367,780L450,780L340,920L300,920ZM570,880L598,800L520,800L563,680L663,680L628,760L710,760L610,880L570,880ZM300,640Q209,640 144.5,575.5Q80,511 80,420Q80,337 135,275Q190,213 271,202Q303,145 358.5,112.5Q414,80 480,80Q570,80 636.5,137.5Q703,195 717,281Q786,287 833,338Q880,389 880,460Q880,535 827.5,587.5Q775,640 700,640L300,640ZM300,560L700,560Q742,560 771,531Q800,502 800,460Q800,418 771,389Q742,360 700,360L640,360L640,320Q640,254 593,207Q546,160 480,160Q432,160 392.5,186Q353,212 333,256L323,280L298,280Q241,282 200.5,322.5Q160,363 160,420Q160,478 201,519Q242,560 300,560ZM480,360L480,360Q480,360 480,360Q480,360 480,360Q480,360 480,360Q480,360 480,360L480,360L480,360Q480,360 480,360Q480,360 480,360Q480,360 480,360Q480,360 480,360L480,360L480,360Q480,360 480,360Q480,360 480,360Q480,360 480,360Q480,360 480,360Z"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import org.koin.core.KoinApplication
import org.koin.core.module.dsl.bind
import org.koin.core.module.dsl.viewModelOf
import org.koin.core.module.dsl.withOptions
import org.koin.dsl.koinConfiguration
import org.koin.dsl.module

val sharedAppModule = module {
Expand All @@ -59,7 +60,7 @@ fun App(
modules(module { single { openPowerSync(schema) } }, sharedAppModule)
}

KoinApplication(application = KoinApplication::withDatabase) {
KoinApplication(koinConfiguration { withDatabase() }) {
AppContent(modifier=modifier)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.key.Key
import androidx.compose.ui.unit.dp
import com.powersync.demos.Screen
import com.powersync.demos.onKeyUp
import org.jetbrains.compose.resources.painterResource
import powersync_root.demos.supabase_todolist.shared.generated.resources.Res
import powersync_root.demos.supabase_todolist.shared.generated.resources.add

@Composable
internal fun Input(
Expand All @@ -39,7 +40,7 @@ internal fun Input(

IconButton(onClick = onAddClicked) {
Icon(
imageVector = Icons.Default.Add,
painter = painterResource(Res.drawable.add),
contentDescription = null
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Delete
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -17,6 +15,9 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.powersync.demos.MARGIN_SCROLLBAR
import com.powersync.demos.powersync.ListItem
import org.jetbrains.compose.resources.painterResource
import powersync_root.demos.supabase_todolist.shared.generated.resources.Res
import powersync_root.demos.supabase_todolist.shared.generated.resources.delete

@Composable
internal fun ListItem(
Expand All @@ -38,7 +39,7 @@ internal fun ListItem(

IconButton(onClick = onDeleteClicked) {
Icon(
imageVector = Icons.Default.Delete,
painter = painterResource(Res.drawable.delete),
contentDescription = null
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package com.powersync.demos.components

import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Menu
import androidx.compose.runtime.*
import org.jetbrains.compose.resources.painterResource
import powersync_root.demos.supabase_todolist.shared.generated.resources.Res
import powersync_root.demos.supabase_todolist.shared.generated.resources.menu

@Composable
fun Menu(
Expand All @@ -17,7 +18,7 @@ fun Menu(
title = { Text("Your App") },
navigationIcon = {
IconButton(onClick = { expanded = true }) {
Icon(Icons.Default.Menu, contentDescription = "Menu")
Icon(painter = painterResource(Res.drawable.menu), contentDescription = "Menu")
}
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import androidx.compose.material.Checkbox
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Delete
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -18,6 +16,9 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.powersync.demos.MARGIN_SCROLLBAR
import com.powersync.demos.powersync.TodoItem
import org.jetbrains.compose.resources.painterResource
import powersync_root.demos.supabase_todolist.shared.generated.resources.Res
import powersync_root.demos.supabase_todolist.shared.generated.resources.delete

@Composable
internal fun TodoItem(
Expand Down Expand Up @@ -48,7 +49,7 @@ internal fun TodoItem(

IconButton(onClick = onDeleteClicked) {
Icon(
imageVector = Icons.Default.Delete,
painter = painterResource(Res.drawable.delete),
contentDescription = null
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
package com.powersync.demos.components

import androidx.compose.material.Icon
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Cloud
import androidx.compose.material.icons.filled.CloudOff
import androidx.compose.material.icons.filled.CloudSync
import androidx.compose.material.icons.filled.LeakAdd
import androidx.compose.material.icons.filled.Thunderstorm
import androidx.compose.runtime.Composable
import com.powersync.sync.SyncStatusData
import org.jetbrains.compose.resources.painterResource
import powersync_root.demos.supabase_todolist.shared.generated.resources.Res
import powersync_root.demos.supabase_todolist.shared.generated.resources.cloud
import powersync_root.demos.supabase_todolist.shared.generated.resources.cloud_off
import powersync_root.demos.supabase_todolist.shared.generated.resources.cloud_sync
import powersync_root.demos.supabase_todolist.shared.generated.resources.leak_add
import powersync_root.demos.supabase_todolist.shared.generated.resources.thunderstorm

@Composable
fun WifiIcon(status: SyncStatusData) {
val icon =
when {
status.downloading || status.uploading -> Icons.Filled.CloudSync
status.connected -> Icons.Filled.Cloud
!status.connected -> Icons.Filled.CloudOff
status.connecting -> Icons.Filled.LeakAdd
status.downloading || status.uploading -> Res.drawable.cloud_sync
status.connected -> Res.drawable.cloud
!status.connected -> Res.drawable.cloud_off
status.connecting -> Res.drawable.leak_add
else -> {
Icons.Filled.Thunderstorm
Res.drawable.thunderstorm
}
}

Icon(
imageVector = icon,
painter = painterResource(icon),
contentDescription = status.toString(),
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
Expand All @@ -23,6 +21,9 @@ import com.powersync.demos.components.TodoList
import com.powersync.demos.components.WifiIcon
import com.powersync.demos.powersync.TodoItem
import com.powersync.sync.SyncStatusData
import org.jetbrains.compose.resources.painterResource
import powersync_root.demos.supabase_todolist.shared.generated.resources.Res
import powersync_root.demos.supabase_todolist.shared.generated.resources.arrow_back

@Composable
internal fun TodosScreen(
Expand All @@ -48,7 +49,7 @@ internal fun TodosScreen(
},
navigationIcon = {
IconButton(onClick = { navController.navigate(Screen.Home) }) {
Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = "Go back")
Icon(painter = painterResource(Res.drawable.arrow_back), contentDescription = "Go back")
}
},
actions = {
Expand Down
Loading
Loading