fix(MainActivity,ComposeActivity): use onKeyDown() instead

main
Gyuhwan Park 6 years ago
parent 314859f9c0
commit 8a6c8f00ec
  1. 4
      app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java
  2. 8
      app/src/main/java/com/keylesspalace/tusky/MainActivity.java

@ -540,7 +540,7 @@ public final class ComposeActivity
} }
}); });
textEditor.setOnKeyListener((view, keyCode, event) -> this.onKeyShortcut(keyCode, event)); textEditor.setOnKeyListener((view, keyCode, event) -> this.onKeyDown(keyCode, event));
textEditor.setAdapter( textEditor.setAdapter(
new ComposeAutoCompleteAdapter(this)); new ComposeAutoCompleteAdapter(this));
@ -1645,7 +1645,7 @@ public final class ComposeActivity
@Override @Override
public boolean onKeyShortcut(int keyCode, KeyEvent event) { public boolean onKeyDown(int keyCode, KeyEvent event) {
Log.d(TAG, event.toString()); Log.d(TAG, event.toString());
if (event.isCtrlPressed()) { if (event.isCtrlPressed()) {
if (keyCode == KeyEvent.KEYCODE_ENTER) { if (keyCode == KeyEvent.KEYCODE_ENTER) {

@ -281,11 +281,6 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
} }
} }
return super.onKeyDown(keyCode, event);
}
@Override
public boolean onKeyShortcut(int keyCode, KeyEvent event) {
if (event.isCtrlPressed() || event.isShiftPressed()) { if (event.isCtrlPressed() || event.isShiftPressed()) {
// FIXME: blackberry keyONE raises SHIFT key event even CTRL IS PRESSED // FIXME: blackberry keyONE raises SHIFT key event even CTRL IS PRESSED
switch (keyCode) { switch (keyCode) {
@ -297,7 +292,8 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut
} }
} }
} }
return super.onKeyShortcut(keyCode, event);
return super.onKeyDown(keyCode, event);
} }
@Override @Override

Loading…
Cancel
Save