Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
miracleshed committed May 22, 2023
1 parent 9504206 commit a5edb76
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import androidx.annotation.FloatRange;
import androidx.annotation.IntDef;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.core.view.ViewCompat;
import androidx.customview.widget.ViewDragHelper;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.MotionEvent;
Expand All @@ -25,6 +19,12 @@
import java.util.ArrayList;
import java.util.List;

import androidx.annotation.FloatRange;
import androidx.annotation.IntDef;
import androidx.core.view.ViewCompat;
import androidx.customview.widget.ViewDragHelper;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentationMagician;
import me.yokeyword.fragmentation_swipeback.core.ISwipeBackActivity;

Expand Down Expand Up @@ -547,6 +547,14 @@ public void onViewReleased(View releasedChild, float xvel, float yvel) {
@Override
public void onViewDragStateChanged(int state) {
super.onViewDragStateChanged(state);
if (state == SwipeBackLayout.STATE_IDLE) {
internalCallOnDestroyView();
computeScroll();
} else if (state == ViewDragHelper.STATE_DRAGGING) {
mCallOnDestroyView = false;
} else {

}
if (mListeners != null) {
for (OnSwipeListener listener : mListeners) {
listener.onDragStateChange(state);
Expand Down

0 comments on commit a5edb76

Please sign in to comment.