|
25 | 25 |
|
26 | 26 | public class SwipeLayout extends FrameLayout { |
27 | 27 |
|
| 28 | + public static final int EMPTY_LAYOUT = -1; |
| 29 | + |
28 | 30 | private static final int DRAG_LEFT = 1; |
29 | 31 | private static final int DRAG_RIGHT = 2; |
30 | 32 | private static final int DRAG_TOP = 4; |
@@ -1161,31 +1163,31 @@ public List<ViewGroup> getBottomViews() { |
1161 | 1163 | // Pass the id of the view if set, otherwise pass -1 |
1162 | 1164 | public void setBottomViewIds(int left, int right, int top, int bottom) { |
1163 | 1165 | if (mDragEdges.contains(DragEdge.Left)) { |
1164 | | - if (left == -1) { |
| 1166 | + if (left == EMPTY_LAYOUT) { |
1165 | 1167 | mBottomViewIdsSet = false; |
1166 | 1168 | } else { |
1167 | 1169 | mBottomViewIdMap.put(DragEdge.Left, left); |
1168 | 1170 | mBottomViewIdsSet = true; |
1169 | 1171 | } |
1170 | 1172 | } |
1171 | 1173 | if (mDragEdges.contains(DragEdge.Right)) { |
1172 | | - if (right == -1) { |
| 1174 | + if (right == EMPTY_LAYOUT) { |
1173 | 1175 | mBottomViewIdsSet = false; |
1174 | 1176 | } else { |
1175 | 1177 | mBottomViewIdMap.put(DragEdge.Right, right); |
1176 | 1178 | mBottomViewIdsSet = true; |
1177 | 1179 | } |
1178 | 1180 | } |
1179 | 1181 | if (mDragEdges.contains(DragEdge.Top)) { |
1180 | | - if (top == -1) { |
| 1182 | + if (top == EMPTY_LAYOUT) { |
1181 | 1183 | mBottomViewIdsSet = false; |
1182 | 1184 | } else { |
1183 | 1185 | mBottomViewIdMap.put(DragEdge.Top, top); |
1184 | 1186 | mBottomViewIdsSet = true; |
1185 | 1187 | } |
1186 | 1188 | } |
1187 | 1189 | if (mDragEdges.contains(DragEdge.Bottom)) { |
1188 | | - if (bottom == -1) { |
| 1190 | + if (bottom == EMPTY_LAYOUT) { |
1189 | 1191 | mBottomViewIdsSet = false; |
1190 | 1192 | } else { |
1191 | 1193 | mBottomViewIdMap.put(DragEdge.Bottom, bottom); |
|
0 commit comments