Skip to content

Commit

Permalink
adjust the parameter to find a proper threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
u7759982 committed Oct 17, 2024
1 parent ebadccb commit a8c1708
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public CustomBottomSheetBehavior(@NonNull final Context context,
@Nullable final AttributeSet attrs) {
super(context, attrs);
final DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
screenHeight = displayMetrics.heightPixels; //record the screen height
dragThreshold = (float) (0.2 * screenHeight); // Adjust this value as needed
final int screenHeight = displayMetrics.heightPixels; //record the screen height
dragThreshold = (float) (0.05 * screenHeight); // Adjust this value as needed
}

Rect globalRect = new Rect();
Expand All @@ -36,8 +36,7 @@ public CustomBottomSheetBehavior(@NonNull final Context context,
R.id.playPauseButton, R.id.playPreviousButton, R.id.playNextButton);
private float startY = 0f;
private float totalDrag = 0f;
private float dragThreshold;
private int screenHeight;
private final float dragThreshold;


@Override
Expand Down

0 comments on commit a8c1708

Please sign in to comment.