Skip to content

Commit dcccde7

Browse files
committed
if no image return null instead of ignore.
1 parent ebf2425 commit dcccde7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dragsquareimage/src/main/java/com/swifty/dragsquareimage/DraggableSquareView.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import android.os.Message;
77
import android.support.v4.view.GestureDetectorCompat;
88
import android.support.v4.widget.ViewDragHelper;
9-
import android.text.TextUtils;
109
import android.util.AttributeSet;
1110
import android.util.SparseArray;
1211
import android.view.GestureDetector;
@@ -547,11 +546,14 @@ public boolean onTouchEvent(MotionEvent e) {
547546
return true;
548547
}
549548

549+
/**
550+
* if Itemview is empty then return null
551+
* @return
552+
*/
550553
public SparseArray<String> getImageUrls() {
551554
SparseArray<String> stringSparseArray = new SparseArray<>();
552555
for (int i = 0; i < getChildCount(); i++) {
553-
if (getChildAt(i) instanceof DraggableItemView
554-
&& !TextUtils.isEmpty(((DraggableItemView) getChildAt(i)).getImagePath())) {
556+
if (getChildAt(i) instanceof DraggableItemView) {
555557
stringSparseArray.put(((DraggableItemView) getChildAt(i)).getStatus(), ((DraggableItemView) getChildAt(i)).getImagePath());
556558
}
557559
}

0 commit comments

Comments
 (0)