Remove needless preference
Define constants at first
Update canScrollHorizontally and canScrollVertically from touch event