colaorange / daily-money-plus-contribution

Android project for daily-money contribution
3 stars 1 forks source link

need to enhance action mode #27

Open dennischen opened 6 years ago

dennischen commented 6 years ago

最新一版操作變化有點多,原本只要點幾下的動作,現在都要多出好多手續,加上因為原本使用已經熟悉到慣性,現在反而每次操作都帶有很大的不確定性。

dennischen commented 6 years ago

I want to finish activity when back was clicked even there is a action-mode however, I tried 1.onBackPress, it doesn't called when action mode is up 2.https://stackoverflow.com/questions/11725729/prevent-to-cancel-action-mode-by-press-back-button

    public boolean dispatchKeyEvent(KeyEvent event) {
        System.out.println(">>>>>>>>>>>>>>>>>dispatchKeyEvents "+event);
        //https://stackoverflow.com/questions/11725729/prevent-to-cancel-action-mode-by-press-back-button
        /**
         * #27 need to enhance action mode
         * when press on back key, we also cloas action mode, to prevent clicking twice to back to previous page
         * to cancel a action mode, use back-arrow icon on top-left
         */
        if (actionMode != null && event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_UP) {
            System.out.println(">>>>>>>>>>>>>>>>>finish ");
            finish();
            return true;
        }
        return super.dispatchKeyEvent(event);
    }

action_up doesn't be called when action-model is up.

dennischen commented 6 years ago

If I always finish action-mode when an action is done, it would be more unpredictable in the case of editing a record. (BUT it is compatible to legacy behavior, which is no selection state)