Merge pull request #12 from moneytoo/volumekeys
Added handling of volume keys in onKeyUp to suppress beeping
This commit is contained in:
commit
cb39f9aa25
@ -1199,6 +1199,21 @@ 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);
|
||||
|
@ -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 + "=?",
|
||||
|
Loading…
Reference in New Issue
Block a user