{"action":"created","comment":{"url":"https://api.github.com/repos/revern/AndroidPractice/pulls/comments/40172904","id":40172904,"diff_hunk":"@@ -0,0 +1,148 @@\n+package com.example.revern.simplegallery;\r\n+\r\n+import android.annotation.TargetApi;\r\n+import android.content.Intent;\r\n+import android.os.Build;\r\n+import android.os.Bundle;\r\n+import android.support.annotation.NonNull;\r\n+import android.support.v4.app.ActivityOptionsCompat;\r\n+import android.support.v7.app.ActionBarActivity;\r\n+import android.transition.Slide;\r\n+import android.transition.Transition;\r\n+import android.transition.TransitionInflater;\r\n+import android.view.Menu;\r\n+import android.view.MenuItem;\r\n+import android.view.View;\r\n+import android.view.ViewGroup;\r\n+import android.widget.AdapterView;\r\n+import android.widget.BaseAdapter;\r\n+import android.widget.GridView;\r\n+import android.widget.ImageView;\r\n+\r\n+import com.squareup.picasso.Picasso;\r\n+\r\n+import java.util.ArrayList;\r\n+import java.util.List;\r\n+\r\n+public class Gallery extends ActionBarActivity implements AdapterView.OnItemClickListener {\r\n+    private GridView mGridView;\r\n+    private List<String> links;\r\n+\r\n+    @Override\r\n+    protected void onCreate(Bundle savedInstanceState) {\r\n+        if (Build.VERSION.SDK_INT >= 21) {\r\n+            TransitionInflater inflater = TransitionInflater.from(this);\r\n+            Transition transition = inflater.inflateTransition(R.transition.transition_a);\r\n+            getWindow().setExitTransition(transition);\r\n+            Slide slide = new Slide();\r\n+            slide.setDuration(1000);\r\n+            getWindow().setEnterTransition(slide);\r\n+            getWindow().setSharedElementExitTransition(TransitionInflater.from(this).inflateTransition(R.transition.shared_element_transition));\r\n+        }\r\n+        super.onCreate(savedInstanceState);\r\n+        setContentView(R.layout.activity_gallery);\r\n+        links = getImagesUrls();\r\n+\r\n+        mGridView = (GridView) findViewById(R.id.gridView);\r\n+        mGridView.setAdapter(new GridAdapter());\r\n+        mGridView.setOnItemClickListener(this);\r\n+\r\n+    }\r\n+\r\n+    @Override\r\n+    public boolean onCreateOptionsMenu(Menu menu) {\r\n+        // Inflate the menu; this adds items to the action bar if it is present.\r\n+        getMenuInflater().inflate(R.menu.menu_gallery, menu);\r\n+        return true;\r\n+    }\r\n+\r\n+    @Override\r\n+    public boolean onOptionsItemSelected(MenuItem item) {\r\n+        // Handle action bar item clicks here. The action bar will\r\n+        // automatically handle clicks on the Home/Up button, so long\r\n+        // as you specify a parent activity in AndroidManifest.xml.\r\n+        int id = item.getItemId();\r\n+\r\n+        //noinspection SimplifiableIfStatement\r\n+        if (id == R.id.action_settings) {\r\n+            return true;\r\n+        }\r\n+\r\n+        return super.onOptionsItemSelected(item);\r\n+    }\r\n+\r\n+    @TargetApi(Build.VERSION_CODES.LOLLIPOP)\r\n+    @Override\r\n+    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\r\n+        view.setTransitionName(\"selectedPic\");\r\n+        ActivityOptionsCompat options = ActivityOptionsCompat.\r\n+                makeSceneTransitionAnimation(this, view, view.getTransitionName());\r\n+        Intent intent = new Intent(Gallery.this, FullPictureActivity.class);\r\n+        intent.putExtra(FullPictureActivity.EXTRA_PICTURE, links.get(position).toString());\r\n+        startActivity(intent, options.toBundle());\r\n+    }\r\n+\r\n+    public class GridAdapter extends BaseAdapter {\r\n+\r\n+        @Override\r\n+        public int getCount() {\r\n+            return links.size();\r\n+        }\r\n+\r\n+        @Override\r\n+        public Object getItem(int position) {\r\n+            return links.get(position);\r\n+        }\r\n+\r\n+        @Override\r\n+        public long getItemId(int position) {\r\n+            return 0;\r\n+        }\r\n+\r\n+        @Override\r\n+        public View getView(int position, View convertView, ViewGroup parent) {\r\n+            convertView = getLayoutInflater().inflate(R.layout.single_grid, parent, false);\r\n+            ImageView imageView = (ImageView) convertView.findViewById(R.id.imageView);\r\n+            Picasso.with(getApplicationContext()).load(links.get(position)).placeholder(R.drawable.progress_animation).into(imageView);\r","path":"simpleGallery/app/src/main/java/com/example/revern/simplegallery/Gallery.java","position":106,"original_position":106,"commit_id":"7be3b544f940d0d7cc83ae4603d6b103e12f05e2","original_commit_id":"7be3b544f940d0d7cc83ae4603d6b103e12f05e2","user":{"login":"ArturVasilov","id":6129801,"avatar_url":"https://avatars.githubusercontent.com/u/6129801?v=3","gravatar_id":"","url":"https://api.github.com/users/ArturVasilov","html_url":"https://github.com/ArturVasilov","followers_url":"https://api.github.com/users/ArturVasilov/followers","following_url":"https://api.github.com/users/ArturVasilov/following{/other_user}","gists_url":"https://api.github.com/users/ArturVasilov/gists{/gist_id}","starred_url":"https://api.github.com/users/ArturVasilov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArturVasilov/subscriptions","organizations_url":"https://api.github.com/users/ArturVasilov/orgs","repos_url":"https://api.github.com/users/ArturVasilov/repos","events_url":"https://api.github.com/users/ArturVasilov/events{/privacy}","received_events_url":"https://api.github.com/users/ArturVasilov/received_events","type":"User","site_admin":false},"body":"Нет кэширования и скейла.","created_at":"2015-09-23T05:58:56Z","updated_at":"2015-09-23T05:58:56Z","html_url":"https://github.com/revern/AndroidPractice/pull/2#discussion_r40172904","pull_request_url":"https://api.github.com/repos/revern/AndroidPractice/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/revern/AndroidPractice/pulls/comments/40172904"},"html":{"href":"https://github.com/revern/AndroidPractice/pull/2#discussion_r40172904"},"pull_request":{"href":"https://api.github.com/repos/revern/AndroidPractice/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/revern/AndroidPractice/pulls/2","id":45522085,"html_url":"https://github.com/revern/AndroidPractice/pull/2","diff_url":"https://github.com/revern/AndroidPractice/pull/2.diff","patch_url":"https://github.com/revern/AndroidPractice/pull/2.patch","issue_url":"https://api.github.com/repos/revern/AndroidPractice/issues/2","number":2,"state":"open","locked":false,"title":"Done all, except hiding toolbar","user":{"login":"revern","id":11560444,"avatar_url":"https://avatars.githubusercontent.com/u/11560444?v=3","gravatar_id":"","url":"https://api.github.com/users/revern","html_url":"https://github.com/revern","followers_url":"https://api.github.com/users/revern/followers","following_url":"https://api.github.com/users/revern/following{/other_user}","gists_url":"https://api.github.com/users/revern/gists{/gist_id}","starred_url":"https://api.github.com/users/revern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revern/subscriptions","organizations_url":"https://api.github.com/users/revern/orgs","repos_url":"https://api.github.com/users/revern/repos","events_url":"https://api.github.com/users/revern/events{/privacy}","received_events_url":"https://api.github.com/users/revern/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-21T08:01:30Z","updated_at":"2015-09-23T05:58:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe220310fffba88577d0117cfd122e1a17afb074","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/revern/AndroidPractice/pulls/2/commits","review_comments_url":"https://api.github.com/repos/revern/AndroidPractice/pulls/2/comments","review_comment_url":"https://api.github.com/repos/revern/AndroidPractice/pulls/comments{/number}","comments_url":"https://api.github.com/repos/revern/AndroidPractice/issues/2/comments","statuses_url":"https://api.github.com/repos/revern/AndroidPractice/statuses/7be3b544f940d0d7cc83ae4603d6b103e12f05e2","head":{"label":"revern:task2","ref":"task2","sha":"7be3b544f940d0d7cc83ae4603d6b103e12f05e2","user":{"login":"revern","id":11560444,"avatar_url":"https://avatars.githubusercontent.com/u/11560444?v=3","gravatar_id":"","url":"https://api.github.com/users/revern","html_url":"https://github.com/revern","followers_url":"https://api.github.com/users/revern/followers","following_url":"https://api.github.com/users/revern/following{/other_user}","gists_url":"https://api.github.com/users/revern/gists{/gist_id}","starred_url":"https://api.github.com/users/revern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revern/subscriptions","organizations_url":"https://api.github.com/users/revern/orgs","repos_url":"https://api.github.com/users/revern/repos","events_url":"https://api.github.com/users/revern/events{/privacy}","received_events_url":"https://api.github.com/users/revern/received_events","type":"User","site_admin":false},"repo":{"id":42652926,"name":"AndroidPractice","full_name":"revern/AndroidPractice","owner":{"login":"revern","id":11560444,"avatar_url":"https://avatars.githubusercontent.com/u/11560444?v=3","gravatar_id":"","url":"https://api.github.com/users/revern","html_url":"https://github.com/revern","followers_url":"https://api.github.com/users/revern/followers","following_url":"https://api.github.com/users/revern/following{/other_user}","gists_url":"https://api.github.com/users/revern/gists{/gist_id}","starred_url":"https://api.github.com/users/revern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revern/subscriptions","organizations_url":"https://api.github.com/users/revern/orgs","repos_url":"https://api.github.com/users/revern/repos","events_url":"https://api.github.com/users/revern/events{/privacy}","received_events_url":"https://api.github.com/users/revern/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/revern/AndroidPractice","description":"","fork":false,"url":"https://api.github.com/repos/revern/AndroidPractice","forks_url":"https://api.github.com/repos/revern/AndroidPractice/forks","keys_url":"https://api.github.com/repos/revern/AndroidPractice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/revern/AndroidPractice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/revern/AndroidPractice/teams","hooks_url":"https://api.github.com/repos/revern/AndroidPractice/hooks","issue_events_url":"https://api.github.com/repos/revern/AndroidPractice/issues/events{/number}","events_url":"https://api.github.com/repos/revern/AndroidPractice/events","assignees_url":"https://api.github.com/repos/revern/AndroidPractice/assignees{/user}","branches_url":"https://api.github.com/repos/revern/AndroidPractice/branches{/branch}","tags_url":"https://api.github.com/repos/revern/AndroidPractice/tags","blobs_url":"https://api.github.com/repos/revern/AndroidPractice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/revern/AndroidPractice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/revern/AndroidPractice/git/refs{/sha}","trees_url":"https://api.github.com/repos/revern/AndroidPractice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/revern/AndroidPractice/statuses/{sha}","languages_url":"https://api.github.com/repos/revern/AndroidPractice/languages","stargazers_url":"https://api.github.com/repos/revern/AndroidPractice/stargazers","contributors_url":"https://api.github.com/repos/revern/AndroidPractice/contributors","subscribers_url":"https://api.github.com/repos/revern/AndroidPractice/subscribers","subscription_url":"https://api.github.com/repos/revern/AndroidPractice/subscription","commits_url":"https://api.github.com/repos/revern/AndroidPractice/commits{/sha}","git_commits_url":"https://api.github.com/repos/revern/AndroidPractice/git/commits{/sha}","comments_url":"https://api.github.com/repos/revern/AndroidPractice/comments{/number}","issue_comment_url":"https://api.github.com/repos/revern/AndroidPractice/issues/comments{/number}","contents_url":"https://api.github.com/repos/revern/AndroidPractice/contents/{+path}","compare_url":"https://api.github.com/repos/revern/AndroidPractice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/revern/AndroidPractice/merges","archive_url":"https://api.github.com/repos/revern/AndroidPractice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/revern/AndroidPractice/downloads","issues_url":"https://api.github.com/repos/revern/AndroidPractice/issues{/number}","pulls_url":"https://api.github.com/repos/revern/AndroidPractice/pulls{/number}","milestones_url":"https://api.github.com/repos/revern/AndroidPractice/milestones{/number}","notifications_url":"https://api.github.com/repos/revern/AndroidPractice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/revern/AndroidPractice/labels{/name}","releases_url":"https://api.github.com/repos/revern/AndroidPractice/releases{/id}","created_at":"2015-09-17T11:41:31Z","updated_at":"2015-09-17T12:03:13Z","pushed_at":"2015-09-23T05:00:15Z","git_url":"git://github.com/revern/AndroidPractice.git","ssh_url":"git@github.com:revern/AndroidPractice.git","clone_url":"https://github.com/revern/AndroidPractice.git","svn_url":"https://github.com/revern/AndroidPractice","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"revern:master","ref":"master","sha":"b3169052fe6b71b423ec51998e619c104c4b65c2","user":{"login":"revern","id":11560444,"avatar_url":"https://avatars.githubusercontent.com/u/11560444?v=3","gravatar_id":"","url":"https://api.github.com/users/revern","html_url":"https://github.com/revern","followers_url":"https://api.github.com/users/revern/followers","following_url":"https://api.github.com/users/revern/following{/other_user}","gists_url":"https://api.github.com/users/revern/gists{/gist_id}","starred_url":"https://api.github.com/users/revern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revern/subscriptions","organizations_url":"https://api.github.com/users/revern/orgs","repos_url":"https://api.github.com/users/revern/repos","events_url":"https://api.github.com/users/revern/events{/privacy}","received_events_url":"https://api.github.com/users/revern/received_events","type":"User","site_admin":false},"repo":{"id":42652926,"name":"AndroidPractice","full_name":"revern/AndroidPractice","owner":{"login":"revern","id":11560444,"avatar_url":"https://avatars.githubusercontent.com/u/11560444?v=3","gravatar_id":"","url":"https://api.github.com/users/revern","html_url":"https://github.com/revern","followers_url":"https://api.github.com/users/revern/followers","following_url":"https://api.github.com/users/revern/following{/other_user}","gists_url":"https://api.github.com/users/revern/gists{/gist_id}","starred_url":"https://api.github.com/users/revern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revern/subscriptions","organizations_url":"https://api.github.com/users/revern/orgs","repos_url":"https://api.github.com/users/revern/repos","events_url":"https://api.github.com/users/revern/events{/privacy}","received_events_url":"https://api.github.com/users/revern/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/revern/AndroidPractice","description":"","fork":false,"url":"https://api.github.com/repos/revern/AndroidPractice","forks_url":"https://api.github.com/repos/revern/AndroidPractice/forks","keys_url":"https://api.github.com/repos/revern/AndroidPractice/keys{/key_id}","collaborators_url":"https://api.github.com/repos/revern/AndroidPractice/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/revern/AndroidPractice/teams","hooks_url":"https://api.github.com/repos/revern/AndroidPractice/hooks","issue_events_url":"https://api.github.com/repos/revern/AndroidPractice/issues/events{/number}","events_url":"https://api.github.com/repos/revern/AndroidPractice/events","assignees_url":"https://api.github.com/repos/revern/AndroidPractice/assignees{/user}","branches_url":"https://api.github.com/repos/revern/AndroidPractice/branches{/branch}","tags_url":"https://api.github.com/repos/revern/AndroidPractice/tags","blobs_url":"https://api.github.com/repos/revern/AndroidPractice/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/revern/AndroidPractice/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/revern/AndroidPractice/git/refs{/sha}","trees_url":"https://api.github.com/repos/revern/AndroidPractice/git/trees{/sha}","statuses_url":"https://api.github.com/repos/revern/AndroidPractice/statuses/{sha}","languages_url":"https://api.github.com/repos/revern/AndroidPractice/languages","stargazers_url":"https://api.github.com/repos/revern/AndroidPractice/stargazers","contributors_url":"https://api.github.com/repos/revern/AndroidPractice/contributors","subscribers_url":"https://api.github.com/repos/revern/AndroidPractice/subscribers","subscription_url":"https://api.github.com/repos/revern/AndroidPractice/subscription","commits_url":"https://api.github.com/repos/revern/AndroidPractice/commits{/sha}","git_commits_url":"https://api.github.com/repos/revern/AndroidPractice/git/commits{/sha}","comments_url":"https://api.github.com/repos/revern/AndroidPractice/comments{/number}","issue_comment_url":"https://api.github.com/repos/revern/AndroidPractice/issues/comments{/number}","contents_url":"https://api.github.com/repos/revern/AndroidPractice/contents/{+path}","compare_url":"https://api.github.com/repos/revern/AndroidPractice/compare/{base}...{head}","merges_url":"https://api.github.com/repos/revern/AndroidPractice/merges","archive_url":"https://api.github.com/repos/revern/AndroidPractice/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/revern/AndroidPractice/downloads","issues_url":"https://api.github.com/repos/revern/AndroidPractice/issues{/number}","pulls_url":"https://api.github.com/repos/revern/AndroidPractice/pulls{/number}","milestones_url":"https://api.github.com/repos/revern/AndroidPractice/milestones{/number}","notifications_url":"https://api.github.com/repos/revern/AndroidPractice/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/revern/AndroidPractice/labels{/name}","releases_url":"https://api.github.com/repos/revern/AndroidPractice/releases{/id}","created_at":"2015-09-17T11:41:31Z","updated_at":"2015-09-17T12:03:13Z","pushed_at":"2015-09-23T05:00:15Z","git_url":"git://github.com/revern/AndroidPractice.git","ssh_url":"git@github.com:revern/AndroidPractice.git","clone_url":"https://github.com/revern/AndroidPractice.git","svn_url":"https://github.com/revern/AndroidPractice","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/revern/AndroidPractice/pulls/2"},"html":{"href":"https://github.com/revern/AndroidPractice/pull/2"},"issue":{"href":"https://api.github.com/repos/revern/AndroidPractice/issues/2"},"comments":{"href":"https://api.github.com/repos/revern/AndroidPractice/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/revern/AndroidPractice/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/revern/AndroidPractice/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/revern/AndroidPractice/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/revern/AndroidPractice/statuses/7be3b544f940d0d7cc83ae4603d6b103e12f05e2"}}}}