@Override public boolean onSingleTapConfirmed(MotionEvent e) { LogUtil.logAnyTime(TAG, "onSingleTapConfirmed"); Object id = getTag() == null ? "" : getTag(); mPage.interpreter("ShowBox::" + id.toString(), (itemExps.get(currentIndex)).toString()); return true; }
@Override public String doX() { String url = Constant.getAlipayServer(mContext); url = url + "/mobileFile.htm"; APHttpClient aPHttpClient = new APHttpClient(url, mContext); ArrayList<BasicNameValuePair> pairs = new ArrayList<BasicNameValuePair>(); pairs.add(new BasicNameValuePair("requestData", buildRequestAsString())); pairs.add(new BasicNameValuePair(ServiceBeanConstants.FILECONTENT, fileContent)); LogUtil.logOnlyDebuggable( "HttpClient", "Request" + buildRequestAsString() + ";fileContent:" + fileContent); String response = aPHttpClient.sendSynchronousRequestAsHttpResponse(pairs); extractBasicResponse(response); return response; }
@Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { LogUtil.logAnyTime(TAG, "onFling"); if (showBox_Type == UISHOWBOX_H) { if (e1.getX() > e2.getX()) { // move to left flipper.showNext(); currentIndex += 1; if (currentIndex == uris.size()) { currentIndex = 0; } } else if (e1.getX() < e2.getX()) { flipper.setInAnimation(mPage.getRawContext(), R.anim.push_right_in); flipper.setOutAnimation(mPage.getRawContext(), R.anim.push_right_out); flipper.showPrevious(); flipper.setInAnimation(mPage.getRawContext(), R.anim.push_left_in); flipper.setOutAnimation(mPage.getRawContext(), R.anim.push_left_out); currentIndex -= 1; if (currentIndex == -1) { currentIndex = uris.size() - 1; } } else { return false; } } else { if (e1.getY() < e2.getY()) { // move to bottom System.out.println("onFling" + "1"); flipper.showNext(); } else if (e1.getY() > e2.getY()) { flipper.setInAnimation(mPage.getRawContext(), R.anim.push_bottom_in); flipper.setOutAnimation(mPage.getRawContext(), R.anim.push_bottom_out); flipper.showPrevious(); flipper.setInAnimation(mPage.getRawContext(), R.anim.push_top_in); flipper.setOutAnimation(mPage.getRawContext(), R.anim.push_top_out); } else { return false; } } return true; }
// OnTouchListener实现的接口 @Override public boolean onTouch(View v, MotionEvent event) { LogUtil.logAnyTime(TAG, "onTouch"); return mGestureDetector.onTouchEvent(event); }
@Override public boolean onSingleTapUp(MotionEvent e) { LogUtil.logAnyTime(TAG, "onSingleTapUp"); return false; }
@Override public void onShowPress(MotionEvent e) { LogUtil.logAnyTime(TAG, "onShowPress"); }
@Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { LogUtil.logAnyTime(TAG, "onScroll"); return false; }
// OnGestureListener实现的接口 @Override public boolean onDown(MotionEvent e) { LogUtil.logAnyTime(TAG, "onDown"); return true; }
@Override public boolean onDoubleTapEvent(MotionEvent e) { LogUtil.logAnyTime(TAG, "onDoubleTapEvent"); return false; }