Merge pull request #12 from moneytoo/volumekeys
Added handling of volume keys in onKeyUp to suppress beeping
This commit is contained in:
commit
cb39f9aa25
@ -1198,7 +1198,22 @@ public class OnlineActivity extends CommonActivity {
|
|||||||
|
|
||||||
return super.onKeyDown(keyCode, event);
|
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")
|
@SuppressWarnings("unchecked")
|
||||||
public void catchupFeed(final Feed feed) {
|
public void catchupFeed(final Feed feed) {
|
||||||
Log.d(TAG, "catchupFeed=" + feed);
|
Log.d(TAG, "catchupFeed=" + feed);
|
||||||
|
@ -520,6 +520,21 @@ public class OfflineActivity extends CommonActivity {
|
|||||||
return super.onKeyDown(keyCode, event);
|
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) {
|
protected Cursor getFeedById(int feedId) {
|
||||||
Cursor c = getReadableDb().query("feeds", null,
|
Cursor c = getReadableDb().query("feeds", null,
|
||||||
BaseColumns._ID + "=?",
|
BaseColumns._ID + "=?",
|
||||||
|
Loading…
Reference in New Issue
Block a user