Skip to content
This repository has been archived by the owner on Jun 28, 2020. It is now read-only.

Commit

Permalink
fixed behavior for cropOutside mode + bump version to 1.0,1
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn committed Jan 12, 2017
1 parent 13ce1c5 commit 5a4cae8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
android:layout_gravity="start"
android:background="@android:color/white"
android:fitsSystemWindows="true"
app:arc_cropDirection="cropOutside"
app:arc_width="72dp"
app:arc_cropDirection="cropInside"
app:arc_width="96dp"
app:itemBackground="@android:color/white"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,27 +98,27 @@ private Path createClipPath() {
}
} else {
if (layoutParams.gravity == Gravity.START || layoutParams.gravity == Gravity.LEFT) {
arcPath.moveTo(width - arcWidth, 0);
arcPath.quadTo(width + arcWidth, height / 2,
width - arcWidth, height);
arcPath.moveTo(width - arcWidth / 2, 0);
arcPath.quadTo(width + arcWidth / 2, height / 2,
width - arcWidth / 2, height);
arcPath.close();

path.moveTo(0, 0);
path.lineTo(width - arcWidth, 0);
path.quadTo(width + arcWidth, height / 2,
width - arcWidth, height);
path.lineTo(width - arcWidth / 2, 0);
path.quadTo(width + arcWidth / 2, height / 2,
width - arcWidth / 2, height);
path.lineTo(0, height);
path.close();
} else if (layoutParams.gravity == Gravity.END || layoutParams.gravity == Gravity.RIGHT) {
arcPath.moveTo(arcWidth, 0);
arcPath.quadTo(-arcWidth, height / 2,
arcWidth, height);
arcPath.moveTo(arcWidth / 2, 0);
arcPath.quadTo(-arcWidth / 2, height / 2,
arcWidth / 2, height);
arcPath.close();

path.moveTo(width, 0);
path.lineTo(arcWidth, 0);
path.quadTo(-arcWidth, height / 2,
arcWidth, height);
path.lineTo(arcWidth / 2, 0);
path.quadTo(-arcWidth / 2, height / 2,
arcWidth / 2, height);
path.lineTo(width, height);
path.close();
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ ext {
sdk = 25
buildTools = "25.0.1"
minSdk = 16
libraryVersion = "1.0.0"
libraryVersion = "1.0.1"
supportVersion = "25.1.0"
}
Binary file modified media/crop_inside.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/crop_outside.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5a4cae8

Please sign in to comment.