List of usage examples for android.view KeyEvent KEYCODE_VOLUME_DOWN
int KEYCODE_VOLUME_DOWN
To view the source code for android.view KeyEvent KEYCODE_VOLUME_DOWN.
Click Source Link
From source file:com.dena.app.usage.watcher.MainActivity.java
public boolean onKeyDown(int keyCode, KeyEvent evt) { switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_UP: mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI); return true; case KeyEvent.KEYCODE_VOLUME_DOWN: mAudioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI); return true; default:/*from ww w. ja v a 2s . c om*/ break; } return super.onKeyDown(keyCode, evt); }
From source file:org.chromium.chrome.browser.media.remote.ExpandedControllerActivity.java
@Override public boolean dispatchKeyEvent(KeyEvent event) { int keyCode = event.getKeyCode(); if ((keyCode != KeyEvent.KEYCODE_VOLUME_DOWN && keyCode != KeyEvent.KEYCODE_VOLUME_UP) || mVideoInfo.state == PlayerState.FINISHED) { return super.dispatchKeyEvent(event); }//w ww .j a v a 2s . co m return handleVolumeKeyEvent(mMediaRouteController, event); }
From source file:org.apache.cordova.App.java
/** * Override the default behavior of the Android volume buttons. * If overridden, when the volume button is pressed, the "volume[up|down]button" JavaScript event will be fired. * * @param button volumeup, volumedown * @param override T=override, F=cancel override */// w w w. ja v a 2s . c om public void overrideButton(String button, boolean override) { LOG.i("App", "WARNING: Volume Button Default Behavior will be overridden. The volume event will be fired!"); if (button.equals("volumeup")) { webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_VOLUME_UP, override); } else if (button.equals("volumedown")) { webView.setButtonPlumbedToJs(KeyEvent.KEYCODE_VOLUME_DOWN, override); } }
From source file:tkj.android.homecontrol.mythmote.MythMote.java
/** * Overridden to allow the hardware volume controls to influence the Myth * front end volume control// w w w . j a va 2 s. com */ @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_DOWN: MythCom.GetMythCom(this).SendKey(KEY_VOLUME_DOWN); return true; case KeyEvent.KEYCODE_VOLUME_UP: MythCom.GetMythCom(this).SendKey(KEY_VOLUME_UP); return true; default: return super.onKeyDown(keyCode, event); } }
From source file:com.philips.castdemo.videobrowser.VideoBrowser.java
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (mCastManager.isConnected()) { if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) { changeVolume(CastApplication.VOLUME_INCREMENT); } else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) { changeVolume(-CastApplication.VOLUME_INCREMENT); } else {// w ww .j a v a2s. co m // we don't want to consume non-volume key events return super.onKeyDown(keyCode, event); } if (mCastManager.getPlaybackStatus() == MediaStatus.PLAYER_STATE_PLAYING) { return super.onKeyDown(keyCode, event); } else { return true; } } return super.onKeyDown(keyCode, event); }
From source file:net.reichholf.dreamdroid.abstivities.AbstractHttpActivity.java
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_UP: onButtonClicked(Remote.KEY_VOLP, false); return true; case KeyEvent.KEYCODE_VOLUME_DOWN: onButtonClicked(Remote.KEY_VOLM, false); return true; }/*ww w . j a va 2 s . co m*/ return super.onKeyDown(keyCode, event); }
From source file:com.google.android.marvin.mytalkback.ProcessorVolumeStream.java
private boolean isFromVolumeKey(int keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_UP: return true; }//from ww w.j a v a 2 s .co m return false; }
From source file:com.quarterfull.newsAndroid.NewsDetailActivity.java
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(this); if (mPrefs.getBoolean(SettingsActivity.CB_NAVIGATE_WITH_VOLUME_BUTTONS_STRING, false)) { if ((keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)) { if (currentPosition < rssItems.size() - 1) { mViewPager.setCurrentItem(currentPosition + 1, true); }//from w w w. j a v a 2 s . co m // capture event to avoid volume change at end of feed return true; } else if ((keyCode == KeyEvent.KEYCODE_VOLUME_UP)) { if (currentPosition > 0) { mViewPager.setCurrentItem(currentPosition - 1, true); } // capture event to avoid volume change at beginning of feed return true; } } if (keyCode == KeyEvent.KEYCODE_BACK) { NewsDetailFragment ndf = getNewsDetailFragmentAtPosition(currentPosition);//(NewsDetailFragment) getSupportFragmentManager().findFragmentByTag("android:switcher:" + R.id.pager + ":" + currentPosition); if (ndf != null && ndf.mWebView != null) { if (ndf.urls.size() > 1) { ndf.urls.remove(0); ndf.mWebView.loadUrl(ndf.urls.get(0)); return true; } else if (ndf.urls.size() == 1) { ndf.urls.remove(0); ndf.startLoadRssItemToWebViewTask(); Log.v(TAG, "Load rssitem to webview again"); return true; } } } return super.onKeyDown(keyCode, event); }
From source file:com.neuron.fantecremote.FantecActivity.java
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_VOLUME_UP: send("CMD_VOL_UP"); return true; case KeyEvent.KEYCODE_VOLUME_DOWN: send("CMD_VOL_DOWN"); return true; }/* w ww . j a v a 2 s. co m*/ return super.onKeyDown(keyCode, event); }
From source file:net.reichholf.dreamdroid.abstivities.AbstractHttpActivity.java
@Override public boolean onKeyUp(int keyCode, KeyEvent event) { return keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || super.onKeyUp(keyCode, event); }