From 40350ccd0b7bb779c40b1ebe2dbea69336dd423d Mon Sep 17 00:00:00 2001 From: helloyako Date: Tue, 14 Feb 2017 16:47:05 +0900 Subject: [PATCH 1/2] #20 gridLeftRightMargin and gridTopBottomMargin in Java Code --- .../helloyako/imagecrop/view/ImageCropView.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/imagecropview/src/main/java/com/naver/android/helloyako/imagecrop/view/ImageCropView.java b/imagecropview/src/main/java/com/naver/android/helloyako/imagecrop/view/ImageCropView.java index 08fe493..df49052 100644 --- a/imagecropview/src/main/java/com/naver/android/helloyako/imagecrop/view/ImageCropView.java +++ b/imagecropview/src/main/java/com/naver/android/helloyako/imagecrop/view/ImageCropView.java @@ -32,6 +32,7 @@ import android.os.Handler; import android.util.AttributeSet; import android.util.Log; +import android.util.TypedValue; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.ScaleGestureDetector; @@ -965,6 +966,20 @@ public void setGridOuterMode(int gridOuterMode) { invalidate(); } + public void setGridLeftRightMargin(int marginDP) { + this.gridLeftRightMargin = dpToPixel(marginDP); + requestLayout(); + } + + public void setGridTopBottomMargin(int marginDP) { + this.gridTopBottomMargin = dpToPixel(marginDP); + requestLayout(); + } + + private int dpToPixel(int dp) { + return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, getResources().getDisplayMetrics()); + } + public void saveState() { savedAspectRatioWidth = mAspectRatioWidth; savedAspectRatioHeight = mAspectRatioHeight; From 174e50172ec17f38454723e829a2870a3180ef01 Mon Sep 17 00:00:00 2001 From: helloyako Date: Mon, 20 Feb 2017 17:35:48 +0900 Subject: [PATCH 2/2] v1.2.1 --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index c7d60bf..b358bfd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -VERSION_NAME=1.2.0 -VERSION_CODE=8 +VERSION_NAME=1.2.1 +VERSION_CODE=9 GROUP=com.naver.android.helloyako POM_DESCRIPTION=Android Image Crop View