当前位置: 首页>>代码示例>>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;未经允许,请勿转载。