Skip to content

Commit 94a73cf

Browse files
author
Haris Krasniqi
committed
minor fix
1 parent 4825bda commit 94a73cf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/src/main/java/com/soundcloud/android/crop/CropImageView.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected void onLayout(boolean changed, int left, int top, int right, int botto
4242
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
4343
int resID = getResources().getIdentifier("navigation_bar_height", "dimen", "android");
4444
if(resID > 0){
45-
softNavbarHeight = getResources().getDimensionPixelSize(resID) + 50;
45+
softNavbarHeight = getResources().getDimensionPixelSize(resID);
4646
}
4747
}
4848

@@ -154,15 +154,12 @@ private void ensureVisible(HighlightView hv) {
154154
int panDeltaX2 = Math.min(0, getRight() - r.right);
155155

156156
int panDeltaY1 = Math.max(0, getTop() - r.top);
157-
int panDeltaY2 = Math.min(0, getBottom() - r.bottom);
157+
int panDeltaY2 = Math.min(0, getBottom() - r.bottom - softNavbarHeight);
158158

159159
int panDeltaX = panDeltaX1 != 0 ? panDeltaX1 : panDeltaX2;
160160
int panDeltaY = panDeltaY1 != 0 ? panDeltaY1 : panDeltaY2;
161161

162162
if (panDeltaX != 0 || panDeltaY != 0) {
163-
if(softNavbarHeight > 0 && panDeltaY < 0){
164-
panDeltaY = panDeltaY - softNavbarHeight;
165-
}
166163
panBy(panDeltaX, panDeltaY);
167164
}
168165
}

0 commit comments

Comments
 (0)