In order to modularize the ViSearch Android SDK that I was working with previously, I developed my very first UI lib - image-crop-layout. This is a light-weight image cropping module that supports UI customization and box update listener.

Here is a very good tutorial on how to upload a library to jCenter by Brian Attwell.

Submit library to jCenter via Bintray

Step 0

Register a Bintray account and create a new package for the library using a proper Bintray repo name.

Step 1

Add bintray plug-in and maven plug-in under the project’s build.gradle file

    dependencies {
        classpath ''
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'

Step 2

Config the metadata by adding the script to build.gradle file under the library module

ext {
    // Where you will see your artifact in Bintray's web interface
    // The "bintrayName" should match the name of the Bintray repro.
    bintrayRepo = "maven"
    bintrayName = "crop-image-layout"

    // Maven metadata
    publishedGroupId = "me.littlecheesecake"
    libraryName = "CropImageLayout"
    // Save yourself a head ache, and set this equal to the name of the Android Studio library
    // module. The artifact name needs to match the name of the library.
    artifact = "croplayout"

    libraryDescription = "Crop image view layout"
    libraryVersion = "${versionMajor}.${versionMinor}.${versionPatch}"

    developerId = "yulu"
    developerName = "Yu Lu"
    developerEmail = ""

Step 3

apply the bintray plug-in by including the script from other’s gist:

apply from: ''
apply from: ''

or download the scripts and apply from local path:

apply from: '../tools/bintray.gradle'

Then update the file in the project by including the bintray user name and password:


Step 4

Run gradle command to upload the library after implementation and testing:

> ./gradlew bintrayUpload

After successfully upload, you can include the library in the dependencies but need to include the repo

repositories {
    maven {
        url ''

dependencies {
    compile 'me.littlecheesecake:crop-image-layout:1.0.5'

By add the package to jCenter using the option provided on bintray website, the step of including the maven repo could be eliminated.

Use the crop-image-layout library


dependencies {
    compile 'me.littlecheesecake:croplayout:1.0.5'


EditPhotoView imageView = (EditPhotoView) findViewById(;
EditableImage image = new EditableImage(this, R.drawable.photo2);
image.setBox(new ScalableBox(25,180,640,880));

imageView.initView(this, image);

imageView.setOnBoxChangedListener(new OnBoxChangedListener() {
    public void onChanged(int x1, int y1, int x2, int y2) {
        //TODO: cropping box updated

UI Customization



Known Issue