File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
lib/java/com/google/android/material/listitem Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,7 @@ private void ensureContentViewIfRevealLayoutExists() {
160160 "Only one SwipeableListItem view is allowed in a ListItemLayout." );
161161 }
162162 contentView = getChildAt (i );
163+ originalContentViewLeft = contentView .getLeft ();
163164 }
164165 }
165166 }
@@ -215,6 +216,7 @@ private boolean ensureSwipeToRevealSetupIfNeeded() {
215216 new ViewDragHelper .Callback () {
216217 @ Override
217218 public boolean tryCaptureView (@ NonNull View child , int pointerId ) {
219+ ensureContentViewIfRevealLayoutExists ();
218220 if (swipeToRevealLayout != null && contentView != null ) {
219221 viewDragHelper .captureChildView (contentView , pointerId );
220222 }
@@ -257,7 +259,8 @@ public void onViewPositionChanged(
257259 - contentViewLp .rightMargin // only end margin matters here
258260 - revealViewLp .leftMargin
259261 - revealViewLp .rightMargin );
260- ((RevealableListItem ) swipeToRevealLayout ).setRevealedWidth (revealViewDesiredWidth );
262+ ((RevealableListItem ) swipeToRevealLayout )
263+ .setRevealedWidth (revealViewDesiredWidth );
261264 }
262265 });
263266
You can’t perform that action at this time.
0 commit comments