From 9d96832c795b589f64fd78ef2079f9d461d6b099 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Tue, 9 Jan 2024 09:05:15 +0800 Subject: [PATCH] feat: add Platform --- .../flexiui/platform/Platform.android.kt | 26 ++++++++++++++++ .../highcapable/flexiui/platform/Platform.kt | 31 +++++++++++++++++++ .../flexiui/platform/Platform.desktop.kt | 26 ++++++++++++++++ .../flexiui/platform/Platform.ios.kt | 26 ++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 flexiui-core/src/androidMain/kotlin/com/highcapable/flexiui/platform/Platform.android.kt create mode 100644 flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/platform/Platform.kt create mode 100644 flexiui-core/src/desktopMain/kotlin/com/highcapable/flexiui/platform/Platform.desktop.kt create mode 100644 flexiui-core/src/iosMain/kotlin/com/highcapable/flexiui/platform/Platform.ios.kt diff --git a/flexiui-core/src/androidMain/kotlin/com/highcapable/flexiui/platform/Platform.android.kt b/flexiui-core/src/androidMain/kotlin/com/highcapable/flexiui/platform/Platform.android.kt new file mode 100644 index 0000000..0a2bc94 --- /dev/null +++ b/flexiui-core/src/androidMain/kotlin/com/highcapable/flexiui/platform/Platform.android.kt @@ -0,0 +1,26 @@ +/* + * Flexi UI - A flexible and useful UI component library. + * Copyright (C) 2019-2024 HighCapable + * https://github.com/BetterAndroid/FlexiUI + * + * Apache License Version 2.0 + * + * 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. + * + * This file is created by fankes on 2024/1/9. + */ +@file:Suppress("unused") + +package com.highcapable.flexiui.platform + +internal actual val ActualPlatform = Platform.Android \ No newline at end of file diff --git a/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/platform/Platform.kt b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/platform/Platform.kt new file mode 100644 index 0000000..77a6e29 --- /dev/null +++ b/flexiui-core/src/commonMain/kotlin/com/highcapable/flexiui/platform/Platform.kt @@ -0,0 +1,31 @@ +/* + * Flexi UI - A flexible and useful UI component library. + * Copyright (C) 2019-2024 HighCapable + * https://github.com/BetterAndroid/FlexiUI + * + * Apache License Version 2.0 + * + * 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. + * + * This file is created by fankes on 2024/1/9. + */ +@file:Suppress("unused") + +package com.highcapable.flexiui.platform + +import androidx.compose.runtime.Stable + +internal expect val ActualPlatform: Platform + +@Stable +internal enum class Platform { Android, IOS, Desktop } \ No newline at end of file diff --git a/flexiui-core/src/desktopMain/kotlin/com/highcapable/flexiui/platform/Platform.desktop.kt b/flexiui-core/src/desktopMain/kotlin/com/highcapable/flexiui/platform/Platform.desktop.kt new file mode 100644 index 0000000..0eb3a35 --- /dev/null +++ b/flexiui-core/src/desktopMain/kotlin/com/highcapable/flexiui/platform/Platform.desktop.kt @@ -0,0 +1,26 @@ +/* + * Flexi UI - A flexible and useful UI component library. + * Copyright (C) 2019-2024 HighCapable + * https://github.com/BetterAndroid/FlexiUI + * + * Apache License Version 2.0 + * + * 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. + * + * This file is created by fankes on 2024/1/9. + */ +@file:Suppress("unused") + +package com.highcapable.flexiui.platform + +internal actual val ActualPlatform = Platform.Desktop \ No newline at end of file diff --git a/flexiui-core/src/iosMain/kotlin/com/highcapable/flexiui/platform/Platform.ios.kt b/flexiui-core/src/iosMain/kotlin/com/highcapable/flexiui/platform/Platform.ios.kt new file mode 100644 index 0000000..c4b918f --- /dev/null +++ b/flexiui-core/src/iosMain/kotlin/com/highcapable/flexiui/platform/Platform.ios.kt @@ -0,0 +1,26 @@ +/* + * Flexi UI - A flexible and useful UI component library. + * Copyright (C) 2019-2024 HighCapable + * https://github.com/BetterAndroid/FlexiUI + * + * Apache License Version 2.0 + * + * 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. + * + * This file is created by fankes on 2024/1/9. + */ +@file:Suppress("unused") + +package com.highcapable.flexiui.platform + +internal actual val ActualPlatform get() = Platform.IOS \ No newline at end of file