Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit fe90503

Browse files
authored
Merge pull request #44 from dropbox/parcelable
Rename to passable
2 parents cec9f9d + 71f6a96 commit fe90503

File tree

24 files changed

+73
-71
lines changed

24 files changed

+73
-71
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.dropbox.componentbox.foundation
2+
3+
actual typealias IsPassable = kotlinx.android.parcel.Parcelize

componentbox/src/androidMain/kotlin/com/dropbox/componentbox/foundation/Parcelable.kt

Lines changed: 0 additions & 3 deletions
This file was deleted.

componentbox/src/androidMain/kotlin/com/dropbox/componentbox/foundation/Parcelize.kt

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.dropbox.componentbox.foundation
2+
3+
actual typealias Passable = android.os.Parcelable

componentbox/src/commonMain/kotlin/com/dropbox/componentbox/foundation/BorderStroke.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package com.dropbox.componentbox.foundation
22

33
import kotlinx.serialization.Serializable
44

5-
@Parcelize
5+
@IsPassable
66
@Serializable
77
data class BorderStroke(
88
val width: Int,
99
val color: Color
10-
): Parcelable
10+
): Passable

componentbox/src/commonMain/kotlin/com/dropbox/componentbox/foundation/ButtonVariant.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package com.dropbox.componentbox.foundation
22

33
import kotlinx.serialization.Serializable
44

5-
@Parcelize
5+
@IsPassable
66
@Serializable
7-
enum class ButtonVariant: Parcelable {
7+
enum class ButtonVariant: Passable {
88
Contained,
99
Text,
1010
Outlined,

componentbox/src/commonMain/kotlin/com/dropbox/componentbox/foundation/Component.kt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package com.dropbox.componentbox.foundation
33
import kotlinx.serialization.Serializable
44

55
@Serializable
6-
sealed class Component: Parcelable {
6+
sealed class Component: Passable {
77

8-
@Parcelize
8+
@IsPassable
99
@Serializable
1010
data class Box(
1111
val id: String,
@@ -14,9 +14,9 @@ sealed class Component: Parcelable {
1414
var horizontalArrangement: Arrangement? = null,
1515
var verticalAlignment: Alignment? = null,
1616
var action: String? = null,
17-
) : Component(), Parcelable
17+
) : Component(), Passable
1818

19-
@Parcelize
19+
@IsPassable
2020
@Serializable
2121
data class Row(
2222
val id: String,
@@ -26,9 +26,9 @@ sealed class Component: Parcelable {
2626
var verticalAlignment: Alignment? = null,
2727
var action: String? = null,
2828
var isLazy: Boolean? = null
29-
) : Component(), Parcelable
29+
) : Component(), Passable
3030

31-
@Parcelize
31+
@IsPassable
3232
@Serializable
3333
data class Column(
3434
val id: String,
@@ -39,19 +39,19 @@ sealed class Component: Parcelable {
3939
var isLazy: Boolean? = null,
4040
var isTable: Boolean? = null,
4141
var action: String? = null
42-
) : Component(), Parcelable
42+
) : Component(), Passable
4343

44-
@Parcelize
44+
@IsPassable
4545
@Serializable
4646
data class Text(
4747
val id: String,
4848
var modifier: Modifier? = null,
4949
var text: String? = null,
5050
var color: Color? = null,
5151
var textStyle: String? = null
52-
) : Component(), Parcelable
52+
) : Component(), Passable
5353

54-
@Parcelize
54+
@IsPassable
5555
@Serializable
5656
data class Button(
5757
val id: String,
@@ -60,18 +60,18 @@ sealed class Component: Parcelable {
6060
var isEnabled: Boolean? = null,
6161
var action: String? = null,
6262
var variant: String? = null,
63-
) : Component(), Parcelable
63+
) : Component(), Passable
6464

65-
@Parcelize
65+
@IsPassable
6666
@Serializable
6767
data class Switch(
6868
val id: String,
6969
var isChecked: Boolean? = null,
7070
var modifier: Modifier? = null,
7171
var action: String? = null,
72-
) : Component(), Parcelable
72+
) : Component(), Passable
7373

74-
@Parcelize
74+
@IsPassable
7575
@Serializable
7676
data class Drawable(
7777
val id: String,
@@ -81,9 +81,9 @@ sealed class Component: Parcelable {
8181
var modifier: Modifier? = null,
8282
var alignment: Alignment? = null,
8383
var contentScale: ContentScale? = null
84-
) : Component(), Parcelable
84+
) : Component(), Passable
8585

86-
@Parcelize
86+
@IsPassable
8787
@Serializable
8888
data class Vector(
8989
val id: String,
@@ -92,9 +92,9 @@ sealed class Component: Parcelable {
9292
var alignment: Alignment? = null,
9393
var contentScale: ContentScale? = null,
9494
var color: Color? = null
95-
) : Component(), Parcelable
95+
) : Component(), Passable
9696

97-
@Parcelize
97+
@IsPassable
9898
@Serializable
9999
data class Surface(
100100
val id: String,
@@ -105,6 +105,6 @@ sealed class Component: Parcelable {
105105
var borderStroke: BorderStroke? = null,
106106
var elevation: Int? = null,
107107
var components: MutableList<Component>? = null,
108-
) : Component(), Parcelable
108+
) : Component(), Passable
109109
}
110110

componentbox/src/commonMain/kotlin/com/dropbox/componentbox/foundation/ComponentBox.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@ package com.dropbox.componentbox.foundation
33
import kotlinx.serialization.Serializable
44

55
@Serializable
6-
sealed class ComponentBox: Parcelable {
7-
@Parcelize
6+
sealed class ComponentBox: Passable {
7+
@IsPassable
88
@Serializable
99
data class Screen(
1010
val title: String?,
1111
val verticalArrangement: Arrangement,
1212
val horizontalAlignment: Alignment,
1313
val components: List<Component>
14-
) : ComponentBox(), Parcelable
14+
) : ComponentBox(), Passable
1515

16-
@Parcelize
16+
@IsPassable
1717
@Serializable
1818
data class Modal(
1919
val verticalArrangement: Arrangement,
2020
val horizontalAlignment: Alignment,
2121
val components: List<Component>
22-
) : ComponentBox(), Parcelable
22+
) : ComponentBox(), Passable
2323

24-
@Parcelize
24+
@IsPassable
2525
@Serializable
2626
data class Banner(
2727
val verticalArrangement: Arrangement,
2828
val horizontalAlignment: Alignment,
2929
val components: List<Component>
30-
) : ComponentBox(), Parcelable
30+
) : ComponentBox(), Passable
3131
}

componentbox/src/commonMain/kotlin/com/dropbox/componentbox/foundation/ComponentBoxType.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package com.dropbox.componentbox.foundation
22

33
import kotlinx.serialization.Serializable
44

5-
@Parcelize
5+
@IsPassable
66
@Serializable
7-
enum class ComponentBoxType: Parcelable {
7+
enum class ComponentBoxType: Passable {
88
Screen,
99
Modal,
1010
Banner

componentbox/src/commonMain/kotlin/com/dropbox/componentbox/foundation/ComponentType.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package com.dropbox.componentbox.foundation
22

33
import kotlinx.serialization.Serializable
44

5-
@Parcelize
5+
@IsPassable
66
@Serializable
7-
enum class ComponentType: Parcelable {
7+
enum class ComponentType: Passable {
88
Box,
99
Button,
1010
Column,

0 commit comments

Comments
 (0)