Skip to content

Commit 34b59a2

Browse files
leandroBorgesFerreiraLeandro Ferreira
andauthored
Feedback on sync in android (#529)
* Extracting url of sync - Now it prints the sync time * Fixing last sync * Fixing button padding for android * Update CommonButton.kt --------- Co-authored-by: Leandro Ferreira <[email protected]>
1 parent 7ce0654 commit 34b59a2

File tree

8 files changed

+20
-5
lines changed

8 files changed

+20
-5
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package io.writeopia.commonui.buttons
2+
3+
actual fun verticalPaddingCommonButton(): Int = 10

application/core/common_ui/src/commonMain/kotlin/io/writeopia/commonui/buttons/CommonButton.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fun CommonButton(
7676
.background(lockButtonColor, shape)
7777
.clip(shape)
7878
.clickable(onClick = clickListener)
79-
.padding(horizontal = 10.dp, vertical = 6.dp)
79+
.padding(horizontal = 10.dp, vertical = verticalPaddingCommonButton().dp)
8080
) {
8181
if (icon != null) {
8282
Icon(
@@ -120,7 +120,7 @@ fun CommonTextButton(
120120
.background(lockButtonColor, shape)
121121
.clip(shape)
122122
.clickable(onClick = clickListener)
123-
.padding(horizontal = 10.dp, vertical = 6.dp)
123+
.padding(horizontal = 10.dp, vertical = verticalPaddingCommonButton().dp)
124124
) {
125125
Text(
126126
text,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package io.writeopia.commonui.buttons
2+
3+
expect fun verticalPaddingCommonButton(): Int
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package io.writeopia.commonui.buttons
2+
3+
actual fun verticalPaddingCommonButton(): Int = 6
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package io.writeopia.commonui.buttons
2+
3+
actual fun verticalPaddingCommonButton(): Int = 6
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package io.writeopia.commonui.buttons
2+
3+
actual fun verticalPaddingCommonButton(): Int = 6

application/core/documents/src/commonMain/kotlin/io/writeopia/core/folders/api/DocumentsApi.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ class DocumentsApi(private val client: HttpClient, private val baseUrl: String)
4848
lastSync: Instant,
4949
token: String
5050
): ResultData<Pair<List<Document>, List<Folder>>> {
51-
println("getting workspace new data: $baseUrl/api/workspace/diff")
52-
53-
val response = client.post("$baseUrl/api/workspace/diff") {
51+
val url = "$baseUrl/api/workspace/diff"
52+
val response = client.post(url) {
5453
contentType(ContentType.Application.Json)
5554
setBody(WorkspaceDiffRequest(workspaceId, lastSync.toEpochMilliseconds()))
5655
header(HttpHeaders.Authorization, "Bearer $token")

plugins/writeopia_persistence_room/src/commonMain/kotlin/io/writeopia/sdk/persistence/parse/DocumentParse.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fun Document.toEntity() = DocumentEntity(
2323
title = title,
2424
createdAt = createdAt.toEpochMilliseconds(),
2525
lastUpdatedAt = lastUpdatedAt.toEpochMilliseconds(),
26+
lastSyncedAt = lastSyncedAt?.toEpochMilliseconds(),
2627
workspaceId = workspaceId,
2728
favorite = favorite,
2829
parentId = parentId,

0 commit comments

Comments
 (0)