Giter Club home page Giter Club logo

androiddrawingview's Introduction

AndroidDrawingView

绘画板,支持平滑跟随,常用形状,图层变换

Import

JitPack

Add it in your project's build.gradle at the end of repositories:

repositories {
  // ...
  maven { url "https://jitpack.io" }
}

Step 2. Add the dependency in the form

dependencies {
  compile 'com.github.vilyever:AndroidDrawingView:1.6.7'
}

Usage

<com.vilyever.drawingview.DrawingView
    android:id="@+id/drawingView"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_weight="1"/>

drawingView = (DrawingView) rootView.findViewById(R.id.drawingView);
drawingView.setUndoRedoStateDelegate(new DrawingView.UndoRedoStateDelegate() {
    @Override
    public void onUndoRedoStateChange(DrawingView drawingView, boolean canUndo, boolean canRedo) {
        undoButton.setEnabled(canUndo);
        redoButton.setEnabled(canRedo);
    }
});

drawingView.setInterceptTouchDelegate(new DrawingView.InterceptTouchDelegate() {
    @Override
    public void requireInterceptTouchEvent(DrawingView drawingView, boolean isIntercept) {

    }
});

drawingView.setBackgroundDatasource(new DrawingView.BackgroundDatasource() {
    @Override
    public Drawable gainBackground(DrawingView drawingView, String identifier) {
        return null;
    }
});

penBrush = PenBrush.defaultBrush();
drawingView.setBrush(penBrush);

License

Apache License Version 2.0

androiddrawingview's People

Contributors

vilyever avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.