Skip to content

Commit 86c3953

Browse files
author
zhangxutong
committed
当ItemView存在高度可变的情况
1 parent c7b7cbd commit 86c3953

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

swipemenulib/src/main/java/com/mcxtzhang/swipemenulib/SwipeMenuLayout.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
* 11 2016 11 14 add,支持padding,且后续计划加入上滑下滑,因此不再支持ContentItem的margin属性。
4343
* 2016 11 14 add,修改回弹的动画,更平滑。
4444
* 2016 11 14 fix,微小位移的move不回回弹的bug
45+
* 2016 11 18,fix 当ItemView存在高度可变的情况
4546
* Created by zhangxutong .
4647
* Date: 16/04/24
4748
*/
@@ -202,6 +203,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
202203
setClickable(true);//令自己可点击,从而获取触摸事件
203204

204205
mRightMenuWidths = 0;//由于ViewHolder的复用机制,每次这里要手动恢复初始值
206+
mHeight = 0;
205207
int contentWidth = 0;//2016 11 09 add,适配GridLayoutManager,将以第一个子Item(即ContentItem)的宽度为控件宽度
206208
int childCount = getChildCount();
207209

@@ -380,7 +382,7 @@ public boolean dispatchTouchEvent(MotionEvent ev) {
380382
}
381383

382384
//add by 2016 09 11 ,IOS模式开启的话,且当前有侧滑菜单的View,且不是自己的,就该拦截事件咯。滑动也不该出现
383-
if (!iosInterceptFlag ) {//且滑动了 才判断是否要收起、展开menu
385+
if (!iosInterceptFlag) {//且滑动了 才判断是否要收起、展开menu
384386
//求伪瞬时速度
385387
verTracker.computeCurrentVelocity(1000, mMaxVelocity);
386388
final float velocityX = verTracker.getXVelocity(mPointerId);

0 commit comments

Comments
 (0)