diff options
author | Andrew Dolgov <[email protected]> | 2012-11-22 18:51:20 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-11-22 18:51:20 +0400 |
commit | 337d51a78f124d6a715aa568a6dc917c57dba35c (patch) | |
tree | b8a1714521776492029fe78315378cfeb2e4e694 | |
parent | 6c0543f7bc3f1807f6806272358a6fe772c38e17 (diff) |
fix article sliding on tap
-rw-r--r-- | AndroidManifest.xml | 4 | ||||
-rw-r--r-- | src/org/fox/ttcomics/ComicFragment.java | 23 |
2 files changed, 9 insertions, 18 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index e1373a4..17d69e9 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,7 +1,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttcomics"
- android:versionCode="22"
- android:versionName="1.0.10" >
+ android:versionCode="23"
+ android:versionName="1.0.11" >
<uses-sdk
android:minSdkVersion="8"
diff --git a/src/org/fox/ttcomics/ComicFragment.java b/src/org/fox/ttcomics/ComicFragment.java index 7c7e557..104a540 100644 --- a/src/org/fox/ttcomics/ComicFragment.java +++ b/src/org/fox/ttcomics/ComicFragment.java @@ -116,29 +116,20 @@ public class ComicFragment extends Fragment { });
image.setOnTouchListener(new View.OnTouchListener() {
- int m_x;
- int m_y;
-
@Override
public boolean onTouch(View view, MotionEvent event) {
switch (event.getAction()) {
- case MotionEvent.ACTION_DOWN:
- m_x = Math.round(event.getX());
- m_y = Math.round(event.getY());
- break;
case MotionEvent.ACTION_UP:
int x = Math.round(event.getX());
- int y = Math.round(event.getY());
+ //int y = Math.round(event.getY());
- if (x == m_x && y == m_y) {
- int width = view.getWidth();
+ int width = view.getWidth();
- if (x <= width/6) {
- onLeftSideTapped();
- } else if (x >= width-(width/6)) {
- onRightSideTapped();
- }
- }
+ if (x <= width/6) {
+ onLeftSideTapped();
+ } else if (x >= width-(width/6)) {
+ onRightSideTapped();
+ }
break;
}
return false;
|