baoyongzhang / baoyongzhang/SwipeMenuListView
在Fragment使用swipemenulistview
- Dominant language
- Java
- Stars
- 3.5k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
我现在在Fragment中使用swipemenulistview,左右滑动时,会触发ViewPager的滑动方法,这个应该怎么解决。
viewPager.setOnPageChangeListener(new OnPageChangeListener() {
// 当滑动状态改变时调用
@Override
public void onPageSelected(int arg0) {
position=arg0;
}
// 当前页面被滑动时调用
@Override
public void onPageScrolled(int position, float positionOffset,
int positionOffsetPixels) {
LinearLayout.LayoutParams lp = (android.widget.LinearLayout.LayoutParams) id_tab_line
.getLayoutParams();
// 设置左边边界
lp.leftMargin = (int) ((positionOffset + position)
* screenWidth / 3);
id_tab_line.setLayoutParams(lp);
}
// 当新的页面被选中时调用
@Override
public void onPageScrollStateChanged(int arg0) {
}
});
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the interaction in a Fragment containing SwipeMenuListView and ViewPager, using the onPageChangeListener code shown in the issue. Trace which component receives horizontal swipe events; done means list-item swipes work without triggering ViewPager page changes, while normal ViewPager paging remains functional.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100