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 FlexboxLayout. Measure/Layout/Draw are triggered by Vsync.
- TouchEvents: dispatchTouchEvent/interceptTouchEvent/onTouchEvent.
- Animations support scale/rotate/translate,the interpolator will be executed in Layout then update SkRect.
- Supported Widgets: View/TextView/ImageView/ProgressBar/FlexboxLayout/ScrollView/SVGView/ShaderView.
View: rect, cornerRadius.
ImageView: support png/gif, scaleType,cornerRadius, blur.
TextView: use SkParagraph, use AlimamaFangYuanTiVF-Thin.ttf by default.
ProgressBar: circle and linear style,also can be dragged.
SVGView: svg file.
ShaderView: render simple fragment-shader.
Lottie: render lottie.json.
VideoView: render local video by MediaCodec/HardwareBuffer/SkImage.
YUVVideoView: render video by MediaCodec/SkRuntimeEffect.
LyricView: parse .lrc/.srt files, use RecyclerView to render lyric.
... - scrollView: scroll, fling,for more optimizations.
- RecyclerView: adapter,ViewHolder,for more optimizations.
- Page: act as the same role as Activity.
- Javascript: Import v8 to evaluate javascript. Look at test.js in assets.