Bug 918377 - Remove unnecessary extra touch handling from BookmarksListView (r=sriram, a=lsblakk)
authorLucas Rocha <lucasr@mozilla.com>
Thu, 19 Sep 2013 17:23:58 -0400
changeset 160513 0fcd50e19460dd22ed8df2d225f78219413f68b0
parent 160512 92f0f575ff07b56ec9391e9d1333b5b2e2f250ca
child 160514 832d9813c147ef4511a5b9094ec3f012f916d0e6
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssriram, lsblakk
bugs918377
milestone26.0a2
Bug 918377 - Remove unnecessary extra touch handling from BookmarksListView (r=sriram, a=lsblakk)
mobile/android/base/home/BookmarksListView.java
--- a/mobile/android/base/home/BookmarksListView.java
+++ b/mobile/android/base/home/BookmarksListView.java
@@ -9,52 +9,42 @@ import org.mozilla.gecko.R;
 import org.mozilla.gecko.db.BrowserContract.Bookmarks;
 import org.mozilla.gecko.db.BrowserDB.URLColumns;
 import org.mozilla.gecko.home.HomePager.OnUrlOpenListener;
 
 import android.content.Context;
 import android.database.Cursor;
 import android.util.AttributeSet;
 import android.view.KeyEvent;
-import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewConfiguration;
 import android.widget.AdapterView;
 import android.widget.HeaderViewListAdapter;
 import android.widget.ListAdapter;
 import android.widget.ListView;
 
 import java.util.EnumSet;
 
 /**
  * A ListView of bookmarks.
  */
 public class BookmarksListView extends HomeListView
                                implements AdapterView.OnItemClickListener{
     public static final String LOGTAG = "GeckoBookmarksListView";
 
-    // The last motion event that was intercepted.
-    private MotionEvent mMotionEvent;
-
-    // The default touch slop.
-    private int mTouchSlop;
-
     public BookmarksListView(Context context) {
         this(context, null);
     }
 
     public BookmarksListView(Context context, AttributeSet attrs) {
         this(context, attrs, R.attr.bookmarksListViewStyle);
     }
 
     public BookmarksListView(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
-
-        // Scaled touch slop for this context.
-        mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
     }
 
     @Override
     public void onAttachedToWindow() {
         super.onAttachedToWindow();
 
         setOnItemClickListener(this);
 
@@ -66,46 +56,16 @@ public class BookmarksListView extends H
                     return getBookmarksListAdapter().moveToParentFolder();
                 }
                 return false;
             }
         });
     }
 
     @Override
-    public boolean onInterceptTouchEvent(MotionEvent event) {
-        switch(event.getAction() & MotionEvent.ACTION_MASK) {
-            case MotionEvent.ACTION_DOWN: {
-                // Store the event by obtaining a copy.
-                mMotionEvent = MotionEvent.obtain(event);
-                break;
-            }
-
-            case MotionEvent.ACTION_MOVE: {
-                if ((mMotionEvent != null) &&
-                    (Math.abs(event.getY() - mMotionEvent.getY()) > mTouchSlop)) {
-                    // The user is scrolling. Pass the last event to this view,
-                    // and make this view scroll.
-                    onTouchEvent(mMotionEvent);
-                    return true;
-                }
-                break;
-            }
-
-            default: {
-                mMotionEvent = null;
-                break;
-            }
-        }
-
-        // Do default interception.
-        return super.onInterceptTouchEvent(event);
-    }
-
-    @Override
     public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
         final ListView list = (ListView) parent;
         final int headerCount = list.getHeaderViewsCount();
 
         if (position < headerCount) {
             // The click is on a header, don't do anything.
             return;
         }