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


Java KeyEvent.KEYCODE_ENDCALL屬性代碼示例

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


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

示例1: onKeyDown

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
	Log.d(THIS_FILE, "Hey you hit the key : " + keyCode);
       if (controlMode == MODE_LOCKER) {
   		switch (keyCode) {
   		case KeyEvent.KEYCODE_CALL:
   			dispatchTriggerEvent(IOnCallActionTrigger.TAKE_CALL);
   			return true;
   		case KeyEvent.KEYCODE_ENDCALL:
   		//case KeyEvent.KEYCODE_POWER:
   			dispatchTriggerEvent(IOnCallActionTrigger.REJECT_CALL);
   			return true;
   		default:
   			break;
   		}
       }
	
	return super.onKeyDown(keyCode, event);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:19,代碼來源:InCallAnswerControls.java

示例2: onKeyDown

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    boolean isKeyCodeSupported = keyCode != KeyEvent.KEYCODE_BACK &&
            keyCode != KeyEvent.KEYCODE_VOLUME_UP &&
            keyCode != KeyEvent.KEYCODE_VOLUME_DOWN &&
            keyCode != KeyEvent.KEYCODE_VOLUME_MUTE &&
            keyCode != KeyEvent.KEYCODE_MENU &&
            keyCode != KeyEvent.KEYCODE_CALL &&
            keyCode != KeyEvent.KEYCODE_ENDCALL;
    if (isInPlaybackState() && isKeyCodeSupported && mMediaController != null) {
        if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK ||
                keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
            if (mMediaPlayer.isPlaying()) {
                pause();
                mMediaController.show();
            } else {
                start();
                mMediaController.hide();
            }
            return true;
        } else if (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY) {
            if (!mMediaPlayer.isPlaying()) {
                start();
                mMediaController.hide();
            }
            return true;
        } else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP
                || keyCode == KeyEvent.KEYCODE_MEDIA_PAUSE) {
            if (mMediaPlayer.isPlaying()) {
                pause();
                mMediaController.show();
            }
            return true;
        } else {
            toggleMediaControlsVisiblity();
        }
    }

    return super.onKeyDown(keyCode, event);
}
 
開發者ID:lisnstatic,項目名稱:live_master,代碼行數:40,代碼來源:IjkVideoView.java

示例3: onKeyDown

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
  boolean isKeyCodeSupported = keyCode != KeyEvent.KEYCODE_BACK && keyCode != KeyEvent.KEYCODE_VOLUME_UP && keyCode != KeyEvent.KEYCODE_VOLUME_DOWN && keyCode != KeyEvent.KEYCODE_MENU && keyCode != KeyEvent.KEYCODE_CALL && keyCode != KeyEvent.KEYCODE_ENDCALL;
  if (isInPlaybackState() && isKeyCodeSupported && mMediaController != null) {
    if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK || keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE || keyCode == KeyEvent.KEYCODE_SPACE) {
      if (mMediaPlayer.isPlaying()) {
        pause();
        mMediaController.show();
      } else {
        start();
        mMediaController.hide();
      }
      return true;
    } else if (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY) {
      if (!mMediaPlayer.isPlaying()) {
          start();
          mMediaController.hide();
      }
      return true;
    } else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP || keyCode == KeyEvent.KEYCODE_MEDIA_PAUSE) {
      if (mMediaPlayer.isPlaying()) {
        pause();
        mMediaController.show();
      }
      return true;
    } else {
      toggleMediaControlsVisiblity();
    }
  }

  return super.onKeyDown(keyCode, event);
}
 
開發者ID:Leavessilent,項目名稱:QuanMinTV,代碼行數:32,代碼來源:VideoView.java

示例4: onKeyUp

@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
    Log.d(THIS_FILE, "Key up : " + keyCode);
    switch (keyCode) {
        case KeyEvent.KEYCODE_VOLUME_DOWN:
        case KeyEvent.KEYCODE_VOLUME_UP:
        case KeyEvent.KEYCODE_CALL:
        case KeyEvent.KEYCODE_SEARCH:
            return true;
        case KeyEvent.KEYCODE_ENDCALL:
            return inCallAnswerControls.onKeyDown(keyCode, event);

    }
    return super.onKeyUp(keyCode, event);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:15,代碼來源:InCallActivity.java

示例5: onKeyDown

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {

  boolean isKeyCodeSupported = keyCode != KeyEvent.KEYCODE_BACK
      && keyCode != KeyEvent.KEYCODE_VOLUME_UP
      && keyCode != KeyEvent.KEYCODE_VOLUME_DOWN
      && keyCode != KeyEvent.KEYCODE_MENU
      && keyCode != KeyEvent.KEYCODE_CALL
      && keyCode != KeyEvent.KEYCODE_ENDCALL;
  if (isInPlaybackState() && isKeyCodeSupported
      && mMediaController != null) {
    if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK
        || keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE
        || keyCode == KeyEvent.KEYCODE_SPACE) {
      if (mMediaPlayer.isPlaying()) {
        pause();
        mMediaController.show();
      } else {
        start();
        mMediaController.hide();
      }
      return true;
    } else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP
        && mMediaPlayer.isPlaying()) {
      pause();
      mMediaController.show();
    } else {
      toggleMediaControlsVisiblity();
    }
  }

  return super.onKeyDown(keyCode, event);
}
 
開發者ID:MUFCRyan,項目名稱:BilibiliClient,代碼行數:33,代碼來源:VideoPlayerView.java

示例6: onEmojiconDeleteEvent

/**
 * 表情刪除
 */
public void onEmojiconDeleteEvent(){
    if (!TextUtils.isEmpty(editText.getText())) {
        KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_DEL, 0, 0, 0, 0, KeyEvent.KEYCODE_ENDCALL);
        editText.dispatchKeyEvent(event);
    }
}
 
開發者ID:zuoweitan,項目名稱:Hitalk,代碼行數:9,代碼來源:ChatPrimaryMenuLayout.java

示例7: onEmojiconDeleteEvent

/**
 * delete emojicon
 */
public void onEmojiconDeleteEvent(){
    if (!TextUtils.isEmpty(editText.getText())) {
        KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_DEL, 0, 0, 0, 0, KeyEvent.KEYCODE_ENDCALL);
        editText.dispatchKeyEvent(event);
    }
}
 
開發者ID:turoDog,項目名稱:KTalk,代碼行數:9,代碼來源:EaseChatPrimaryMenu.java

示例8: backspace

/**
 * 刪除Emoji表情
 *
 * @param editText
 */
public static void backspace(EditText editText) {
    if (editText == null) {
        return;
    }
    KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_DEL, 0, 0, 0,
            0, KeyEvent.KEYCODE_ENDCALL);
    editText.dispatchKeyEvent(event);
}
 
開發者ID:hsj-xiaokang,項目名稱:OSchina_resources_android,代碼行數:13,代碼來源:InputHelper.java

示例9: backspace

public static void backspace(EditText editText) {
    KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_DEL, 0, 0, 0, 0, KeyEvent.KEYCODE_ENDCALL);
    editText.dispatchKeyEvent(event);
}
 
開發者ID:nickyangjun,項目名稱:EasyEmoji,代碼行數:4,代碼來源:EmojiUtil.java

示例10: backspace

public void backspace() {
    final KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_DEL, 0, 0, 0, 0, KeyEvent.KEYCODE_ENDCALL);
    dispatchKeyEvent(event);
}
 
開發者ID:apradanas,項目名稱:prismoji-android,代碼行數:4,代碼來源:PrismojiEditText.java

示例11: onKeyDown

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    Log.d(THIS_FILE, "Key down : " + keyCode);
    switch (keyCode) {
        case KeyEvent.KEYCODE_VOLUME_DOWN:
        case KeyEvent.KEYCODE_VOLUME_UP:
            //
            // Volume has been adjusted by the user.
            //
            Log.d(THIS_FILE, "onKeyDown: Volume button pressed");
            int action = AudioManager.ADJUST_RAISE;
            if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
                action = AudioManager.ADJUST_LOWER;
            }

            // Detect if ringing
            SipCallSession currentCallInfo = getActiveCallInfo();
            // If not any active call active
            if (currentCallInfo == null && serviceConnected) {
                break;
            }

            if (service != null) {
                try {
                    service.adjustVolume(currentCallInfo, action, AudioManager.FLAG_SHOW_UI);
                } catch (RemoteException e) {
                    Log.e(THIS_FILE, "Can't adjust volume", e);
                }
            }

            return true;
        case KeyEvent.KEYCODE_CALL:
        case KeyEvent.KEYCODE_ENDCALL:
            return inCallAnswerControls.onKeyDown(keyCode, event);
        case KeyEvent.KEYCODE_SEARCH:
            // Prevent search
            return true;
        default:
            // Nothing to do
    }
    return super.onKeyDown(keyCode, event);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:42,代碼來源:InCallActivity.java

示例12: onKeyDown

@Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
    boolean isKeyCodeSupported = keyCode != KeyEvent.KEYCODE_BACK && keyCode != KeyEvent.KEYCODE_VOLUME_UP
        && keyCode != KeyEvent.KEYCODE_VOLUME_DOWN && keyCode != KeyEvent.KEYCODE_VOLUME_MUTE
        && keyCode != KeyEvent.KEYCODE_MENU && keyCode != KeyEvent.KEYCODE_CALL
        && keyCode != KeyEvent.KEYCODE_ENDCALL;
    if (isInPlaybackState() && isKeyCodeSupported && mMediaController != null)
    {
        if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK || keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE)
        {
            if (mMediaPlayer.isPlaying())
            {
                pause();
                mMediaController.show();
            }
            else
            {
                start();
                mMediaController.hide();
            }
            return true;
        }
        else if (keyCode == KeyEvent.KEYCODE_MEDIA_PLAY)
        {
            if (!mMediaPlayer.isPlaying())
            {
                start();
                mMediaController.hide();
            }
            return true;
        }
        else if (keyCode == KeyEvent.KEYCODE_MEDIA_STOP || keyCode == KeyEvent.KEYCODE_MEDIA_PAUSE)
        {
            if (mMediaPlayer.isPlaying())
            {
                pause();
                mMediaController.show();
            }
            return true;
        }
        else
        {
            toggleMediaControlsVisiblity();
        }
    }
    
    return super.onKeyDown(keyCode, event);
}
 
開發者ID:Dreamxiaoxuan,項目名稱:AndroidTvDemo,代碼行數:49,代碼來源:IjkVideoView.java


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