mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 05:02:26 -05:00
Added key bindings in message view
This commit is contained in:
parent
ca569d9988
commit
bc6929e964
@ -28,6 +28,7 @@ import android.os.Process;
|
|||||||
import android.text.util.Regex;
|
import android.text.util.Regex;
|
||||||
import android.util.Config;
|
import android.util.Config;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.KeyEvent;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
@ -95,6 +96,23 @@ public class MessageView extends Activity
|
|||||||
private Listener mListener = new Listener();
|
private Listener mListener = new Listener();
|
||||||
private MessageViewHandler mHandler = new MessageViewHandler();
|
private MessageViewHandler mHandler = new MessageViewHandler();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
switch (keyCode) {
|
||||||
|
case KeyEvent.KEYCODE_DEL: { onDelete(); break;}
|
||||||
|
case KeyEvent.KEYCODE_F: { onForward(); break;}
|
||||||
|
case KeyEvent.KEYCODE_A: { onReplyAll(); break; }
|
||||||
|
case KeyEvent.KEYCODE_R: { onReply(); break; }
|
||||||
|
case KeyEvent.KEYCODE_J: { onPrevious(); break; }
|
||||||
|
case KeyEvent.KEYCODE_K: { onNext(); break; }
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MessageViewHandler extends Handler {
|
class MessageViewHandler extends Handler {
|
||||||
private static final int MSG_PROGRESS = 2;
|
private static final int MSG_PROGRESS = 2;
|
||||||
private static final int MSG_ADD_ATTACHMENT = 3;
|
private static final int MSG_ADD_ATTACHMENT = 3;
|
||||||
@ -218,6 +236,9 @@ public class MessageView extends Activity
|
|||||||
msg.arg1 = show ? 1 : 0;
|
msg.arg1 = show ? 1 : 0;
|
||||||
sendMessage(msg);
|
sendMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class Attachment {
|
class Attachment {
|
||||||
|
Loading…
Reference in New Issue
Block a user