{"action":"created","comment":{"url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/comments/45553473","id":45553473,"diff_hunk":"@@ -0,0 +1,128 @@\n+package com.pennapps.labs.pennmobile;\n+\n+import android.graphics.Color;\n+import android.os.Bundle;\n+import android.os.Parcelable;\n+import android.support.v4.app.Fragment;\n+import android.support.v4.app.FragmentManager;\n+import android.support.v4.app.FragmentStatePagerAdapter;\n+import android.support.v4.view.ViewPager;\n+import android.view.LayoutInflater;\n+import android.view.View;\n+import android.view.ViewGroup;\n+\n+import com.pennapps.labs.pennmobile.api.Labs;\n+import com.pennapps.labs.pennmobile.classes.Laundry;\n+import com.pennapps.labs.pennmobile.classes.LaundryMachine;\n+\n+import java.util.List;\n+\n+import butterknife.ButterKnife;\n+\n+/**\n+ * Created by Jason on 11/4/2015.\n+ */\n+public class LaundryMachineFragment extends Fragment {\n+    private Labs mLabs;\n+    private MainActivity mActivity;\n+    private Laundry laundry;\n+    private List<LaundryMachine> machines;\n+    private TabAdapter pageAdapter;\n+    private ViewPager pager;\n+\n+    class TabAdapter extends FragmentStatePagerAdapter {\n+        public TabAdapter(FragmentManager fm) {\n+            super(fm);\n+        }\n+\n+        @Override\n+        public Fragment getItem(int position) {\n+            Fragment myFragment = new LaundryMachineTab(); //data stored into the parent fragment with Fragment.getParent();\n+            Bundle args = new Bundle();\n+            args.putInt(getString(R.string.laundry_position), position);\n+            args.putParcelable(getString(R.string.laundry), laundry);\n+            if(machines != null) {\n+                LaundryMachine[] array = (LaundryMachine[]) machines.toArray();\n+                args.putParcelableArray(getString(R.string.laundry_machine_intent), array);\n+            }\n+            myFragment.setArguments(args);\n+            return myFragment;\n+        }\n+        @Override\n+        public int getCount() {\n+            return 2;\n+        }\n+\n+        @Override\n+        public CharSequence getPageTitle(int position){\n+            if(position == 0){\n+                return getString(R.string.laundry_washer);\n+            }\n+            return getString(R.string.laundry_dryer);\n+        }\n+    }\n+\n+\n+\n+    @Override\n+    public void onCreate(Bundle savedInstanceState) {\n+        super.onCreate(savedInstanceState);\n+        mLabs = MainActivity.getLabsInstance();\n+        mActivity = (MainActivity) getActivity();\n+        mActivity.closeKeyboard();\n+        Bundle args = getArguments();\n+        laundry = args.getParcelable(getString(R.string.laundry));\n+    }\n+\n+    @Override\n+    public void onActivityCreated(Bundle savedInstanceState) {\n+        super.onActivityCreated(savedInstanceState);\n+        ((MainActivity) getActivity()).closeKeyboard();\n+        setHasOptionsMenu(true);\n+    }\n+\n+    @Override\n+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n+        View v = inflater.inflate(R.layout.fragment_laundry_machine, container, false);\n+        ButterKnife.bind(this, v);\n+        pageAdapter = new TabAdapter(getActivity().getSupportFragmentManager());\n+        pager = (ViewPager) v.findViewById(R.id.pager);\n+        pager.setAdapter(pageAdapter);\n+        pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n+\n+            @Override\n+            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n+                machines = ((LaundryMachineTab) ((FragmentStatePagerAdapter) pager.getAdapter()).getItem(position)).returnMachines();\n+            }\n+\n+            @Override\n+            public void onPageSelected(int position) {\n+\n+            }\n+\n+            @Override\n+            public void onPageScrollStateChanged(int state) {\n+\n+            }\n+        });\n+        v.setBackgroundColor(Color.WHITE);\n+        ((MainActivity) getActivity()).addLaundryTabs(pageAdapter, pager);\n+        return v;\n+    }\n+\n+    @Override\n+    public void onResume() {\n+        super.onResume();\n+        if(laundry.name != null) {","path":"PennMobile/src/main/java/com/pennapps/labs/pennmobile/LaundryMachineFragment.java","position":116,"original_position":116,"commit_id":"e21dfc6d6692ac37ef0f7f4cb144aae464b9054f","original_commit_id":"e21dfc6d6692ac37ef0f7f4cb144aae464b9054f","user":{"login":"dlakata","id":3457673,"avatar_url":"https://avatars.githubusercontent.com/u/3457673?v=3","gravatar_id":"","url":"https://api.github.com/users/dlakata","html_url":"https://github.com/dlakata","followers_url":"https://api.github.com/users/dlakata/followers","following_url":"https://api.github.com/users/dlakata/following{/other_user}","gists_url":"https://api.github.com/users/dlakata/gists{/gist_id}","starred_url":"https://api.github.com/users/dlakata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlakata/subscriptions","organizations_url":"https://api.github.com/users/dlakata/orgs","repos_url":"https://api.github.com/users/dlakata/repos","events_url":"https://api.github.com/users/dlakata/events{/privacy}","received_events_url":"https://api.github.com/users/dlakata/received_events","type":"User","site_admin":false},"body":"got a NullPointerException here","created_at":"2015-11-22T01:51:13Z","updated_at":"2015-11-22T01:51:13Z","html_url":"https://github.com/pennlabs/penn-mobile-android/pull/297#discussion_r45553473","pull_request_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/297","_links":{"self":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/comments/45553473"},"html":{"href":"https://github.com/pennlabs/penn-mobile-android/pull/297#discussion_r45553473"},"pull_request":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/297"}}},"pull_request":{"url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/297","id":51427480,"html_url":"https://github.com/pennlabs/penn-mobile-android/pull/297","diff_url":"https://github.com/pennlabs/penn-mobile-android/pull/297.diff","patch_url":"https://github.com/pennlabs/penn-mobile-android/pull/297.patch","issue_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/297","number":297,"state":"open","locked":false,"title":"Laundry","user":{"login":"jasontsh","id":9397267,"avatar_url":"https://avatars.githubusercontent.com/u/9397267?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontsh","html_url":"https://github.com/jasontsh","followers_url":"https://api.github.com/users/jasontsh/followers","following_url":"https://api.github.com/users/jasontsh/following{/other_user}","gists_url":"https://api.github.com/users/jasontsh/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontsh/subscriptions","organizations_url":"https://api.github.com/users/jasontsh/orgs","repos_url":"https://api.github.com/users/jasontsh/repos","events_url":"https://api.github.com/users/jasontsh/events{/privacy}","received_events_url":"https://api.github.com/users/jasontsh/received_events","type":"User","site_admin":false},"body":"Bugs to be fixed:\r\n- [ ] switch off when the notification comes up- currently the notification does nothing if the app is opened.\r\n\r\nThings to change before live:\r\n- [ ] change the notification text\r\n- [ ] change the alarm time to be a parsed time of `LaundryMachine.time_left`\r\n- [ ] Add LOGO ONTO THE MAIN PAGE","created_at":"2015-11-21T00:54:49Z","updated_at":"2015-11-22T01:51:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b0eaa5a328182fada76055b2d8887d3496cfbb41","assignee":{"login":"dlakata","id":3457673,"avatar_url":"https://avatars.githubusercontent.com/u/3457673?v=3","gravatar_id":"","url":"https://api.github.com/users/dlakata","html_url":"https://github.com/dlakata","followers_url":"https://api.github.com/users/dlakata/followers","following_url":"https://api.github.com/users/dlakata/following{/other_user}","gists_url":"https://api.github.com/users/dlakata/gists{/gist_id}","starred_url":"https://api.github.com/users/dlakata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlakata/subscriptions","organizations_url":"https://api.github.com/users/dlakata/orgs","repos_url":"https://api.github.com/users/dlakata/repos","events_url":"https://api.github.com/users/dlakata/events{/privacy}","received_events_url":"https://api.github.com/users/dlakata/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/297/commits","review_comments_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/297/comments","review_comment_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/297/comments","statuses_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/statuses/e21dfc6d6692ac37ef0f7f4cb144aae464b9054f","head":{"label":"pennlabs:laundry","ref":"laundry","sha":"e21dfc6d6692ac37ef0f7f4cb144aae464b9054f","user":{"login":"pennlabs","id":1159028,"avatar_url":"https://avatars.githubusercontent.com/u/1159028?v=3","gravatar_id":"","url":"https://api.github.com/users/pennlabs","html_url":"https://github.com/pennlabs","followers_url":"https://api.github.com/users/pennlabs/followers","following_url":"https://api.github.com/users/pennlabs/following{/other_user}","gists_url":"https://api.github.com/users/pennlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/pennlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pennlabs/subscriptions","organizations_url":"https://api.github.com/users/pennlabs/orgs","repos_url":"https://api.github.com/users/pennlabs/repos","events_url":"https://api.github.com/users/pennlabs/events{/privacy}","received_events_url":"https://api.github.com/users/pennlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":16791473,"name":"penn-mobile-android","full_name":"pennlabs/penn-mobile-android","owner":{"login":"pennlabs","id":1159028,"avatar_url":"https://avatars.githubusercontent.com/u/1159028?v=3","gravatar_id":"","url":"https://api.github.com/users/pennlabs","html_url":"https://github.com/pennlabs","followers_url":"https://api.github.com/users/pennlabs/followers","following_url":"https://api.github.com/users/pennlabs/following{/other_user}","gists_url":"https://api.github.com/users/pennlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/pennlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pennlabs/subscriptions","organizations_url":"https://api.github.com/users/pennlabs/orgs","repos_url":"https://api.github.com/users/pennlabs/repos","events_url":"https://api.github.com/users/pennlabs/events{/privacy}","received_events_url":"https://api.github.com/users/pennlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pennlabs/penn-mobile-android","description":"Penn's mobile app for Android","fork":false,"url":"https://api.github.com/repos/pennlabs/penn-mobile-android","forks_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/forks","keys_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/teams","hooks_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/hooks","issue_events_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/events{/number}","events_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/events","assignees_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/assignees{/user}","branches_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/branches{/branch}","tags_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/tags","blobs_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/statuses/{sha}","languages_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/languages","stargazers_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/stargazers","contributors_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/contributors","subscribers_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/subscribers","subscription_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/subscription","commits_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/contents/{+path}","compare_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/merges","archive_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/downloads","issues_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues{/number}","pulls_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls{/number}","milestones_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/milestones{/number}","notifications_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/labels{/name}","releases_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/releases{/id}","created_at":"2014-02-13T04:14:21Z","updated_at":"2015-09-11T04:50:13Z","pushed_at":"2015-11-21T01:18:13Z","git_url":"git://github.com/pennlabs/penn-mobile-android.git","ssh_url":"git@github.com:pennlabs/penn-mobile-android.git","clone_url":"https://github.com/pennlabs/penn-mobile-android.git","svn_url":"https://github.com/pennlabs/penn-mobile-android","homepage":"","size":22540,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":38,"forks":1,"open_issues":38,"watchers":4,"default_branch":"master"}},"base":{"label":"pennlabs:master","ref":"master","sha":"9a39c5a7b0e140b93513c74ac76be5c86ddfadab","user":{"login":"pennlabs","id":1159028,"avatar_url":"https://avatars.githubusercontent.com/u/1159028?v=3","gravatar_id":"","url":"https://api.github.com/users/pennlabs","html_url":"https://github.com/pennlabs","followers_url":"https://api.github.com/users/pennlabs/followers","following_url":"https://api.github.com/users/pennlabs/following{/other_user}","gists_url":"https://api.github.com/users/pennlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/pennlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pennlabs/subscriptions","organizations_url":"https://api.github.com/users/pennlabs/orgs","repos_url":"https://api.github.com/users/pennlabs/repos","events_url":"https://api.github.com/users/pennlabs/events{/privacy}","received_events_url":"https://api.github.com/users/pennlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":16791473,"name":"penn-mobile-android","full_name":"pennlabs/penn-mobile-android","owner":{"login":"pennlabs","id":1159028,"avatar_url":"https://avatars.githubusercontent.com/u/1159028?v=3","gravatar_id":"","url":"https://api.github.com/users/pennlabs","html_url":"https://github.com/pennlabs","followers_url":"https://api.github.com/users/pennlabs/followers","following_url":"https://api.github.com/users/pennlabs/following{/other_user}","gists_url":"https://api.github.com/users/pennlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/pennlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pennlabs/subscriptions","organizations_url":"https://api.github.com/users/pennlabs/orgs","repos_url":"https://api.github.com/users/pennlabs/repos","events_url":"https://api.github.com/users/pennlabs/events{/privacy}","received_events_url":"https://api.github.com/users/pennlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pennlabs/penn-mobile-android","description":"Penn's mobile app for Android","fork":false,"url":"https://api.github.com/repos/pennlabs/penn-mobile-android","forks_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/forks","keys_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/teams","hooks_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/hooks","issue_events_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/events{/number}","events_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/events","assignees_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/assignees{/user}","branches_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/branches{/branch}","tags_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/tags","blobs_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/statuses/{sha}","languages_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/languages","stargazers_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/stargazers","contributors_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/contributors","subscribers_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/subscribers","subscription_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/subscription","commits_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/contents/{+path}","compare_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/merges","archive_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/downloads","issues_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues{/number}","pulls_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls{/number}","milestones_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/milestones{/number}","notifications_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/labels{/name}","releases_url":"https://api.github.com/repos/pennlabs/penn-mobile-android/releases{/id}","created_at":"2014-02-13T04:14:21Z","updated_at":"2015-09-11T04:50:13Z","pushed_at":"2015-11-21T01:18:13Z","git_url":"git://github.com/pennlabs/penn-mobile-android.git","ssh_url":"git@github.com:pennlabs/penn-mobile-android.git","clone_url":"https://github.com/pennlabs/penn-mobile-android.git","svn_url":"https://github.com/pennlabs/penn-mobile-android","homepage":"","size":22540,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":38,"forks":1,"open_issues":38,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/297"},"html":{"href":"https://github.com/pennlabs/penn-mobile-android/pull/297"},"issue":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/297"},"comments":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/issues/297/comments"},"review_comments":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/297/comments"},"review_comment":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/pulls/297/commits"},"statuses":{"href":"https://api.github.com/repos/pennlabs/penn-mobile-android/statuses/e21dfc6d6692ac37ef0f7f4cb144aae464b9054f"}}}}