Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Suggest to add "OnKeyXXX" Annotations #1238

@jiongxuan

Description

@jiongxuan

Which examples looks better?

General:

    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
            return true;
        }

        return super.onKeyDown(keyCode, event);
    }

AA which i want to:

    @KeyDown(KeyEvent.KEYCODE_BACK)
    public boolean onPressedBack() {
        return true;
    }

(Same as Key Up/Long Press/Shortcut etc.)
Support "dispatch" parameters.

Compared with the EventBus I mentioned previously, this looks easier to write, and more practical.
What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions