Skip to content

Commit

Permalink
cropper lib: removed dependency to appcompat-7 reducing apk file size…
Browse files Browse the repository at this point in the history
… from 7MB to 4MB
  • Loading branch information
k3b committed Apr 11, 2019
1 parent ad712c7 commit 09ad775
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
7 changes: 4 additions & 3 deletions cropper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ repositories {
}

dependencies {
api "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:exifinterface:$supportLibraryVersion"
api "com.android.support:support-v4:$supportLibraryVersion"
api "com.android.support:exifinterface:$supportLibraryVersion"
api "com.android.support:support-annotations:$support"

implementation 'com.github.Realify:Android-Image-Cropper:master'
// implementation 'com.github.Realify:Android-Image-Cropper:master'
}

Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
// import android.support.v7.app.ActionBar;
// import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
Expand All @@ -38,7 +38,7 @@
* Built-in activity for image cropping.<br>
* Use {@link CropImage#activity(Uri)} to create a builder to start this activity.
*/
public class CropImageActivity extends AppCompatActivity
public class CropImageActivity extends Activity
implements CropImageView.OnSetImageUriCompleteListener,
CropImageView.OnCropImageCompleteListener {

Expand Down Expand Up @@ -84,15 +84,19 @@ public void onCreate(Bundle savedInstanceState) {
}
}

CharSequence title = mOptions != null &&
mOptions.activityTitle != null && mOptions.activityTitle.length() > 0
? mOptions.activityTitle
: getResources().getString(R.string.crop_image_activity_title);

/*
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
CharSequence title = mOptions != null &&
mOptions.activityTitle != null && mOptions.activityTitle.length() > 0
? mOptions.activityTitle
: getResources().getString(R.string.crop_image_activity_title);
actionBar.setTitle(title);
actionBar.setDisplayHomeAsUpEnabled(true);
}
*/
setTitle(title);
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions cropper/src/main/res/menu/crop_image_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
android:icon="@drawable/crop_image_menu_rotate_left"
android:title="@string/crop_image_menu_rotate_left"
android:visible="false"
app:showAsAction="ifRoom"/>
android:showAsAction="ifRoom"/>
<item
android:id="@+id/crop_image_menu_rotate_right"
android:icon="@drawable/crop_image_menu_rotate_right"
android:title="@string/crop_image_menu_rotate_right"
app:showAsAction="ifRoom"/>
android:showAsAction="ifRoom"/>
<item
android:id="@+id/crop_image_menu_flip"
android:icon="@drawable/crop_image_menu_flip"
android:title="@string/crop_image_menu_flip"
app:showAsAction="ifRoom">
android:showAsAction="ifRoom">
<menu>
<item
android:id="@+id/crop_image_menu_flip_horizontally"
Expand All @@ -30,6 +30,6 @@
<item
android:id="@+id/crop_image_menu_crop"
android:title="@string/crop_image_menu_crop"
app:showAsAction="always"/>
android:showAsAction="always"/>

</menu>

0 comments on commit 09ad775

Please sign in to comment.