-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(openfeedback-m3): support ios target.
- Loading branch information
1 parent
ca220b6
commit bc885ec
Showing
19 changed files
with
319 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Pod::Spec.new do |spec| | ||
spec.name = 'openfeedback_m3' | ||
spec.version = '1.0' | ||
spec.homepage = '' | ||
spec.source = { :http=> ''} | ||
spec.authors = '' | ||
spec.license = '' | ||
spec.summary = '' | ||
spec.vendored_frameworks = 'build/cocoapods/framework/openfeedback_m3.framework' | ||
spec.libraries = 'c++' | ||
spec.ios.deployment_target = '14.1' | ||
spec.dependency 'FirebaseAuth' | ||
spec.dependency 'FirebaseFirestore' | ||
|
||
if !Dir.exist?('build/cocoapods/framework/openfeedback_m3.framework') || Dir.empty?('build/cocoapods/framework/openfeedback_m3.framework') | ||
raise " | ||
Kotlin framework 'openfeedback_m3' doesn't exist yet, so a proper Xcode project can't be generated. | ||
'pod install' should be executed after running ':generateDummyFramework' Gradle task: | ||
./gradlew :openfeedback-m3:generateDummyFramework | ||
Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)" | ||
end | ||
|
||
spec.pod_target_xcconfig = { | ||
'KOTLIN_PROJECT_PATH' => ':openfeedback-m3', | ||
'PRODUCT_MODULE_NAME' => 'openfeedback_m3', | ||
} | ||
|
||
spec.script_phases = [ | ||
{ | ||
:name => 'Build openfeedback_m3', | ||
:execution_position => :before_compile, | ||
:shell_path => '/bin/sh', | ||
:script => <<-SCRIPT | ||
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then | ||
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\"" | ||
exit 0 | ||
fi | ||
set -ev | ||
REPO_ROOT="$PODS_TARGET_SRCROOT" | ||
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \ | ||
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \ | ||
-Pkotlin.native.cocoapods.archs="$ARCHS" \ | ||
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION" | ||
SCRIPT | ||
} | ||
] | ||
spec.resources = ['build/compose/ios/openfeedback_m3/compose-resources'] | ||
end |
17 changes: 17 additions & 0 deletions
17
openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/CommentInputPreview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.openfeedback.m3 | ||
|
||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
|
||
@Preview | ||
@Composable | ||
private fun CommentInputPreview() { | ||
MaterialTheme { | ||
CommentInput( | ||
value = "My comment", | ||
onValueChange = {}, | ||
onSubmit = {} | ||
) | ||
} | ||
} |
33 changes: 1 addition & 32 deletions
33
...kotlin/io/openfeedback/m3/CommentItems.kt → ...io/openfeedback/m3/CommentItemsPreview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/CommentPreview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.openfeedback.m3 | ||
|
||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import io.openfeedback.viewmodels.models.UIComment | ||
import io.openfeedback.viewmodels.models.UIDot | ||
|
||
@Preview | ||
@Composable | ||
private fun CommentPreview() { | ||
MaterialTheme { | ||
Comment( | ||
comment = UIComment( | ||
id = "", | ||
voteItemId = "", | ||
message = "Super talk and great speakers!", | ||
createdAt = "08 August 2023", | ||
upVotes = 8, | ||
dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), | ||
votedByUser = true | ||
), | ||
onClick = {} | ||
) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/LoadingPreview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package io.openfeedback.m3 | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.tooling.preview.Preview | ||
|
||
@Preview | ||
@Composable | ||
internal fun LoadingPreview() { | ||
Loading() | ||
} |
77 changes: 77 additions & 0 deletions
77
openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/OpenFeedbackLayoutPreview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package io.openfeedback.m3 | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import io.openfeedback.viewmodels.models.UIComment | ||
import io.openfeedback.viewmodels.models.UIDot | ||
import io.openfeedback.viewmodels.models.UISessionFeedback | ||
import io.openfeedback.viewmodels.models.UIVoteItem | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Preview | ||
@Composable | ||
private fun OpenFeedbackLayoutPreview() { | ||
MaterialTheme { | ||
OpenFeedbackLayout( | ||
sessionFeedback = UISessionFeedback( | ||
commentValue = "", | ||
commentVoteItemId = "", | ||
comments = listOf( | ||
UIComment( | ||
id = "", | ||
voteItemId = "", | ||
message = "Nice comment", | ||
createdAt = "08 August 2023", | ||
upVotes = 8, | ||
dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), | ||
votedByUser = true | ||
), | ||
UIComment( | ||
id = "", | ||
voteItemId = "", | ||
message = "Another one", | ||
createdAt = "08 August 2023", | ||
upVotes = 0, | ||
dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), | ||
votedByUser = true | ||
) | ||
), | ||
voteItem = listOf( | ||
UIVoteItem( | ||
id = "", | ||
text = "Fun", | ||
dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), | ||
votedByUser = true | ||
), | ||
UIVoteItem( | ||
id = "", | ||
text = "Fun", | ||
dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), | ||
votedByUser = true | ||
) | ||
) | ||
), | ||
horizontalArrangement = Arrangement.spacedBy(8.dp), | ||
verticalArrangement = Arrangement.spacedBy(8.dp), | ||
commentInput = { | ||
CommentInput(value = "", onValueChange = {}, onSubmit = {}) | ||
}, | ||
comment = { Comment(comment = it, onClick = {}) } | ||
) { | ||
VoteCard( | ||
voteModel = it, | ||
onClick = {}, | ||
modifier = Modifier | ||
.height(100.dp) | ||
.fillMaxWidth() | ||
) | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
openfeedback-m3/src/androidMain/kotlin/io/openfeedback/m3/VoteCardPreview.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.openfeedback.m3 | ||
|
||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import io.openfeedback.viewmodels.models.UIDot | ||
import io.openfeedback.viewmodels.models.UIVoteItem | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Preview | ||
@Composable | ||
private fun VoteCardPreview() { | ||
MaterialTheme { | ||
VoteCard( | ||
voteModel = UIVoteItem( | ||
id = "", | ||
text = "Fun", | ||
dots = listOf(UIDot(x = .5f, y = .5f, color = "FF00CC")), | ||
votedByUser = true | ||
), | ||
onClick = {}, | ||
modifier = Modifier.size(height = 100.dp, width = 200.dp) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.