Using Skia, Yoga, SurfaceView/TextureView to build a simple Flexbox-UI framework for Android.
steps:
- Compile skia https://skia.org/docs/user/build/ ,or unzip arm64-v8a.zip and x86-64.zip files in jniLibs.
- Using Skia GL context.
- Two threads: ui-thread & render-thread.
- Only support Flexbox. Measure/Layout/Draw are triggered by Vsync.
- TouchEvents: dispatchTouchEvent/interceptTouchEvent/onTouchEvent.
- Animations support scale/rotate/translate,and will be performed before measure.
support easing functions: https://easings.net/en - Dirty-Render: markDirty if next draw is necessary.
- Supported Widgets:
View, ImageView, TextView, Icon, ProgressBar, SVGView, ShaderView, Lottie, VideoView, ExoPlayerView, ScrollView, MovingArea, RecyclerView, Swiper, Loading, Switch, Radio, Picker, EditText, WebView, FlexboxLayout, Page... - PlatformView:
render Android-Views such as WebView/EditText by SurfaceTexture/SkImage, just like Flutter.
render 3D View by Filament(other engines can also supported)/SurfaceTexture/SkImage.
render Video(ExoPlayer)/Camera by SurfaceTexture/SkImage.
render AndroidImage(drawable/mipmap...) by Glide/Bitmap/SkImage.
... - Development:
C++ `` See ExamplePage.cpp. js Import v8 to evaluate javascriptSee test.js in assets. Support debug in chrome. Kotlin Import kotlinCompose-runtimeSupport Live-Edit. Support Material Theme. Support theme switching. React Import react/react-reconcilerdemo: https://github.com/tanpuer/skia-ui-react Vue Import @vue/runtime-coredemo: https://github.com/tanpuer/skia-ui-vue. Need import CSS-Selector(TODO). - Cross Platform
ios: https://github.com/tanpuer/HYSkiaUI-iOS - Performance Problems:
Skia: Shader Compilation jank, cache GL program binaries.









