luckybilly / luckybilly/SmartSwipe

顶部或者底部滑出抽屉,有禁止越界滑动的方法吗

Open
#85 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
2.1k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

从顶部拉出界面,拉出来后,还能往下拉,我知道这是一种越界回弹的效果,能禁止这种效果吗?
View topMenu = LayoutInflater.from(this).inflate(R.layout.drawer_top_layout, null);
topMenu.setLayoutParams(layoutParams);
SmartSwipeWrapper topMenuWrapper = SmartSwipe.wrap(topMenu).addConsumer(newSpaceConsumer()).enableTop().getWrapper();

DrawerConsumer mDrawerConsumer = new DrawerConsumer()
.setTopDrawerView(topMenuWrapper)
.setBottomDrawerView(bottomMenuWrapper)
.setScrimColor(0x7F000000)
.setShadowColor(0x80000000)
.setEdgeSize(SmartSwipe.dp2px(100, this))
.as(DrawerConsumer.class);

SmartSwipe.wrap(this).addConsumer(mDrawerConsumer);

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the DrawerConsumer setup shown in the issue, including setTopDrawerView, setBottomDrawerView, and the top and bottom drawer configuration. Trace how dragging past either boundary produces the rebound effect, then verify that the requested behavior prevents further overscroll without breaking normal drawer opening and closing.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.