{"action":"opened","issue":{"url":"https://api.github.com/repos/Leaking/SlideSwitch/issues/7","repository_url":"https://api.github.com/repos/Leaking/SlideSwitch","labels_url":"https://api.github.com/repos/Leaking/SlideSwitch/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Leaking/SlideSwitch/issues/7/comments","events_url":"https://api.github.com/repos/Leaking/SlideSwitch/issues/7/events","html_url":"https://github.com/Leaking/SlideSwitch/issues/7","id":134165140,"number":7,"title":"提个建议","user":{"login":"zzy0990","id":11505598,"avatar_url":"https://avatars.githubusercontent.com/u/11505598?v=3","gravatar_id":"","url":"https://api.github.com/users/zzy0990","html_url":"https://github.com/zzy0990","followers_url":"https://api.github.com/users/zzy0990/followers","following_url":"https://api.github.com/users/zzy0990/following{/other_user}","gists_url":"https://api.github.com/users/zzy0990/gists{/gist_id}","starred_url":"https://api.github.com/users/zzy0990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zzy0990/subscriptions","organizations_url":"https://api.github.com/users/zzy0990/orgs","repos_url":"https://api.github.com/users/zzy0990/repos","events_url":"https://api.github.com/users/zzy0990/events{/privacy}","received_events_url":"https://api.github.com/users/zzy0990/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-17T03:14:28Z","updated_at":"2016-02-17T03:14:28Z","closed_at":null,"body":"在moveToDest方法里面判断手势回调时增加当前状态的判断，如果当然是open状态，则继续重复右滑就不在回调，反之亦然。\r\n`public void moveToDest(final boolean toRight) {\r\n        final Handler handler = new Handler() {\r\n            @Override\r\n            public void handleMessage(Message msg) {\r\n                if (msg.what == 1) {\r\n                    listener.open();\r\n                } else {\r\n                    listener.close();\r\n                }\r\n            }\r\n        };\r\n        new Thread(new Runnable() {\r\n            @Override\r\n            public void run() {\r\n                if (toRight) {\r\n                    while (frontRect_left <= max_left) {\r\n                        alpha = (int) (255 * (float) frontRect_left / (float) max_left);\r\n                        invalidateView();\r\n                        frontRect_left += 3;\r\n                        try {\r\n                            Thread.sleep(3);\r\n                        } catch (InterruptedException e) {\r\n                            e.printStackTrace();\r\n                        }\r\n                    }\r\n                    alpha = 255;\r\n                    frontRect_left = max_left;\r\n                    if (!isOpen) {\r\n                        isOpen = true;\r\n                        if (listener != null)\r\n                            handler.sendEmptyMessage(1);\r\n                        frontRect_left_begin = max_left;\r\n                    }\r\n                } else {\r\n                    while (frontRect_left >= min_left) {\r\n                        alpha = (int) (255 * (float) frontRect_left / (float) max_left);\r\n                        invalidateView();\r\n                        frontRect_left -= 3;\r\n                        try {\r\n                            Thread.sleep(3);\r\n                        } catch (InterruptedException e) {\r\n                            e.printStackTrace();\r\n                        }\r\n                    }\r\n                    alpha = 0;\r\n                    frontRect_left = min_left;\r\n                    if (isOpen) {\r\n                        isOpen = false;\r\n                        if (listener != null)\r\n                            handler.sendEmptyMessage(0);\r\n                        frontRect_left_begin = min_left;\r\n                    }\r\n                }\r\n            }\r\n        }).start();\r\n    }`"}}