
回复
1.在项目根目录下的build.gradle文件中,
2.在entry模块的build.gradle文件中,
在sdk6,DevEco Studio2.2 Beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下
使用该库非常简单,只需查看提供的示例的源代码。 在布局文件中加入控件,代码实例如下
java 文件中使用
XML Attribute | Java method | Description | Default value |
paintColor | setPaintColor(@ColorInt int checked) | Set the color of the paint | Color.BLACK |
paintWidth | setPaintWidthPx(@FloatRange(from = 0) float widthPx) | Set the width of the paint in pixels | 4dp |
setPaintWidthDp(float dp) | Set the width of the paint in dp | 4dp | |
paintAlpha | setPaintAlpha(@IntRange(from = 0, to = 255) int alpha) | Set the alpha of the paint | 255 |
resizeBehaviour | setResizeBehaviour(ResizeBehaviour newBehaviour) | The behaviour of the view every time it is resized (on rotation for example) one of [clear, fitXY, crop] | ResizeBehaviour.CROP |
public void undoLast()
撤回上一条public void redoLast()
恢复上一条public void undoAll()
撤回所有public void redoAll()
恢复所有public void clearHistory()
清除历史看记录public void clearDraw()
清除所有绘制public void clearDrawAndHistory()
清除所有绘制和历史记录public int getPathCount(boolean includeCurrentlyDrawingPath)
获取绘制的数量setOnPathDrawnListener(PathDrawnListener listener)
设置监听setPathRedoUndoCountChangeListener(PathRedoUndoCountChangeListener listener)
设置监听removePathDrawnListener()
移除监听removePathRedoUndoCountChangeListener()
移除监听CodeCheck代码测试无异常
CloudTest代码测试无异常
病毒安全检测通过
当前版本demo功能与原组件基本无差异