當前位置: 首頁>>代碼示例>>Java>>正文


Java TouchDelegate.onTouchEvent方法代碼示例

本文整理匯總了Java中android.view.TouchDelegate.onTouchEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java TouchDelegate.onTouchEvent方法的具體用法?Java TouchDelegate.onTouchEvent怎麽用?Java TouchDelegate.onTouchEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.TouchDelegate的用法示例。


在下文中一共展示了TouchDelegate.onTouchEvent方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onTouchEvent

import android.view.TouchDelegate; //導入方法依賴的package包/類
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
    if (!mEnabled) return false;

    TouchDelegate delegate = null;

    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            for (int i = 0; i < mTouchDelegates.size(); i++) {
                TouchDelegate touchDelegate = mTouchDelegates.get(i);
                if (touchDelegate.onTouchEvent(event)) {
                    mCurrentTouchDelegate = touchDelegate;
                    return true;
                }
            }
            break;

        case MotionEvent.ACTION_MOVE:
            delegate = mCurrentTouchDelegate;
            break;

        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_UP:
            delegate = mCurrentTouchDelegate;
            mCurrentTouchDelegate = null;
            break;
        default: // Do Nothing
            break;
    }

    return delegate != null && delegate.onTouchEvent(event);
}
 
開發者ID:jahirfiquitiva,項目名稱:FABsMenu,代碼行數:33,代碼來源:TouchDelegateGroup.java

示例2: onTouchEvent

import android.view.TouchDelegate; //導入方法依賴的package包/類
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
  if (!mEnabled) return false;

  TouchDelegate delegate = null;

  switch (event.getAction()) {
  case MotionEvent.ACTION_DOWN:
    for (int i = 0; i < mTouchDelegates.size(); i++) {
      TouchDelegate touchDelegate = mTouchDelegates.get(i);
      if (touchDelegate.onTouchEvent(event)) {
        mCurrentTouchDelegate = touchDelegate;
        return true;
      }
    }
    break;

  case MotionEvent.ACTION_MOVE:
    delegate = mCurrentTouchDelegate;
    break;

  case MotionEvent.ACTION_CANCEL:
  case MotionEvent.ACTION_UP:
    delegate = mCurrentTouchDelegate;
    mCurrentTouchDelegate = null;
    break;
  }

  return delegate != null && delegate.onTouchEvent(event);
}
 
開發者ID:nhocga1995s,項目名稱:MyCalendar,代碼行數:31,代碼來源:TouchDelegateGroup.java

示例3: onTouchEvent

import android.view.TouchDelegate; //導入方法依賴的package包/類
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
        if (!mEnabled) return false;

        TouchDelegate delegate = null;

        switch (event.getAction()) {
                case MotionEvent.ACTION_DOWN:
                        for (int i = 0; i < mTouchDelegates.size(); i++) {
                                TouchDelegate touchDelegate = mTouchDelegates.get(i);
                                if (touchDelegate.onTouchEvent(event)) {
                                        mCurrentTouchDelegate = touchDelegate;
                                        return true;
                                }
                        }
                        break;

                case MotionEvent.ACTION_MOVE:
                        delegate = mCurrentTouchDelegate;
                        break;

                case MotionEvent.ACTION_CANCEL:
                case MotionEvent.ACTION_UP:
                        delegate = mCurrentTouchDelegate;
                        mCurrentTouchDelegate = null;
                        break;
        }

        return delegate != null && delegate.onTouchEvent(event);
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:31,代碼來源:TouchDelegateGroup.java

示例4: onTouchEvent

import android.view.TouchDelegate; //導入方法依賴的package包/類
@Override
public boolean onTouchEvent(MotionEvent event) {
    TouchDelegate delegate = null;
    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            if (mTouchDelegates != null) {
                for (TouchDelegate touchDelegate : mTouchDelegates) {
                    if (touchDelegate != null) {
                        if (touchDelegate.onTouchEvent(event)) {
                            mCurrentTouchDelegate = touchDelegate;
                            return true;
                        }
                    }
                }
            }
            break;
        case MotionEvent.ACTION_MOVE:
            delegate = mCurrentTouchDelegate;
            break;
        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_UP:
            delegate = mCurrentTouchDelegate;
            mCurrentTouchDelegate = null;
            break;
        default:
            break;
    }
    return delegate == null ? false : delegate.onTouchEvent(event);
}
 
開發者ID:venshine,項目名稱:TouchRegion,代碼行數:30,代碼來源:TouchDelegateGroup.java

示例5: onTouchEvent

import android.view.TouchDelegate; //導入方法依賴的package包/類
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
    boolean res = false;
    float x = event.getX();
    float y = event.getY();
    for (TouchDelegate delegate : delegates) {
        event.setLocation(x, y);
        res = delegate.onTouchEvent(event) || res;
    }
    return res;
}
 
開發者ID:ZalemSoftware,項目名稱:Ymir,代碼行數:12,代碼來源:TouchDelegateComposite.java

示例6: onTouchEvent

import android.view.TouchDelegate; //導入方法依賴的package包/類
@Override
public boolean onTouchEvent(MotionEvent event) {
    // Go through the list and see if any of the delegates could claim this event.
    // Note: Assumes non-overlapping touchDelegates.
    boolean result = false;
    // Check against all the touchDelegates in the list -- this could be an
    // ACTION_MOVE or ACTION_UP that impacts a view that isn't at the (x,y) of an event.
    for (TouchDelegate touchDelegate : mDelegateList) {
        result = touchDelegate.onTouchEvent(event) || result;
    }
    return result;
}
 
開發者ID:google,項目名稱:science-journal,代碼行數:13,代碼來源:AccessibilityUtils.java

示例7: onTouchEvent

import android.view.TouchDelegate; //導入方法依賴的package包/類
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
    if (!mEnabled) {
        return false;
    }

    TouchDelegate delegate = null;

    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            for (int i = 0; i < mTouchDelegates.size(); i++) {
                TouchDelegate touchDelegate = mTouchDelegates.get(i);
                if (touchDelegate.onTouchEvent(event)) {
                    mCurrentTouchDelegate = touchDelegate;
                    return true;
                }
            }
            break;

        case MotionEvent.ACTION_MOVE:
            delegate = mCurrentTouchDelegate;
            break;

        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_UP:
            delegate = mCurrentTouchDelegate;
            mCurrentTouchDelegate = null;
            break;
    }

    return delegate != null && delegate.onTouchEvent(event);
}
 
開發者ID:fanwucoder,項目名稱:mvpChat,代碼行數:33,代碼來源:TouchDelegateGroup.java

示例8: onTouchEvent

import android.view.TouchDelegate; //導入方法依賴的package包/類
public final boolean onTouchEvent(MotionEvent paramMotionEvent)
{
  int i = paramMotionEvent.getActionMasked();
  boolean bool1;
  if (i == 0) {
    if (paramMotionEvent.getPointerCount() > 1) {
      bool1 = false;
    }
  }
  for (;;)
  {
    return bool1;
    int j = 0;
    int k = this.mTouchDelegates.size();
    while (j < k)
    {
      TouchDelegate localTouchDelegate = (TouchDelegate)this.mTouchDelegates.valueAt(j);
      float f1 = paramMotionEvent.getX();
      float f2 = paramMotionEvent.getY();
      boolean bool2 = localTouchDelegate.onTouchEvent(paramMotionEvent);
      paramMotionEvent.setLocation(f1, f2);
      if (bool2)
      {
        this.mCurrentTouchDelegate = localTouchDelegate;
        return true;
      }
      j++;
    }
    return false;
    if ((this.mCurrentTouchDelegate != null) && (this.mCurrentTouchDelegate.onTouchEvent(paramMotionEvent))) {}
    for (bool1 = true; (i == 1) || (i == 32); bool1 = false)
    {
      this.mCurrentTouchDelegate = null;
      return bool1;
    }
  }
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:38,代碼來源:TouchDelegateGroup.java

示例9: onTouchEvent

import android.view.TouchDelegate; //導入方法依賴的package包/類
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
    if (!mEnabled) return false;

    TouchDelegate delegate = null;

    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            for (int i = 0; i < mTouchDelegates.size(); i++) {
                TouchDelegate touchDelegate = mTouchDelegates.get(i);
                if (touchDelegate.onTouchEvent(event)) {
                    mCurrentTouchDelegate = touchDelegate;
                    return true;
                }
            }
            break;

        case MotionEvent.ACTION_MOVE:
            delegate = mCurrentTouchDelegate;
            break;

        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_UP:
            delegate = mCurrentTouchDelegate;
            mCurrentTouchDelegate = null;
            break;
    }

    return delegate != null && delegate.onTouchEvent(event);
}
 
開發者ID:rodrigobusata,項目名稱:bhammer-android-old,代碼行數:31,代碼來源:TouchDelegateGroup.java

示例10: onTouchEvent

import android.view.TouchDelegate; //導入方法依賴的package包/類
@Override
public boolean onTouchEvent(MotionEvent event) {

    TouchDelegate delegate = null;

    switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
            if (mTouchDelegates != null) {
                for (TouchDelegate touchDelegate : mTouchDelegates) {
                    if (touchDelegate != null) {
                        if (touchDelegate.onTouchEvent(event)) {
                            mCurrentTouchDelegate = touchDelegate;
                            return true;
                        }
                    }
                }
            }
            break;

        case MotionEvent.ACTION_MOVE:
            delegate = mCurrentTouchDelegate;
            break;

        case MotionEvent.ACTION_CANCEL:
        case MotionEvent.ACTION_UP:
            delegate = mCurrentTouchDelegate;
            mCurrentTouchDelegate = null;
            break;
    }

    return delegate == null ? false : delegate.onTouchEvent(event);
}
 
開發者ID:goodev,項目名稱:android-discourse,代碼行數:33,代碼來源:TouchDelegateGroup.java


注:本文中的android.view.TouchDelegate.onTouchEvent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。