I made this library to make it easier for developers to implement a photo editor and painter, e.g. you can use it to make your user adit his photo before sending it in chatting app, or since it is opensource you can enhance it and build your own paint application.
Add this to yor build.gradle(Project) file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Then add this impelementation to your build.gradle(Module) file
dependencies {
//for Edit tool
implementation 'com.github.mahmoudhesham009.PaintTools:EditTool:0.1.1'
//for Paint tool
implementation 'com.github.mahmoudhesham009.PaintTools:PaintTool:0.1.1'
}
PaintTool.with(MainActivity.this)
.setToolBarColor(Color.GRAY)
.setToolBarTitle("Hello from painter")
.setBackgroundColor(Color.BLACK)
.show();
to get your paint result add thit to your activity:
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (resultCode) {
case PaintTool.DRAW_RESULT:
//your bitmap result
Bitmap bmp = PaintTool.getDrawResult(data);
imageView.setImageBitmap(bmp);
break;
}
}
EditTool.with(MainActivity.this, yourUri)
.setToolBarColor(Color.WHITE)
.setToolBarTitle("Hello from editor")
.show();
to get your edit result add thit to your activity:
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (resultCode) {
case EditTool.DRAW_RESULT:
//your bitmap result
Bitmap bmp = EditTool.getDrawResult(data);
imageView.setImageBitmap(bmp);
break;
}
}