private void dispatchTouchEventToListView(MotionEvent event) { int motionX = (int) event.getX(); DebugLog.d(TAG, "motionMove real motionX:" + motionX); if (event.getAction() == MotionEvent.ACTION_DOWN) { mTouchDownY = 0; mKeyguardListView.dealwithTouchEvent(event); } DebugLog.d( TAG, "motionMove real is beginScroll:" + mKeyguardListView.isBeginScroll((int) event.getX())); if (mKeyguardListView.isBeginScroll()) { if (event.getAction() != MotionEvent.ACTION_UP) { // int infozoneHeight = // mKeyguardViewHost.getKeyguardPage().getInfozoneViewHeight(); int infozoneHeight = 0; int copyWriter = mKeyguardViewHost.getHkCaptionsViewHeight(); int scollAtHorizontalHeight = KWDataCache.getAllScreenHeigt(mContext) - infozoneHeight - copyWriter; DebugLog.d(TAG, "motionMove real mTouchDownY:" + mTouchDownY); DebugLog.d(TAG, "motionMove real scollAtHorizontalHeight:" + scollAtHorizontalHeight); if (mTouchDownY < scollAtHorizontalHeight) { mKeyguardListView.dealwithTouchEvent(event); } } } if (event.getAction() == MotionEvent.ACTION_UP) { mKeyguardListView.dealwithTouchEvent(event); } }
private void initHorizontalListView() { mKeyguardViewHost.setOnViewTouchListener(mViewTouchListener); if (mContainer != null) { mKeyguardViewHost.addView(mContainer, 0); mContainer.reset(); return; } mContainer = new KeyguardWallpaperContainer(mContext.getApplicationContext()); mKeyguardListView = new KeyguardListView(mContext.getApplicationContext()); mKeyguardListView.setOnScrollListener(mKeyguardListViewScrollListener); mContainer.addView(mKeyguardListView, 0); mKeyguardViewHost.addView(mContainer, 0); UIController controller = UIController.getInstance(); mKeyguardListView.setTouchlListener(controller); controller.setmKeyguardListView(mKeyguardListView); /* if (Common.isPowerSaverMode()) { mKeyguardListView.setVisibility(View.GONE); mContainer.setVisibility(View.GONE); mViewMediatorCallback.setKeyguardWallpaperShow(true); }*/ }
@Override public void onInterceptTouch(MotionEvent event) { if (mKeyguardViewHost.isAmigoHostYAtHomePostion()) { mKeyguardListView.interceptTouchEvent(event); } }