https://github.com/tanpuer/skiaui
Android UI based on Skia and Yoga
https://github.com/tanpuer/skiaui
Last synced: 6 months ago
JSON representation
Android UI based on Skia and Yoga
- Host: GitHub
- URL: https://github.com/tanpuer/skiaui
- Owner: tanpuer
- Created: 2022-01-21T11:59:39.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2024-01-14T09:13:29.000Z (over 1 year ago)
- Last Synced: 2024-01-14T14:22:17.072Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 47.5 MB
- Stars: 10
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SkiaUI
switch to branch develop
Using Skia, Yoga, SurfaceView/TextureView to build a simple Flexbox-UI framework for Android.
步骤:
1. import Skia and Yoga。
skia: https://skia.org/docs/user/build/
Yoga: using directly with source code。
2. 配置好gl环境,使用Skia硬件加速。
3. 绘制模仿安卓Measure/Layout/Draw三板斧流程,只支持Flexbox布局。
4. 事件分发大体模仿安卓dispatchTouchEvent/interceptTouchEvent/onTouchEvent等,做了简化处理。
5. 动画支持scale/rotate/translate,在layout阶段更新SKMatrix,从而更新绘制的矩形。
6. 目前只支持View/TextView/ImageView/ProgressBar/FlexboxLayout/ScrollView
View矩形。
ImageView支持了scaleType,圆角。
TextView接入SkParagraph。后续想用这套试试富文本编辑器;
ProgressBar支持圆形和直线形,可拖拽修改进度。
7. scrollView实现,滑动,fling,目前滑动效果过于僵硬,todo 优化滑动效果。
8. todo 脏区渲染
9. 实现RecyclerView,adapter,ViewHolder复用机制,目前快速滑动有问题。


