List of usage examples for android.view KeyEvent startTracking
public final void startTracking()
From source file:com.launcher.silverfish.launcher.LauncherActivity.java
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { // Override the functionality of back and home key if ((keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_HOME) && event.getRepeatCount() == 0) { event.startTracking(); return true; }//ww w. ja v a 2 s . co m return super.onKeyDown(keyCode, event); }
From source file:io.github.hidroh.materialistic.VolumeNavigationDelegate.java
/** * Calls from {@link Activity#onKeyDown(int, KeyEvent)} to delegate * @param keyCode event key code/*from w w w. j a v a 2 s. co m*/ * @param event key event * @return true if is intercepted as navigation, false otherwise */ public boolean onKeyDown(int keyCode, KeyEvent event) { if (!mEnabled) { return false; } if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) { event.startTracking(); return true; } return false; }
From source file:edu.stanford.mobisocial.dungbeetle.ui.fragments.AppsViewFragment.java
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) { event.startTracking(); return true; }//w ww . j av a2 s. c o m if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) { event.startTracking(); return true; } if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK) { Intent record = new Intent(getActivity(), VoiceQuickRecordActivity.class); record.putExtra("feed_uri", mFeedUri); startActivity(record); return true; } return false; }
From source file:io.github.hidroh.materialistic.KeyDelegate.java
/** * Calls from {@link Activity#onKeyDown(int, KeyEvent)} to delegate * @param keyCode event key code/*www . ja va 2 s .c om*/ * @param event key event * @return true if is intercepted as navigation, false otherwise */ public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) { return mBackInterceptor != null && mBackInterceptor.onBackPressed(); } if (!mEnabled) { return false; } if (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) { event.startTracking(); return true; } return false; }
From source file:com.holo.fileexplorer.MainActivity.java
/** * KeyDown/KeyUp code derived from/* www. ja v a2 s .c om*/ * http://developer.android.com/sdk/android-2.0.html (read very bottom of * page) * <p> * The user may tap the back button, but then drag off of the button to * avoid a button press * * @see android.support.v4.app.FragmentActivity#onKeyDown(int, * android.view.KeyEvent) * * */ public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { event.startTracking(); return true; } return super.onKeyDown(keyCode, event); }
From source file:net.olejon.spotcommander.WebViewActivity.java
@Override public boolean onKeyDown(int keyCode, @NonNull KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_BACK: { event.startTracking(); return true; }// w w w .ja v a2 s .c o m case KeyEvent.KEYCODE_MENU: { return true; } case KeyEvent.KEYCODE_SEARCH: { return true; } case KeyEvent.KEYCODE_VOLUME_DOWN: { return true; } case KeyEvent.KEYCODE_VOLUME_UP: { return true; } default: { return super.onKeyDown(keyCode, event); } } }
From source file:com.tr4android.support.extension.widget.FloatingActionMenu.java
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && mExpanded) { event.startTracking(); return true; }// w w w . ja va 2s .c o m return super.onKeyDown(keyCode, event); }
From source file:com.audiokernel.euphonyrmt.MainMenuActivity.java
@Override public boolean onKeyDown(final int keyCode, final KeyEvent event) { final boolean result; if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN || keyCode == KeyEvent.KEYCODE_VOLUME_UP) { // For onKeyLongPress to work event.startTracking(); result = !mApp.isLocalAudible(); } else {/*from w w w . ja va 2 s . c om*/ result = super.onKeyDown(keyCode, event); } return result; }
From source file:com.freerdp.freerdpcore.presentation.SessionActivity.java
@Override public boolean onKeyDown(int keycode, KeyEvent event) { if (keycode == KeyEvent.KEYCODE_BACK && rladvertising.getVisibility() == View.VISIBLE) { try {//from w w w .j ava 2 s . c o m connectCancelledByUser = true; rladvertising.stopPlay(); rladvertising.getLock().notifyAll(); LibFreeRDP.cancelConnection(session.getInstance()); } catch (Exception e) { } finish(); return false; } if (event.getRepeatCount() == 0 && keycode == KeyEvent.KEYCODE_BACK) { event.startTracking(); return true; } return keyboardMapper.processAndroidKeyEvent(event); }
From source file:com.cyanogenmod.filemanager.ui.widgets.DrawerLayout.java
@Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && hasVisibleDrawer()) { event.startTracking(); return true; }/*w w w . j av a 2 s .c o m*/ return super.onKeyDown(keyCode, event); }