Giter Site home page Giter Site logo

ananas's Introduction

Ananas Photo Editor

Download API

An easy photo editor integration for your Android apps.

Features

Benefits

  • Plug and play
  • Easy image editing

Getting Started

Add it in your root build.gradle at the end of repositories:

  allprojects {
    repositories {
      ...
      maven { url 'https://jitpack.io' }
    }
  }

Add the dependency in gradle file of app module like this

compile 'com.github.iamutkarshtiwari:Ananas:v1.0.0'

Proguard Rules [Important!]

Add this to your app's proguard-rules.pro file -

-keepclasseswithmembers class * {
    native <methods>;
}

Starting the PhotoEditor activity

Simply add this line to the place from where you want to start the activity-

  • If you wanna force Portrait mode, pass forcePortrait (boolean) as true
EditImageActivity.start(sourceActivity, originalImagePath, outputImagePath, requestCode, forcePortait);
  • If you wanna launch the activity in Auto-rotate mode
EditImageActivity.start(sourceActivity, originalImagePath, outputImagePath, requestCode);

Receiving the output image

You can receive the new processed image path and it's edit status like this-

 @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        
        if (requestCode == PHOTO_EDITOR_REQUEST) { // same code you used while starting 
            String newFilePath = data.getStringExtra(EditImageActivity.EXTRA_OUTPUT);
            boolean isImageEdit = data.getBooleanExtra(EditImageActivity.IMAGE_IS_EDIT, false);
        }
    }

Special Note

The photo editor locks the current orientation in which it is started -

  1. If you started in Portrait mode, you can't switch to Landscape while the image editor activity is running.
  2. If you started in Landscape mode, you can't switch to Portrait during the same.

But once you navigate back to your original app, you are reverted back to your previous configuration change settings.

How to contribute?

  • Fork the project.
  • Make required changes and commit.
  • Generate pull request. Mention all the required description regarding changes you made.

Happy coding! :)

What's next?

  • Add options to build photo editor with custom features
  • Add support for configuration change during photo editing

Questions?๐Ÿค”

Hit me on twitter Twitter Facebook

How to submit a valid issue

  • Make sure you compiled the latest version. If it still doesn't work out, don't hesitate to open a new issue.
  • Describe the scenarios when crash happened as much as possible (pictures would be better).
  • Sharing your device type and Android OS version is very helpful.
  • Paste your XML or Java code.
  • Paste the crash log.
  • Be polite.

License

   Copyright 2018 Utkarsh Tiwari

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

Credits

Name Library
siwangqishiq ImageEditor Android
IsseiAoki SimpleCropView
hoanganhtuan95ptit Contrast and Brightness feature
eltos Color Picker Dialog
Russell Jurney Kelly's 22 colors list

ananas's People

Contributors

iamutkarshtiwari 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.