{"action":"created","comment":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments/59838130","id":59838130,"diff_hunk":"@@ -0,0 +1,108 @@\n+package org.wordpress.android.ui.people;\n+\n+import android.app.Activity;\n+import android.app.ListFragment;\n+import android.content.Context;\n+import android.os.Bundle;\n+import android.view.LayoutInflater;\n+import android.view.View;\n+import android.view.ViewGroup;\n+import android.widget.AdapterView;\n+import android.widget.AdapterView.OnItemClickListener;\n+\n+import org.wordpress.android.R;\n+import org.wordpress.android.datasets.PeopleTable;\n+import org.wordpress.android.models.Person;\n+\n+import java.util.List;\n+\n+public class PeopleListFragment extends ListFragment implements OnItemClickListener {\n+    private static String ARG_LOCAL_TABLE_BLOG_ID = \"LOCAL_TABLE_BLOG_ID\";\n+\n+    private int mLocalTableBlogID;\n+    private OnPersonSelectedListener mListener;\n+\n+    public static PeopleListFragment newInstance(int localTableBlogID) {\n+        PeopleListFragment peopleListFragment = new PeopleListFragment();\n+        Bundle bundle = new Bundle();\n+        bundle.putInt(ARG_LOCAL_TABLE_BLOG_ID, localTableBlogID);\n+        peopleListFragment.setArguments(bundle);\n+        return peopleListFragment;\n+    }\n+\n+    @Override\n+    public void onAttach(Context context) {\n+        super.onAttach(context);\n+        try {\n+            mListener = (OnPersonSelectedListener) context;\n+        } catch (ClassCastException e) {\n+            throw new ClassCastException(context.toString() + \" must implement OnPersonSelectedListener\");\n+        }\n+    }\n+\n+    // We need to override this for devices pre API 23\n+    @SuppressWarnings(\"deprecation\")\n+    @Override\n+    public void onAttach(Activity activity) {\n+        super.onAttach(activity);\n+        try {\n+            mListener = (OnPersonSelectedListener) activity;\n+        } catch (ClassCastException e) {\n+            throw new ClassCastException(activity.toString() + \" must implement OnPersonSelectedListener\");\n+        }\n+    }\n+\n+    @Override\n+    public void onDetach() {\n+        super.onDetach();\n+        mListener = null;\n+    }\n+\n+    @Override\n+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n+        return inflater.inflate(R.layout.people_list_fragment, container, false);\n+    }\n+\n+    @Override\n+    public void onActivityCreated(Bundle savedInstanceState) {\n+        super.onActivityCreated(savedInstanceState);\n+\n+        mLocalTableBlogID = getArguments().getInt(ARG_LOCAL_TABLE_BLOG_ID);\n+        getListView().setOnItemClickListener(this);\n+    }\n+\n+    @Override\n+    public void onResume() {\n+        super.onResume();\n+\n+        refreshPeopleList();\n+    }\n+\n+    public void refreshPeopleList() {\n+        if (!isAdded()) return;\n+\n+        List<Person> peopleList = PeopleTable.getPeople(mLocalTableBlogID);\n+\n+        PeopleAdapter peopleAdapter = (PeopleAdapter) getListAdapter();\n+        if (peopleAdapter == null) {\n+            peopleAdapter = new PeopleAdapter(getActivity(), peopleList);\n+            setListAdapter(peopleAdapter);\n+        } else {\n+            peopleAdapter.setPeopleList(peopleList);\n+            peopleAdapter.notifyDataSetChanged();","path":"WordPress/src/main/java/org/wordpress/android/ui/people/PeopleListFragment.java","position":92,"original_position":92,"commit_id":"8ab36c9c7fcd118dd23d6d84ca1413293d6d56ed","original_commit_id":"964b907da40a29eddd8bdab88a931456c3a0ac75","user":{"login":"hypest","id":1032913,"avatar_url":"https://avatars.githubusercontent.com/u/1032913?v=3","gravatar_id":"","url":"https://api.github.com/users/hypest","html_url":"https://github.com/hypest","followers_url":"https://api.github.com/users/hypest/followers","following_url":"https://api.github.com/users/hypest/following{/other_user}","gists_url":"https://api.github.com/users/hypest/gists{/gist_id}","starred_url":"https://api.github.com/users/hypest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypest/subscriptions","organizations_url":"https://api.github.com/users/hypest/orgs","repos_url":"https://api.github.com/users/hypest/repos","events_url":"https://api.github.com/users/hypest/events{/privacy}","received_events_url":"https://api.github.com/users/hypest/received_events","type":"User","site_admin":false},"body":"Hah, I see what you mean! Yeah, quite \"fine\" difference between these two :)","created_at":"2016-04-15T07:51:07Z","updated_at":"2016-04-15T07:51:07Z","html_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3970#discussion_r59838130","pull_request_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3970","_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments/59838130"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-Android/pull/3970#discussion_r59838130"},"pull_request":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3970"}}},"pull_request":{"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3970","id":66484922,"html_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3970","diff_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3970.diff","patch_url":"https://github.com/wordpress-mobile/WordPress-Android/pull/3970.patch","issue_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3970","number":3970,"state":"open","locked":false,"title":"Refactoring People Management UI to use Fragments","user":{"login":"oguzkocer","id":662023,"avatar_url":"https://avatars.githubusercontent.com/u/662023?v=3","gravatar_id":"","url":"https://api.github.com/users/oguzkocer","html_url":"https://github.com/oguzkocer","followers_url":"https://api.github.com/users/oguzkocer/followers","following_url":"https://api.github.com/users/oguzkocer/following{/other_user}","gists_url":"https://api.github.com/users/oguzkocer/gists{/gist_id}","starred_url":"https://api.github.com/users/oguzkocer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oguzkocer/subscriptions","organizations_url":"https://api.github.com/users/oguzkocer/orgs","repos_url":"https://api.github.com/users/oguzkocer/repos","events_url":"https://api.github.com/users/oguzkocer/events{/privacy}","received_events_url":"https://api.github.com/users/oguzkocer/received_events","type":"User","site_admin":false},"body":"Related #3901. This is the first time I am getting my hands dirty with Fragments. I've worked with them before, but never converted activities to fragments. I have to say that it turned out to be messier than I expected. Now that I know a few more things, if I need to do it again, it'll be easier, but it still doesn't feel clean.\r\n\r\nAnyhow, after chatting with @hypest, we thought it's better to use fragments inside a single activity rather than different activities for People Management UI. This PR is an attempt to make that change. Basically `PeopleManagementActivity` works as an orchestrator and updates/refreshes the fragments when necessary. I've tried my best to follow the best practices here, so hopefully it's a good implementation.\r\n\r\nI have implemented a similar animation for the fragment slide in/out we have for activities, but there is still a bit of jankiness there I am not sure where it's coming from.\r\n\r\nPlease note that this is not the final version of the People Management UI, it just converts the previous version to Fragments and corrects a few mistakes I made in the earlier PRs. However, the only thing that's left should be just positioning & styling the current elements which will be handled in a separate PR.\r\n\r\n/cc @astralbodies \r\n\r\nNeeds review: @hypest ","created_at":"2016-04-14T13:36:02Z","updated_at":"2016-04-15T07:51:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"759bec14f65cfd10573a12b3cab08a33e70f1449","assignee":{"login":"hypest","id":1032913,"avatar_url":"https://avatars.githubusercontent.com/u/1032913?v=3","gravatar_id":"","url":"https://api.github.com/users/hypest","html_url":"https://github.com/hypest","followers_url":"https://api.github.com/users/hypest/followers","following_url":"https://api.github.com/users/hypest/following{/other_user}","gists_url":"https://api.github.com/users/hypest/gists{/gist_id}","starred_url":"https://api.github.com/users/hypest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypest/subscriptions","organizations_url":"https://api.github.com/users/hypest/orgs","repos_url":"https://api.github.com/users/hypest/repos","events_url":"https://api.github.com/users/hypest/events{/privacy}","received_events_url":"https://api.github.com/users/hypest/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3970/commits","review_comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3970/comments","review_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3970/comments","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/8ab36c9c7fcd118dd23d6d84ca1413293d6d56ed","head":{"label":"wordpress-mobile:feature/people-management-ui-layer","ref":"feature/people-management-ui-layer","sha":"8ab36c9c7fcd118dd23d6d84ca1413293d6d56ed","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":9306568,"name":"WordPress-Android","full_name":"wordpress-mobile/WordPress-Android","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-Android","description":"WordPress for Android","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/releases{/id}","deployments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/deployments","created_at":"2013-04-08T20:52:40Z","updated_at":"2016-04-14T11:37:04Z","pushed_at":"2016-04-15T07:50:49Z","git_url":"git://github.com/wordpress-mobile/WordPress-Android.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-Android.git","clone_url":"https://github.com/wordpress-mobile/WordPress-Android.git","svn_url":"https://github.com/wordpress-mobile/WordPress-Android","homepage":"http://android.wordpress.org","size":154020,"stargazers_count":1138,"watchers_count":1138,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":639,"mirror_url":null,"open_issues_count":156,"forks":639,"open_issues":156,"watchers":1138,"default_branch":"develop"}},"base":{"label":"wordpress-mobile:feature/people-management-sync","ref":"feature/people-management-sync","sha":"8cc107bdf166dabab40281f2f4a8db98d3c1f8d7","user":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"repo":{"id":9306568,"name":"WordPress-Android","full_name":"wordpress-mobile/WordPress-Android","owner":{"login":"wordpress-mobile","id":1306301,"avatar_url":"https://avatars.githubusercontent.com/u/1306301?v=3","gravatar_id":"","url":"https://api.github.com/users/wordpress-mobile","html_url":"https://github.com/wordpress-mobile","followers_url":"https://api.github.com/users/wordpress-mobile/followers","following_url":"https://api.github.com/users/wordpress-mobile/following{/other_user}","gists_url":"https://api.github.com/users/wordpress-mobile/gists{/gist_id}","starred_url":"https://api.github.com/users/wordpress-mobile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordpress-mobile/subscriptions","organizations_url":"https://api.github.com/users/wordpress-mobile/orgs","repos_url":"https://api.github.com/users/wordpress-mobile/repos","events_url":"https://api.github.com/users/wordpress-mobile/events{/privacy}","received_events_url":"https://api.github.com/users/wordpress-mobile/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wordpress-mobile/WordPress-Android","description":"WordPress for Android","fork":false,"url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android","forks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/forks","keys_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/teams","hooks_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/hooks","issue_events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/events{/number}","events_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/events","assignees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/assignees{/user}","branches_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/branches{/branch}","tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/tags","blobs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/refs{/sha}","trees_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/{sha}","languages_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/languages","stargazers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/stargazers","contributors_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contributors","subscribers_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscribers","subscription_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/subscription","commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/commits{/sha}","git_commits_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/git/commits{/sha}","comments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/comments{/number}","issue_comment_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/comments{/number}","contents_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/contents/{+path}","compare_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/merges","archive_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/downloads","issues_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues{/number}","pulls_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls{/number}","milestones_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/milestones{/number}","notifications_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/labels{/name}","releases_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/releases{/id}","deployments_url":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/deployments","created_at":"2013-04-08T20:52:40Z","updated_at":"2016-04-14T11:37:04Z","pushed_at":"2016-04-15T07:50:49Z","git_url":"git://github.com/wordpress-mobile/WordPress-Android.git","ssh_url":"git@github.com:wordpress-mobile/WordPress-Android.git","clone_url":"https://github.com/wordpress-mobile/WordPress-Android.git","svn_url":"https://github.com/wordpress-mobile/WordPress-Android","homepage":"http://android.wordpress.org","size":154020,"stargazers_count":1138,"watchers_count":1138,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":639,"mirror_url":null,"open_issues_count":156,"forks":639,"open_issues":156,"watchers":1138,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3970"},"html":{"href":"https://github.com/wordpress-mobile/WordPress-Android/pull/3970"},"issue":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3970"},"comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/issues/3970/comments"},"review_comments":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3970/comments"},"review_comment":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/pulls/3970/commits"},"statuses":{"href":"https://api.github.com/repos/wordpress-mobile/WordPress-Android/statuses/8ab36c9c7fcd118dd23d6d84ca1413293d6d56ed"}}}}