{"action":"created","comment":{"url":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/comments/22762813","id":22762813,"diff_hunk":"@@ -581,150 +573,136 @@ void setPanelFragment(int side, Fragment fragment) {\n             } else if (fragment == null) {\n                 ft.remove(currentFragment);\n             } else if (currentFragment == null) {\n-                ft.add(id, fragment, tag);\n+                ft.add(id, fragment);\n             } else {\n-                ft.replace(id, fragment, tag);\n+                ft.replace(id, fragment);\n             }\n \n-            Log.d(this.getClass().getSimpleName(), String.format(\"Add on side %s the fragment %s, replacing  %s\",tag,to,from));\n-\n             drawers.put(id, fragment);\n \n-            if (isDrawer)\n-                lockDrawer(side, (fragment == null));\n-\n             ft.commitAllowingStateLoss();\n             if (fragment != null) fragment.setMenuVisibility(menuVisbility);\n         }\n \n-        void lockDrawer(int side, boolean locked) {\n-            if (hasDrawer && locked)\n-                extensibleDrawerToggle.getDrawer().setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, side);\n-            else if (hasDrawer)\n-                extensibleDrawerToggle.getDrawer().setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, side);\n+        public void cleanupMenus() {\n+            nickFragment.setMenuVisibility(false);\n+            chatFragment.setMenuVisibility(false);\n+            detailFragment.setMenuVisibility(false);\n         }\n \n-        public void setWindowProperties(int side) {\n-            switch (side) {\n-                case Gravity.START:\n-                    bufferFragment.setMenuVisibility(true);\n-                    chatFragment.setMenuVisibility(false);\n-                    break;\n-                case Gravity.END:\n-                case Gravity.NO_GRAVITY:\n-                default:\n-                    bufferFragment.setMenuVisibility(false);\n-                    chatFragment.setMenuVisibility(true);\n-                    break;\n+        @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n+        public void setupDrawer() {\n+            leftDrawer = (DrawerLayout) findViewById(R.id.main_drawer);\n+            rightDrawer = (DrawerLayout) findViewById(R.id.nick_drawer);\n+\n+            if (leftDrawer!=null) {\n+                leftDrawer.setStatusBarBackgroundColor(getResources().getColor(R.color.primary_dark));\n+\n+                extensibleDrawerToggle = new ExtensibleDrawerToggle(leftDrawer, new ActionBarDrawerToggle(\n+                        MainActivity.this, /* host Activity */\n+                        leftDrawer, /* DrawerLayout object */\n+                        actionbar.getWrappedToolbar(), /* nav drawer icon to replace 'Up' caret */\n+                        R.string.hint_drawer_open, /* \"open drawer\" description */\n+                        R.string.hint_drawer_close /* \"close drawer\" description */\n+                ) {\n+                    /**\n+                     * Called when a drawer has settled in a completely closed state.\n+                     */\n+                    public void onDrawerClosed(View drawerView) {\n+                        updateBufferRead();\n+                        updateBufferRead();\n+                        ((BufferFragment) manager.bufferFragment).finishActionMode();\n+                        setTitleAndMenu();\n+                    }\n+\n+                    /**\n+                     * Called when a drawer has settled in a completely open state.\n+                     */\n+                    public void onDrawerOpened(View drawerView) {\n+                        manager.closeDrawer(Side.RIGHT);\n+                        setTitleAndMenu();\n+                    }\n+\n+                    public void onDrawerSlide(View drawerView, float slideOffset) {\n+                        if (manager.isDrawerVisible(Side.RIGHT))\n+                            manager.closeDrawer(Side.RIGHT);\n+                        super.onDrawerSlide(drawerView,0);\n+                    }\n+                });\n+                leftDrawer.setDrawerListener((extensibleDrawerToggle.getDrawerListener()));\n+            } else if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP) {\n+                getWindow().setStatusBarColor(getResources().getColor(R.color.primary_dark));\n             }\n         }\n \n-        public int getOpenDrawers() {\n-            if (hasDrawer)\n-                return getOpenDrawers(extensibleDrawerToggle.drawer);\n-            else\n-                return Gravity.NO_GRAVITY;\n-        }\n+        private void onDrawerButtonClicked() {\n+            if (manager.getLockMode(Side.RIGHT)!=DrawerLayout.LOCK_MODE_UNLOCKED)\n+                return;\n \n-        public int getOpenDrawers(DrawerLayout drawer) {\n-            if (!hasDrawer || drawer.isDrawerVisible(Gravity.START)) {\n-                return Gravity.START;\n-            } else if (drawer.isDrawerVisible(Gravity.END)) {\n-                return Gravity.END;\n+            if (isDrawerVisible(Side.RIGHT)) {\n+                closeDrawer(Side.RIGHT);\n             } else {\n-                return Gravity.NO_GRAVITY;\n+                openDrawer(Side.RIGHT);\n             }\n         }\n \n-        public void closeDrawerOpposite(View drawerView) {\n-            if (hasDrawer && drawerView.getTag()==\"LEFT\")\n-                closeDrawer(Gravity.START);\n-            else if (hasDrawer)\n-                closeDrawer(Gravity.END);\n-        }\n+        private void closeDrawer(Side side) {\n+            if (side==Side.RIGHT||side==Side.BOTH) {\n+                rightDrawer.closeDrawers();\n+            }\n \n-        public void openDrawer(int openedDrawer) {\n-            if (hasDrawer) {\n-                closeDrawer(Gravity.CENTER);\n-                if (openedDrawer != Gravity.NO_GRAVITY) {\n-                    drawer.openDrawer(openedDrawer);\n-                }\n+            if (leftDrawer!=null&&(side==Side.LEFT||side==Side.BOTH)) {\n+                leftDrawer.closeDrawers();\n             }\n+            openDrawer = Side.NONE;\n         }\n \n-        public void cleanup() {\n-            setPanelFragment(Gravity.START, null);\n-            setPanelFragment(Gravity.END, null);\n-            setPanelFragment(Gravity.NO_GRAVITY, null);\n \n-            bufferFragment = null;\n-            nickFragment = null;\n-            chatFragment = null;\n-            detailFragment = null;\n-        }\n+        public void openDrawer(Side side) {\n+            if (side==Side.RIGHT) {","path":"QuasselDroid/src/main/java/com/iskrembilen/quasseldroid/gui/MainActivity.java","position":511,"original_position":511,"commit_id":"94a955d79f8ea31576cedfd49eb250a96a802527","original_commit_id":"94a955d79f8ea31576cedfd49eb250a96a802527","user":{"login":"justjanne","id":3933349,"avatar_url":"https://avatars.githubusercontent.com/u/3933349?v=3","gravatar_id":"","url":"https://api.github.com/users/justjanne","html_url":"https://github.com/justjanne","followers_url":"https://api.github.com/users/justjanne/followers","following_url":"https://api.github.com/users/justjanne/following{/other_user}","gists_url":"https://api.github.com/users/justjanne/gists{/gist_id}","starred_url":"https://api.github.com/users/justjanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justjanne/subscriptions","organizations_url":"https://api.github.com/users/justjanne/orgs","repos_url":"https://api.github.com/users/justjanne/repos","events_url":"https://api.github.com/users/justjanne/events{/privacy}","received_events_url":"https://api.github.com/users/justjanne/received_events","type":"User","site_admin":false},"body":"And same answer here, the right drawer exists in every layout as a drawer.","created_at":"2015-01-10T23:26:41Z","updated_at":"2015-01-10T23:26:41Z","html_url":"https://github.com/sandsmark/QuasselDroid/pull/220#discussion_r22762813","pull_request_url":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/220","_links":{"self":{"href":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/comments/22762813"},"html":{"href":"https://github.com/sandsmark/QuasselDroid/pull/220#discussion_r22762813"},"pull_request":{"href":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/220"}}},"pull_request":{"url":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/220","id":26749111,"html_url":"https://github.com/sandsmark/QuasselDroid/pull/220","diff_url":"https://github.com/sandsmark/QuasselDroid/pull/220.diff","patch_url":"https://github.com/sandsmark/QuasselDroid/pull/220.patch","issue_url":"https://api.github.com/repos/sandsmark/QuasselDroid/issues/220","number":220,"state":"open","locked":false,"title":"Redesigned the UI slightly","user":{"login":"justjanne","id":3933349,"avatar_url":"https://avatars.githubusercontent.com/u/3933349?v=3","gravatar_id":"","url":"https://api.github.com/users/justjanne","html_url":"https://github.com/justjanne","followers_url":"https://api.github.com/users/justjanne/followers","following_url":"https://api.github.com/users/justjanne/following{/other_user}","gists_url":"https://api.github.com/users/justjanne/gists{/gist_id}","starred_url":"https://api.github.com/users/justjanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justjanne/subscriptions","organizations_url":"https://api.github.com/users/justjanne/orgs","repos_url":"https://api.github.com/users/justjanne/repos","events_url":"https://api.github.com/users/justjanne/events{/privacy}","received_events_url":"https://api.github.com/users/justjanne/received_events","type":"User","site_admin":false},"body":"I redesigned some parts of the UI, including the drawers.","created_at":"2015-01-02T03:09:36Z","updated_at":"2015-01-10T23:26:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50fdbd3b0d683067f71a78722bbbcb8d20af067d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/220/commits","review_comments_url":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/220/comments","review_comment_url":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/comments/{number}","comments_url":"https://api.github.com/repos/sandsmark/QuasselDroid/issues/220/comments","statuses_url":"https://api.github.com/repos/sandsmark/QuasselDroid/statuses/94a955d79f8ea31576cedfd49eb250a96a802527","head":{"label":"justjanne:pr/ui-fix","ref":"pr/ui-fix","sha":"94a955d79f8ea31576cedfd49eb250a96a802527","user":{"login":"justjanne","id":3933349,"avatar_url":"https://avatars.githubusercontent.com/u/3933349?v=3","gravatar_id":"","url":"https://api.github.com/users/justjanne","html_url":"https://github.com/justjanne","followers_url":"https://api.github.com/users/justjanne/followers","following_url":"https://api.github.com/users/justjanne/following{/other_user}","gists_url":"https://api.github.com/users/justjanne/gists{/gist_id}","starred_url":"https://api.github.com/users/justjanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justjanne/subscriptions","organizations_url":"https://api.github.com/users/justjanne/orgs","repos_url":"https://api.github.com/users/justjanne/repos","events_url":"https://api.github.com/users/justjanne/events{/privacy}","received_events_url":"https://api.github.com/users/justjanne/received_events","type":"User","site_admin":false},"repo":{"id":28574246,"name":"QuasselDroid","full_name":"justjanne/QuasselDroid","owner":{"login":"justjanne","id":3933349,"avatar_url":"https://avatars.githubusercontent.com/u/3933349?v=3","gravatar_id":"","url":"https://api.github.com/users/justjanne","html_url":"https://github.com/justjanne","followers_url":"https://api.github.com/users/justjanne/followers","following_url":"https://api.github.com/users/justjanne/following{/other_user}","gists_url":"https://api.github.com/users/justjanne/gists{/gist_id}","starred_url":"https://api.github.com/users/justjanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justjanne/subscriptions","organizations_url":"https://api.github.com/users/justjanne/orgs","repos_url":"https://api.github.com/users/justjanne/repos","events_url":"https://api.github.com/users/justjanne/events{/privacy}","received_events_url":"https://api.github.com/users/justjanne/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/justjanne/QuasselDroid","description":"Quasselclient for Android","fork":true,"url":"https://api.github.com/repos/justjanne/QuasselDroid","forks_url":"https://api.github.com/repos/justjanne/QuasselDroid/forks","keys_url":"https://api.github.com/repos/justjanne/QuasselDroid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/justjanne/QuasselDroid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/justjanne/QuasselDroid/teams","hooks_url":"https://api.github.com/repos/justjanne/QuasselDroid/hooks","issue_events_url":"https://api.github.com/repos/justjanne/QuasselDroid/issues/events{/number}","events_url":"https://api.github.com/repos/justjanne/QuasselDroid/events","assignees_url":"https://api.github.com/repos/justjanne/QuasselDroid/assignees{/user}","branches_url":"https://api.github.com/repos/justjanne/QuasselDroid/branches{/branch}","tags_url":"https://api.github.com/repos/justjanne/QuasselDroid/tags","blobs_url":"https://api.github.com/repos/justjanne/QuasselDroid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/justjanne/QuasselDroid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/justjanne/QuasselDroid/git/refs{/sha}","trees_url":"https://api.github.com/repos/justjanne/QuasselDroid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/justjanne/QuasselDroid/statuses/{sha}","languages_url":"https://api.github.com/repos/justjanne/QuasselDroid/languages","stargazers_url":"https://api.github.com/repos/justjanne/QuasselDroid/stargazers","contributors_url":"https://api.github.com/repos/justjanne/QuasselDroid/contributors","subscribers_url":"https://api.github.com/repos/justjanne/QuasselDroid/subscribers","subscription_url":"https://api.github.com/repos/justjanne/QuasselDroid/subscription","commits_url":"https://api.github.com/repos/justjanne/QuasselDroid/commits{/sha}","git_commits_url":"https://api.github.com/repos/justjanne/QuasselDroid/git/commits{/sha}","comments_url":"https://api.github.com/repos/justjanne/QuasselDroid/comments{/number}","issue_comment_url":"https://api.github.com/repos/justjanne/QuasselDroid/issues/comments/{number}","contents_url":"https://api.github.com/repos/justjanne/QuasselDroid/contents/{+path}","compare_url":"https://api.github.com/repos/justjanne/QuasselDroid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/justjanne/QuasselDroid/merges","archive_url":"https://api.github.com/repos/justjanne/QuasselDroid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/justjanne/QuasselDroid/downloads","issues_url":"https://api.github.com/repos/justjanne/QuasselDroid/issues{/number}","pulls_url":"https://api.github.com/repos/justjanne/QuasselDroid/pulls{/number}","milestones_url":"https://api.github.com/repos/justjanne/QuasselDroid/milestones{/number}","notifications_url":"https://api.github.com/repos/justjanne/QuasselDroid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/justjanne/QuasselDroid/labels{/name}","releases_url":"https://api.github.com/repos/justjanne/QuasselDroid/releases{/id}","created_at":"2014-12-28T23:38:29Z","updated_at":"2015-01-02T03:21:29Z","pushed_at":"2015-01-08T20:47:41Z","git_url":"git://github.com/justjanne/QuasselDroid.git","ssh_url":"git@github.com:justjanne/QuasselDroid.git","clone_url":"https://github.com/justjanne/QuasselDroid.git","svn_url":"https://github.com/justjanne/QuasselDroid","homepage":"http://quasseldroid.iskrembilen.com/","size":12926,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"sandsmark:master","ref":"master","sha":"ff6e95c3fe08c403a70ece25dde68931b2b66aef","user":{"login":"sandsmark","id":25765,"avatar_url":"https://avatars.githubusercontent.com/u/25765?v=3","gravatar_id":"","url":"https://api.github.com/users/sandsmark","html_url":"https://github.com/sandsmark","followers_url":"https://api.github.com/users/sandsmark/followers","following_url":"https://api.github.com/users/sandsmark/following{/other_user}","gists_url":"https://api.github.com/users/sandsmark/gists{/gist_id}","starred_url":"https://api.github.com/users/sandsmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandsmark/subscriptions","organizations_url":"https://api.github.com/users/sandsmark/orgs","repos_url":"https://api.github.com/users/sandsmark/repos","events_url":"https://api.github.com/users/sandsmark/events{/privacy}","received_events_url":"https://api.github.com/users/sandsmark/received_events","type":"User","site_admin":false},"repo":{"id":1312588,"name":"QuasselDroid","full_name":"sandsmark/QuasselDroid","owner":{"login":"sandsmark","id":25765,"avatar_url":"https://avatars.githubusercontent.com/u/25765?v=3","gravatar_id":"","url":"https://api.github.com/users/sandsmark","html_url":"https://github.com/sandsmark","followers_url":"https://api.github.com/users/sandsmark/followers","following_url":"https://api.github.com/users/sandsmark/following{/other_user}","gists_url":"https://api.github.com/users/sandsmark/gists{/gist_id}","starred_url":"https://api.github.com/users/sandsmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandsmark/subscriptions","organizations_url":"https://api.github.com/users/sandsmark/orgs","repos_url":"https://api.github.com/users/sandsmark/repos","events_url":"https://api.github.com/users/sandsmark/events{/privacy}","received_events_url":"https://api.github.com/users/sandsmark/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sandsmark/QuasselDroid","description":"Quasselclient for Android","fork":false,"url":"https://api.github.com/repos/sandsmark/QuasselDroid","forks_url":"https://api.github.com/repos/sandsmark/QuasselDroid/forks","keys_url":"https://api.github.com/repos/sandsmark/QuasselDroid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sandsmark/QuasselDroid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sandsmark/QuasselDroid/teams","hooks_url":"https://api.github.com/repos/sandsmark/QuasselDroid/hooks","issue_events_url":"https://api.github.com/repos/sandsmark/QuasselDroid/issues/events{/number}","events_url":"https://api.github.com/repos/sandsmark/QuasselDroid/events","assignees_url":"https://api.github.com/repos/sandsmark/QuasselDroid/assignees{/user}","branches_url":"https://api.github.com/repos/sandsmark/QuasselDroid/branches{/branch}","tags_url":"https://api.github.com/repos/sandsmark/QuasselDroid/tags","blobs_url":"https://api.github.com/repos/sandsmark/QuasselDroid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sandsmark/QuasselDroid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sandsmark/QuasselDroid/git/refs{/sha}","trees_url":"https://api.github.com/repos/sandsmark/QuasselDroid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sandsmark/QuasselDroid/statuses/{sha}","languages_url":"https://api.github.com/repos/sandsmark/QuasselDroid/languages","stargazers_url":"https://api.github.com/repos/sandsmark/QuasselDroid/stargazers","contributors_url":"https://api.github.com/repos/sandsmark/QuasselDroid/contributors","subscribers_url":"https://api.github.com/repos/sandsmark/QuasselDroid/subscribers","subscription_url":"https://api.github.com/repos/sandsmark/QuasselDroid/subscription","commits_url":"https://api.github.com/repos/sandsmark/QuasselDroid/commits{/sha}","git_commits_url":"https://api.github.com/repos/sandsmark/QuasselDroid/git/commits{/sha}","comments_url":"https://api.github.com/repos/sandsmark/QuasselDroid/comments{/number}","issue_comment_url":"https://api.github.com/repos/sandsmark/QuasselDroid/issues/comments/{number}","contents_url":"https://api.github.com/repos/sandsmark/QuasselDroid/contents/{+path}","compare_url":"https://api.github.com/repos/sandsmark/QuasselDroid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sandsmark/QuasselDroid/merges","archive_url":"https://api.github.com/repos/sandsmark/QuasselDroid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sandsmark/QuasselDroid/downloads","issues_url":"https://api.github.com/repos/sandsmark/QuasselDroid/issues{/number}","pulls_url":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls{/number}","milestones_url":"https://api.github.com/repos/sandsmark/QuasselDroid/milestones{/number}","notifications_url":"https://api.github.com/repos/sandsmark/QuasselDroid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sandsmark/QuasselDroid/labels{/name}","releases_url":"https://api.github.com/repos/sandsmark/QuasselDroid/releases{/id}","created_at":"2011-01-31T15:24:57Z","updated_at":"2015-01-10T22:01:19Z","pushed_at":"2015-01-10T22:01:18Z","git_url":"git://github.com/sandsmark/QuasselDroid.git","ssh_url":"git@github.com:sandsmark/QuasselDroid.git","clone_url":"https://github.com/sandsmark/QuasselDroid.git","svn_url":"https://github.com/sandsmark/QuasselDroid","homepage":"http://quasseldroid.iskrembilen.com/","size":13650,"stargazers_count":107,"watchers_count":107,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":26,"forks":48,"open_issues":26,"watchers":107,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/220"},"html":{"href":"https://github.com/sandsmark/QuasselDroid/pull/220"},"issue":{"href":"https://api.github.com/repos/sandsmark/QuasselDroid/issues/220"},"comments":{"href":"https://api.github.com/repos/sandsmark/QuasselDroid/issues/220/comments"},"review_comments":{"href":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/220/comments"},"review_comment":{"href":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/sandsmark/QuasselDroid/pulls/220/commits"},"statuses":{"href":"https://api.github.com/repos/sandsmark/QuasselDroid/statuses/94a955d79f8ea31576cedfd49eb250a96a802527"}}}}