Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.powersync.androidexample
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.powersync.androidexample.ui.CameraService
import com.powersync.demos.App
Expand All @@ -15,6 +16,9 @@ class MainActivity : ComponentActivity() {

super.onCreate(savedInstanceState)

// Needed to render system bar properly
enableEdgeToEdge()

setContent {
App(
cameraService = cameraService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.powersync.demos.screens

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.unit.dp
import com.powersync.demos.AuthViewModel
Expand All @@ -24,10 +28,12 @@ internal fun SignInScreen(
var isLoading by remember { mutableStateOf(false) }

val coroutineScope = rememberCoroutineScope()
val scrollState = rememberScrollState()

Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(scrollState)
.padding(16.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
Expand All @@ -52,6 +58,7 @@ internal fun SignInScreen(
onValueChange = { password = it },
label = { Text("Password") },
visualTransformation = PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 16.dp)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.powersync.demos.screens

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.unit.dp
import com.powersync.demos.AuthViewModel
Expand All @@ -24,10 +28,12 @@ internal fun SignUpScreen(
var isLoading by remember { mutableStateOf(false) }

val coroutineScope = rememberCoroutineScope()
val scrollState = rememberScrollState()

Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(scrollState)
.padding(16.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
Expand All @@ -48,6 +54,7 @@ internal fun SignUpScreen(
onValueChange = { password = it },
label = { Text("Password") },
visualTransformation = PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 16.dp)
Expand All @@ -58,6 +65,7 @@ internal fun SignUpScreen(
onValueChange = { confirmPassword = it },
label = { Text("Confirm Password") },
visualTransformation = PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 16.dp)
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-todolist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ all items have been received.
1. Clone this repo: ```git clone https://github.com/powersync-ja/powersync-kotlin.git```
2. Open the repo in Android Studio. This creates a `local.properties` file in root and should contain a `sdk.dir=/path/to/android/sdk` line.
3. Sync the project with Gradle (this should happen automatically, or choose File > Sync project with Gradle Files).
4. Insert your Supabase project URL, Supabase Anon Key, and PowerSync instance URL into the `demos/supabase-todlist/local.properties` file:
4. Insert your Supabase project URL, Supabase Anon Key, and PowerSync instance URL into the `demos/supabase-todolist/local.properties` file:

```bash
# local.properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.powersync.demos

import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
Expand All @@ -11,6 +12,9 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

// Needed to render system bar properly
enableEdgeToEdge()

setContent {
MaterialTheme {
Surface(color = MaterialTheme.colors.background) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.powersync.demos.screens

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.unit.dp
import com.powersync.demos.AuthViewModel
Expand All @@ -24,13 +28,16 @@ internal fun SignInScreen(
var isLoading by remember { mutableStateOf(false) }

val coroutineScope = rememberCoroutineScope()
val scrollState = rememberScrollState()

Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(scrollState)
.padding(16.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
horizontalAlignment = Alignment.CenterHorizontally,

) {
Text(
"Sign In",
Expand All @@ -52,6 +59,7 @@ internal fun SignInScreen(
onValueChange = { password = it },
label = { Text("Password") },
visualTransformation = PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 16.dp)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.powersync.demos.screens

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.unit.dp
import com.powersync.demos.AuthViewModel
Expand All @@ -24,10 +28,12 @@ internal fun SignUpScreen(
var isLoading by remember { mutableStateOf(false) }

val coroutineScope = rememberCoroutineScope()
val scrollState = rememberScrollState()

Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(scrollState)
.padding(16.dp),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
Expand All @@ -48,6 +54,7 @@ internal fun SignUpScreen(
onValueChange = { password = it },
label = { Text("Password") },
visualTransformation = PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 16.dp)
Expand All @@ -58,6 +65,7 @@ internal fun SignUpScreen(
onValueChange = { confirmPassword = it },
label = { Text("Confirm Password") },
visualTransformation = PasswordVisualTransformation(),
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 16.dp)
Expand Down
Loading