-
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.
问题:compose插件会根据CompseApp下/composeResources/里的文件生成Res类和Resource0类,但是在lib-module下iosApp使用会报错MissingResourceException。JetBrains/compose-multiplatform#4392 解决:暂时使用接口HDResProvider依赖注入ComposeApp生成的资源。同时引入ksp想通过ksp自动生成HDResProvider的实现类,避免手动注入。 2.引入voyager完成导航功能。 3.添加设备列表、添加设备页面。
- Loading branch information
1 parent
e51f2f2
commit 8e125ff
Showing
159 changed files
with
6,723 additions
and
657 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
1 change: 0 additions & 1 deletion
1
composeApp/src/androidMain/kotlin/com/yunext/virtuals/MainActivity.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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added
BIN
+5.78 KB
composeApp/src/commonMain/composeResources/drawable/ic_launcher_round.webp
Binary file not shown.
Binary file added
BIN
+24.1 KB
composeApp/src/commonMain/composeResources/drawable/icon_app_hadlinks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1012 Bytes
composeApp/src/commonMain/composeResources/drawable/icon_twins_4g.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+113 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_add_btn_click.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+115 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_add_btn_nor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+76.9 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_add_click.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+78 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_add_nor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+187 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_body_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.77 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_checked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.33 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_close_btn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.17 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_close_click.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.2 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_close_nor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.02 KB
...pp/src/commonMain/composeResources/drawable/icon_twins_distribution_network.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_fail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.63 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_label_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.77 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_label_short_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.56 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+706 Bytes
composeApp/src/commonMain/composeResources/drawable/icon_twins_more_click.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+700 Bytes
composeApp/src/commonMain/composeResources/drawable/icon_twins_more_nor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.9 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_no_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.9 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_no_device.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.16 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_offline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.8 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_on_btn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.21 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+984 Bytes
composeApp/src/commonMain/composeResources/drawable/icon_twins_return_click.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+996 Bytes
composeApp/src/commonMain/composeResources/drawable/icon_twins_return_nor.png
Oops, something went wrong.
Binary file added
BIN
+2.27 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_search.png
Oops, something went wrong.
Binary file added
BIN
+3.15 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_search_close.png
Oops, something went wrong.
Binary file added
BIN
+2.66 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_set_up.png
Oops, something went wrong.
Binary file added
BIN
+14.3 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_success.png
Oops, something went wrong.
Binary file added
BIN
+733 Bytes
composeApp/src/commonMain/composeResources/drawable/icon_twins_uncheck.png
Oops, something went wrong.
Binary file added
BIN
+1.69 KB
composeApp/src/commonMain/composeResources/drawable/icon_twins_wifi.png
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
114 changes: 114 additions & 0 deletions
114
composeApp/src/commonMain/kotlin/com/yunext/virtuals/HDResourceProvider.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,114 @@ | ||
package com.yunext.virtuals | ||
|
||
import com.yunext.kmp.resource.color.China | ||
import com.yunext.virtuals.ui.HDRes | ||
import com.yunext.virtuals.ui.HDResProvider | ||
import hdvirtuals.composeapp.generated.resources.Res | ||
import hdvirtuals.composeapp.generated.resources.ic_app | ||
import hdvirtuals.composeapp.generated.resources.icon_app_hadlinks | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_4g | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_add_btn_click | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_add_btn_nor | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_add_click | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_add_nor | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_body_bg | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_checked | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_close_btn | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_close_click | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_close_nor | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_distribution_network | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_fail | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_label_bg | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_label_short_bg | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_log | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_more_click | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_more_nor | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_no_data | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_no_device | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_offline | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_on_btn | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_refresh | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_return_click | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_return_nor | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_search | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_search_close | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_set_up | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_success | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_uncheck | ||
import hdvirtuals.composeapp.generated.resources.icon_twins_wifi | ||
import org.jetbrains.compose.resources.DrawableResource | ||
import org.jetbrains.compose.resources.ExperimentalResourceApi | ||
|
||
|
||
|
||
//@Deprecated("todo with ksp") | ||
//@HDResource("drawable") | ||
//interface DrawableProvider : HDResProvider | ||
|
||
@OptIn(ExperimentalResourceApi::class) | ||
object HDResProviderImpl : HDResProvider { | ||
override val HDRes.drawable.ic_app: DrawableResource | ||
get() = Res.drawable.ic_app | ||
override val HDRes.drawable.icon_app_hadlinks: DrawableResource | ||
get() = Res.drawable.icon_app_hadlinks | ||
override val HDRes.drawable.icon_twins_4g: DrawableResource | ||
get() = Res.drawable.icon_twins_4g | ||
override val HDRes.drawable.icon_twins_add_btn_click: DrawableResource | ||
get() = Res.drawable.icon_twins_add_btn_click | ||
override val HDRes.drawable.icon_twins_add_btn_nor: DrawableResource | ||
get() = Res.drawable.icon_twins_add_btn_nor | ||
override val HDRes.drawable.icon_twins_add_click: DrawableResource | ||
get() = Res.drawable.icon_twins_add_click | ||
override val HDRes.drawable.icon_twins_add_nor: DrawableResource | ||
get() = Res.drawable.icon_twins_add_nor | ||
override val HDRes.drawable.icon_twins_body_bg: DrawableResource | ||
get() = Res.drawable.icon_twins_body_bg | ||
override val HDRes.drawable.icon_twins_checked: DrawableResource | ||
get() = Res.drawable.icon_twins_checked | ||
override val HDRes.drawable.icon_twins_close_btn: DrawableResource | ||
get() = Res.drawable.icon_twins_close_btn | ||
override val HDRes.drawable.icon_twins_close_click: DrawableResource | ||
get() = Res.drawable.icon_twins_close_click | ||
override val HDRes.drawable.icon_twins_close_nor: DrawableResource | ||
get() = Res.drawable.icon_twins_close_nor | ||
override val HDRes.drawable.icon_twins_distribution_network: DrawableResource | ||
get() = Res.drawable.icon_twins_distribution_network | ||
override val HDRes.drawable.icon_twins_fail: DrawableResource | ||
get() = Res.drawable.icon_twins_fail | ||
override val HDRes.drawable.icon_twins_label_bg: DrawableResource | ||
get() = Res.drawable.icon_twins_label_bg | ||
override val HDRes.drawable.icon_twins_label_short_bg: DrawableResource | ||
get() = Res.drawable.icon_twins_label_short_bg | ||
override val HDRes.drawable.icon_twins_log: DrawableResource | ||
get() = Res.drawable.icon_twins_log | ||
override val HDRes.drawable.icon_twins_more_click: DrawableResource | ||
get() = Res.drawable.icon_twins_more_click | ||
override val HDRes.drawable.icon_twins_more_nor: DrawableResource | ||
get() = Res.drawable.icon_twins_more_nor | ||
override val HDRes.drawable.icon_twins_no_data: DrawableResource | ||
get() = Res.drawable.icon_twins_no_data | ||
override val HDRes.drawable.icon_twins_no_device: DrawableResource | ||
get() = Res.drawable.icon_twins_no_device | ||
override val HDRes.drawable.icon_twins_offline: DrawableResource | ||
get() = Res.drawable.icon_twins_offline | ||
override val HDRes.drawable.icon_twins_on_btn: DrawableResource | ||
get() = Res.drawable.icon_twins_on_btn | ||
override val HDRes.drawable.icon_twins_refresh: DrawableResource | ||
get() = Res.drawable.icon_twins_refresh | ||
override val HDRes.drawable.icon_twins_return_click: DrawableResource | ||
get() = Res.drawable.icon_twins_return_click | ||
override val HDRes.drawable.icon_twins_return_nor: DrawableResource | ||
get() = Res.drawable.icon_twins_return_nor | ||
override val HDRes.drawable.icon_twins_search: DrawableResource | ||
get() = Res.drawable.icon_twins_search | ||
override val HDRes.drawable.icon_twins_search_close: DrawableResource | ||
get() = Res.drawable.icon_twins_search_close | ||
override val HDRes.drawable.icon_twins_set_up: DrawableResource | ||
get() = Res.drawable.icon_twins_set_up | ||
override val HDRes.drawable.icon_twins_success: DrawableResource | ||
get() = Res.drawable.icon_twins_success | ||
override val HDRes.drawable.icon_twins_uncheck: DrawableResource | ||
get() = Res.drawable.icon_twins_uncheck | ||
override val HDRes.drawable.icon_twins_wifi: DrawableResource | ||
get() = Res.drawable.icon_twins_wifi | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import androidx.compose.ui.window.ComposeUIViewController | ||
import com.yunext.virtuals.App | ||
|
||
fun MainViewController() = ComposeUIViewController { App() } |
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
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
17 changes: 17 additions & 0 deletions
17
hdcommon/src/commonMain/kotlin/com/yunext/kmp/common/TODO.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 com.yunext.kmp.common | ||
|
||
@Retention(AnnotationRetention.SOURCE) | ||
@Target( | ||
AnnotationTarget.EXPRESSION, | ||
AnnotationTarget.CLASS, | ||
AnnotationTarget.FUNCTION, | ||
AnnotationTarget.PROPERTY, | ||
AnnotationTarget.ANNOTATION_CLASS, | ||
AnnotationTarget.CONSTRUCTOR, | ||
AnnotationTarget.PROPERTY_GETTER, | ||
AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.LOCAL_VARIABLE | ||
) | ||
@Repeatable | ||
annotation class TODO( | ||
val msg: String, | ||
) |
5 changes: 5 additions & 0 deletions
5
hdcommon/src/commonMain/kotlin/com/yunext/kmp/common/util/Datetimes.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,5 @@ | ||
package com.yunext.kmp.common.util | ||
|
||
import kotlinx.datetime.Clock | ||
|
||
fun currentTime() = Clock.System.now().toEpochMilliseconds() |
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
8 changes: 8 additions & 0 deletions
8
hdhttp/src/commonMain/kotlin/com/yunext/kmp/http/LoginResp.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,8 @@ | ||
package com.yunext.kmp.http | ||
|
||
import com.yunext.kmp.http.core.HttpResponse | ||
|
||
data class LoginResp( | ||
val token: String? = "", | ||
val authCode: String? = "", | ||
) : HttpResponse |
4 changes: 4 additions & 0 deletions
4
hdhttp/src/commonMain/kotlin/com/yunext/kmp/http/ProductResp.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,4 @@ | ||
package com.yunext.kmp.http | ||
|
||
class ProductResp { | ||
} |
Oops, something went wrong.