Skip to content

Commit 8bfa1aa

Browse files
authored
Merge pull request #4 from ServerDriven/dev/views
Dev/views
2 parents 868e877 + f385661 commit 8bfa1aa

26 files changed

+369
-78
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.pv.screendata.extensions
2+
3+
import com.pv.screendata.objects.SomeView
4+
import com.pv.screendata.types.ViewType
5+
import com.pv.screendata.views.SomeContainerView
6+
7+
fun SomeContainerView.toSomeView(): SomeView = SomeView(
8+
type = ViewType.container,
9+
someContainer = this,
10+
someImage = null,
11+
someLabel = null,
12+
someLabeledImage = null,
13+
someCustomView = null,
14+
someText = null,
15+
someButton = null
16+
)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.pv.screendata.extensions
2+
3+
import com.pv.screendata.objects.SomeView
4+
import com.pv.screendata.types.ViewType
5+
import com.pv.screendata.views.SomeLabel
6+
7+
fun SomeLabel.toSomeView(): SomeView = SomeView(
8+
type = ViewType.label,
9+
someContainer = null,
10+
someImage = null,
11+
someLabel = this,
12+
someLabeledImage = null,
13+
someCustomView = null,
14+
someText = null,
15+
someButton = null
16+
)
17+
18+
fun String.toSomeLabel(): SomeLabel = SomeLabel(
19+
id = null,
20+
this,
21+
null,
22+
null,
23+
null
24+
)
25+
26+
fun Pair<String, String>.toSomeLabel(): SomeLabel = SomeLabel(
27+
id = null,
28+
title = first,
29+
subtitle = second,
30+
null,
31+
null
32+
)

ScreenData/src/main/java/com/pv/screendata/objects/Color.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
package com.pv.screendata.objects
22

3-
import com.pv.screendata.objects.destinations.DeepLinkDestination
4-
import com.pv.screendata.objects.destinations.ScreenDestination
5-
import com.pv.screendata.objects.destinations.URLDestination
63
import com.pv.screendata.types.DestinationType
74

85
data class Destination(
6+
val toId: String,
97
val type: DestinationType,
10-
val screen: ScreenDestination?,
11-
val url: URLDestination?,
12-
val deepLink: DeepLinkDestination?
138
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.pv.screendata.objects
2+
3+
data class SomeColor(
4+
val red: Float,
5+
val green: Float,
6+
val blue: Float,
7+
val alpha: Float
8+
)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.pv.screendata.objects
2+
3+
data class SomeStyle(
4+
val backgroundColor: SomeColor?,
5+
val foregroundColor: SomeColor?,
6+
val isHidden: Boolean,
7+
val cornerRadius: Int
8+
)

ScreenData/src/main/java/com/pv/screendata/objects/SomeView.kt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@ package com.pv.screendata.objects
33
import com.pv.screendata.types.ViewType
44
import com.pv.screendata.views.*
55

6+
// preview all models with Some?
7+
// add a spacer view?
68
data class SomeView(
79
val type: ViewType,
810

9-
val container: ContainerView?,
10-
val image: Image?,
11-
val label: Label?,
12-
val labeledImage: LabeledImage?,
13-
val view: View?
11+
val someText: SomeText?,
12+
val someButton: SomeButton?,
13+
val someContainer: SomeContainerView?,
14+
val someImage: SomeImage?,
15+
val someLabel: SomeLabel?,
16+
val someLabeledImage: SomeLabeledImage?,
17+
val someCustomView: SomeCustomView?
1418
)

ScreenData/src/main/java/com/pv/screendata/objects/Style.kt

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

ScreenData/src/main/java/com/pv/screendata/objects/destinations/DeepLinkDestination.kt

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

ScreenData/src/main/java/com/pv/screendata/objects/destinations/ScreenDestination.kt

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

0 commit comments

Comments
 (0)