diff --git a/src/org/fox/ttrss/OnlineActivity.java b/src/org/fox/ttrss/OnlineActivity.java index ef94131b..3c52fdf9 100644 --- a/src/org/fox/ttrss/OnlineActivity.java +++ b/src/org/fox/ttrss/OnlineActivity.java @@ -1198,7 +1198,22 @@ public class OnlineActivity extends CommonActivity { return super.onKeyDown(keyCode, event); } + + // Handle onKeyUp too to suppress beep + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) { + if (m_prefs.getBoolean("use_volume_keys", false)) { + + switch (keyCode) { + case KeyEvent.KEYCODE_VOLUME_UP: + case KeyEvent.KEYCODE_VOLUME_DOWN: + return true; + } + } + return super.onKeyUp(keyCode, event); + } + @SuppressWarnings("unchecked") public void catchupFeed(final Feed feed) { Log.d(TAG, "catchupFeed=" + feed); diff --git a/src/org/fox/ttrss/offline/OfflineActivity.java b/src/org/fox/ttrss/offline/OfflineActivity.java index 41122e0f..78102c1a 100644 --- a/src/org/fox/ttrss/offline/OfflineActivity.java +++ b/src/org/fox/ttrss/offline/OfflineActivity.java @@ -520,6 +520,21 @@ public class OfflineActivity extends CommonActivity { return super.onKeyDown(keyCode, event); } + // Handle onKeyUp too to suppress beep + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) { + if (m_prefs.getBoolean("use_volume_keys", false)) { + + switch (keyCode) { + case KeyEvent.KEYCODE_VOLUME_UP: + case KeyEvent.KEYCODE_VOLUME_DOWN: + return true; + } + } + + return super.onKeyUp(keyCode, event); + } + protected Cursor getFeedById(int feedId) { Cursor c = getReadableDb().query("feeds", null, BaseColumns._ID + "=?",