mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
* refactor: Consolidate Servo initialization and event handling into a new `webview` module. * [autofix.ci] apply automated fixes * refactor: Move webview-related modules into the `webview` directory and update all internal import paths. * refactor: move servo field to inner struct and add direct accessor * docs: Add docs for webview module * docs: Change webview module to public and improve example in docs * [autofix.ci] apply automated fixes * docs: Improve example in docs --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| src | ||
| ui | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
Slint Servo Example
Disclaimer: Servo is still experimental and not ready for productions use.
Integrate Servo Web Engine as WebView Component for Slint to render websites using hardware rendring on MacOS, Linux and software rendring on android for now.
For Android build on Mac
Install Android Studio and JDK
brew install android-studio openjdk@17
Set these to .zshrc
export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
export PATH=$JAVA_HOME/bin:$PATH
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/28.2.13676358"
export ANDROID_NDK_ROOT=$ANDROID_NDK_HOME
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$PATH
Install platofrm-tools, build-tools and ndk
sdkmanager platform-tools "platforms;android-30" "build-tools;34.0.0" "ndk;28.2.13676358"
Add rust target and install cargo apk
rustup target add aarch64-linux-android
cargo install cargo-apk
Run on android emulator or device
export BINDGEN_EXTRA_CLANG_ARGS="--target=aarch64-linux-android30 --sysroot=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/darwin-x86_64/sysroot"
cargo apk run --target aarch64-linux-android --lib