-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from teogor/feature/drifter-annotation-processor
Enable code generation for Drifter modules with KSP plugin
- Loading branch information
Showing
51 changed files
with
2,065 additions
and
136 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
6 changes: 6 additions & 0 deletions
6
app/src/main/kotlin/dev/teogor/drifter/common/StatusBarHeightPlugin.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,6 @@ | ||
package dev.teogor.drifter.common | ||
|
||
object StatusBarHeightPlugin { | ||
val statusBarHeight: Int | ||
get() { return 200 } | ||
} |
58 changes: 58 additions & 0 deletions
58
app/src/main/kotlin/dev/teogor/drifter/demo/AquariumModule.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,58 @@ | ||
/* | ||
* Copyright 2024 teogor (Teodor Grigor) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dev.teogor.drifter.demo | ||
|
||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.graphics.toArgb | ||
import dev.teogor.drifter.DrifterEncoder | ||
import dev.teogor.drifter.DrifterMappingKey | ||
import dev.teogor.drifter.DrifterModule | ||
import dev.teogor.drifter.DrifterUnityMethod | ||
import dev.teogor.drifter.demo.models.CycleOption | ||
|
||
@DrifterModule( | ||
name = "Aquarium", | ||
receiver = "BridgeController", | ||
methods = AquariumMethods::class, | ||
) | ||
data class AquariumModule( | ||
@DrifterMappingKey( | ||
exposedMethod = "SetEditorMode", | ||
) | ||
val isEditorMode: Boolean? = null, | ||
val waterColor: Color? = null, | ||
val animated: Boolean? = null, | ||
val cycleOption: CycleOption, | ||
val statusBarColor: Color, | ||
val statusBarIsVisible: Boolean, | ||
val statusBarOpacity: Float, | ||
val statusBarHeight: Int, | ||
) | ||
|
||
interface AquariumMethods { | ||
@DrifterUnityMethod( | ||
name = "animateToWaterColor", | ||
parameters = [ | ||
"waterColor", | ||
"animated", | ||
], | ||
) | ||
fun animateToWaterColor() | ||
} | ||
|
||
@DrifterEncoder | ||
fun Color.encodeFromColor() = toArgb() |
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
23 changes: 23 additions & 0 deletions
23
app/src/main/kotlin/dev/teogor/drifter/demo/models/CycleOption.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,23 @@ | ||
/* | ||
* Copyright 2024 teogor (Teodor Grigor) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package dev.teogor.drifter.demo.models | ||
|
||
enum class CycleOption { | ||
Day, | ||
Night, | ||
Auto, | ||
} |
54 changes: 0 additions & 54 deletions
54
app/src/main/kotlin/dev/teogor/drifter/demo/unity/UnityController.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
app/src/main/kotlin/dev/teogor/drifter/demo/unity/models/CycleOption.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
app/src/main/kotlin/dev/teogor/drifter/demo/unity/models/StorageKeys.kt
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
app/src/main/kotlin/dev/teogor/drifter/demo/unity/models/UnityActionParams.kt
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
app/src/main/kotlin/dev/teogor/drifter/demo/unity/models/UnityActions.kt
This file was deleted.
Oops, something went wrong.
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 @@ | ||
/build |
Oops, something went wrong.