Skip to content

Commit

Permalink
fix some bugs,specially scrolling the listview when it is swiping.
Browse files Browse the repository at this point in the history
  • Loading branch information
xyczero committed Mar 22, 2015
1 parent ef92875 commit cf456f2
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 3 deletions.
2 changes: 1 addition & 1 deletion customswipelistview/customswipelistview.iml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/docs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
Expand All @@ -83,7 +84,6 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/poms" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,14 @@ public boolean onTouchEvent(MotionEvent ev) {
return super.onTouchEvent(ev);
}

//if the next action_move is coming after the second action_down
//when the ItemSwipeView is still swiping with the first action,
//it will not allow the following actions until the ItemSwipeView has finished the swiping.
if (mEnableJudgeSwiping && isSwiping) {
ev.setAction(MotionEvent.ACTION_CANCEL);
return super.onTouchEvent(ev);
}

if (mCurSelectedPosition != INVALID_POSITION) {
addVelocityTrackerMotionEvent(ev);
switch (action) {
Expand Down Expand Up @@ -419,6 +427,9 @@ public void computeScroll() {
mScroller.getCurrY());
postInvalidate();

//when triggering the action_down,AbListview will call the abortAnimation function.
//Then the mFinished will be true;
//Other one, the computeScroll is callback by onDraw().
if (mScroller.isFinished()) {
isSwiping = false;
switch (mCurTouchSwipeMode) {
Expand Down Expand Up @@ -608,10 +619,10 @@ private void setSwipeItemTriggerDeltaX(int touchMode, int pxDeltaX) {
switch (touchMode) {
case TOUCH_SWIPE_RIGHT:
mSwipeItemRightTriggerDeltaX = pxDeltaX <= mScreenWidth ? -pxDeltaX
: mScreenWidth;
: -mScreenWidth;
break;
case TOUCH_SWIPE_LEFT:
mSwipeItemRightTriggerDeltaX = pxDeltaX <= mScreenWidth ? pxDeltaX
mSwipeItemLeftTriggerDeltaX = pxDeltaX <= mScreenWidth ? pxDeltaX
: mScreenWidth;
break;
default:
Expand Down
58 changes: 58 additions & 0 deletions sample/manifest-merger-release-report.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
-- Merging decision tree log ---
manifest
ADDED from AndroidManifest.xml:2:1
xmlns:android
ADDED from AndroidManifest.xml:2:11
package
ADDED from AndroidManifest.xml:3:5
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
android:versionName
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
android:versionCode
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
application
ADDED from AndroidManifest.xml:5:5
MERGED from com.android.support:appcompat-v7:21.0.3:16:5
MERGED from com.android.support:support-v4:21.0.3:16:5
MERGED from com.android.support:appcompat-v7:21.0.3:16:5
MERGED from com.android.support:support-v4:21.0.3:16:5
android:label
ADDED from AndroidManifest.xml:8:9
android:allowBackup
ADDED from AndroidManifest.xml:6:9
android:icon
ADDED from AndroidManifest.xml:7:9
android:theme
ADDED from AndroidManifest.xml:9:9
activity#com.xyczero.customswipelistview.sample.SampleActivity
ADDED from AndroidManifest.xml:10:9
android:label
ADDED from AndroidManifest.xml:12:13
android:name
ADDED from AndroidManifest.xml:11:13
intent-filter#android.intent.action.MAIN+android.intent.category.LAUNCHER
ADDED from AndroidManifest.xml:13:13
action#android.intent.action.MAIN
ADDED from AndroidManifest.xml:14:17
android:name
ADDED from AndroidManifest.xml:14:25
category#android.intent.category.LAUNCHER
ADDED from AndroidManifest.xml:16:17
android:name
ADDED from AndroidManifest.xml:16:27
uses-sdk
INJECTED from AndroidManifest.xml:0:0 reason: use-sdk injection requested
MERGED from com.android.support:appcompat-v7:21.0.3:15:5
MERGED from com.android.support:support-v4:21.0.3:15:5
MERGED from com.xyczero:customswipelistview:1.0.0:7:5
MERGED from com.android.support:appcompat-v7:21.0.3:15:5
MERGED from com.android.support:support-v4:21.0.3:15:5
android:targetSdkVersion
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0
android:minSdkVersion
INJECTED from AndroidManifest.xml:0:0
INJECTED from AndroidManifest.xml:0:0

0 comments on commit cf456f2

Please sign in to comment.