mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 03:32:16 -05:00
Added a "DELETE" keybinding in the FolderMessageList
This commit is contained in:
parent
822b3b3daa
commit
a6956b5bae
@ -17,6 +17,7 @@ import android.os.Process;
|
|||||||
import android.util.Config;
|
import android.util.Config;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
|
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;
|
||||||
@ -449,6 +450,27 @@ public class FolderMessageList extends ExpandableListActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
|
int group = mListView.getPackedPositionGroup(mListView.getSelectedId());
|
||||||
|
int item =(mListView.getSelectedItemPosition() -1 );
|
||||||
|
if (item >= 0) { // Guard against hitting delete on group names
|
||||||
|
switch (keyCode) {
|
||||||
|
case KeyEvent.KEYCODE_DEL: {
|
||||||
|
if (true) {
|
||||||
|
MessageInfoHolder message = (MessageInfoHolder) mAdapter.getChild(group, item);
|
||||||
|
|
||||||
|
onDelete(message);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.onKeyDown(keyCode, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
|
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
|
||||||
int childPosition, long id) {
|
int childPosition, long id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user