mirror of
https://github.com/BetterAndroid/FlexiUI.git
synced 2025-09-08 11:34:18 +08:00
feat: update demo
This commit is contained in:
@@ -9,16 +9,14 @@
|
|||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; };
|
058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; };
|
||||||
058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; };
|
058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; };
|
||||||
2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; };
|
502E41D32B222C5400A649F5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 502E41D22B222C5400A649F5 /* AppDelegate.swift */; };
|
||||||
7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; };
|
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
|
||||||
2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; };
|
502E41D22B222C5400A649F5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
7555FF7B242A565900829871 /* FlexiUIDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlexiUIDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
7555FF7B242A565900829871 /* FlexiUIDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlexiUIDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
|
||||||
7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
|
AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
@@ -71,10 +69,9 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
058557BA273AAA24004C7B11 /* Assets.xcassets */,
|
058557BA273AAA24004C7B11 /* Assets.xcassets */,
|
||||||
7555FF82242A565900829871 /* ContentView.swift */,
|
|
||||||
7555FF8C242A565B00829871 /* Info.plist */,
|
7555FF8C242A565B00829871 /* Info.plist */,
|
||||||
2152FB032600AC8F00CF470E /* iOSApp.swift */,
|
|
||||||
058557D7273AAEEB004C7B11 /* Preview Content */,
|
058557D7273AAEEB004C7B11 /* Preview Content */,
|
||||||
|
502E41D22B222C5400A649F5 /* AppDelegate.swift */,
|
||||||
);
|
);
|
||||||
path = iosApp;
|
path = iosApp;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -179,8 +176,7 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */,
|
502E41D32B222C5400A649F5 /* AppDelegate.swift in Sources */,
|
||||||
7555FF83242A565900829871 /* ContentView.swift in Sources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
15
samples/iosApp/iosApp/AppDelegate.swift
Normal file
15
samples/iosApp/iosApp/AppDelegate.swift
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import UIKit
|
||||||
|
import shared
|
||||||
|
|
||||||
|
@UIApplicationMain
|
||||||
|
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||||
|
|
||||||
|
var window: UIWindow?
|
||||||
|
|
||||||
|
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||||
|
window = UIWindow(frame: UIScreen.main.bounds)
|
||||||
|
window?.rootViewController = App_iosKt.createUIViewController()
|
||||||
|
window?.makeKeyAndVisible()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
@@ -1,19 +0,0 @@
|
|||||||
import UIKit
|
|
||||||
import SwiftUI
|
|
||||||
import shared
|
|
||||||
|
|
||||||
struct ComposeView: UIViewControllerRepresentable {
|
|
||||||
func makeUIViewController(context: Context) -> UIViewController {
|
|
||||||
let viewController = App_iosKt.createUIViewController()
|
|
||||||
return viewController
|
|
||||||
}
|
|
||||||
|
|
||||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct ContentView: View {
|
|
||||||
var body: some View {
|
|
||||||
ComposeView()
|
|
||||||
.ignoresSafeArea(.all, edges: .bottom) // Compose has own keyboard handler
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,10 +0,0 @@
|
|||||||
import SwiftUI
|
|
||||||
|
|
||||||
@main
|
|
||||||
struct iOSApp: App {
|
|
||||||
var body: some Scene {
|
|
||||||
WindowGroup {
|
|
||||||
ContentView()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -44,6 +44,7 @@ import androidx.compose.runtime.setValue
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import com.highcapable.betterandroid.compose.extension.ui.ComponentPadding
|
||||||
import com.highcapable.flexiui.Colors
|
import com.highcapable.flexiui.Colors
|
||||||
import com.highcapable.flexiui.FlexiTheme
|
import com.highcapable.flexiui.FlexiTheme
|
||||||
import com.highcapable.flexiui.blueColors
|
import com.highcapable.flexiui.blueColors
|
||||||
@@ -66,7 +67,6 @@ import com.highcapable.flexiui.component.Text
|
|||||||
import com.highcapable.flexiui.component.TextField
|
import com.highcapable.flexiui.component.TextField
|
||||||
import com.highcapable.flexiui.defaultColors
|
import com.highcapable.flexiui.defaultColors
|
||||||
import com.highcapable.flexiui.dynamicColors
|
import com.highcapable.flexiui.dynamicColors
|
||||||
import com.highcapable.flexiui.extension.ComponentPadding
|
|
||||||
import com.highcapable.flexiui.greenColors
|
import com.highcapable.flexiui.greenColors
|
||||||
import com.highcapable.flexiui.isDynamicColorsAvailable
|
import com.highcapable.flexiui.isDynamicColorsAvailable
|
||||||
import com.highcapable.flexiui.orangeColors
|
import com.highcapable.flexiui.orangeColors
|
||||||
|
@@ -22,9 +22,9 @@
|
|||||||
@file:Suppress("unused")
|
@file:Suppress("unused")
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.window.ComposeUIViewController
|
import com.highcapable.betterandroid.compose.multiplatform.platform.AppComponentUIViewController
|
||||||
|
|
||||||
fun createUIViewController() = ComposeUIViewController { MainView() }
|
fun createUIViewController() = AppComponentUIViewController { MainView() }
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun MainView() = App()
|
fun MainView() = App()
|
Reference in New Issue
Block a user