Skip to content

Commit 40eee50

Browse files
committed
Fixed issue concerning scrolling in ListView.
1 parent 7045400 commit 40eee50

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

MPChartExample/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
package="com.xxmassdeveloper.mpchartexample"
4-
android:versionCode="22"
5-
android:versionName="1.6.2" >
4+
android:versionCode="23"
5+
android:versionName="1.6.3" >
66

77
<uses-sdk
88
android:minSdkVersion="8"

MPChartExample/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId 'com.xxmassdeveloper.mpchartexample'
88
minSdkVersion 16
99
targetSdkVersion 19
10-
versionCode 22
11-
versionName '1.6.2'
10+
versionCode 23
11+
versionName '1.6.3'
1212

1313
sourceSets {
1414
main {
-853 Bytes
Binary file not shown.

MPChartLib/src/com/github/mikephil/charting/listener/BarLineChartTouchListener.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public boolean onTouch(View v, MotionEvent event) {
9191
case MotionEvent.ACTION_POINTER_DOWN:
9292

9393
if (event.getPointerCount() >= 2) {
94-
94+
9595
mChart.disableScroll();
9696

9797
saveTouchStart(event);
@@ -122,21 +122,23 @@ public boolean onTouch(View v, MotionEvent event) {
122122
}
123123
break;
124124
case MotionEvent.ACTION_MOVE:
125-
126-
mChart.disableScroll();
127125

128126
if (mTouchMode == DRAG) {
129127

128+
mChart.disableScroll();
129+
130130
performDrag(event);
131131

132132
} else if (mTouchMode == X_ZOOM || mTouchMode == Y_ZOOM || mTouchMode == PINCH_ZOOM) {
133+
134+
mChart.disableScroll();
133135

134136
performZoom(event);
135137

136138
} else if (((mTouchMode == NONE) || (mTouchMode != DRAG && event
137139
.getPointerCount() == 3))
138140
&& Math.abs(distance(event.getX(), mTouchStartPoint.x, event.getY(),
139-
mTouchStartPoint.y)) > 25f) {
141+
mTouchStartPoint.y)) > 25f) {
140142

141143
mTouchMode = DRAG;
142144
}
@@ -179,7 +181,7 @@ private void saveTouchStart(MotionEvent event) {
179181
* @param event
180182
*/
181183
private void performDrag(MotionEvent event) {
182-
184+
183185
mMatrix.set(mSavedMatrix);
184186
PointF dragPoint = new PointF(event.getX(), event.getY());
185187

@@ -199,9 +201,9 @@ private void performDrag(MotionEvent event) {
199201
* @param event
200202
*/
201203
private void performZoom(MotionEvent event) {
202-
203-
if(event.getPointerCount() >= 2) {
204-
204+
205+
if (event.getPointerCount() >= 2) {
206+
205207
// get the distance between the pointers of the touch
206208
// event
207209
float totalDist = spacing(event);

0 commit comments

Comments
 (0)