{"action":"created","issue":{"url":"https://api.github.com/repos/square/picasso/issues/1238","repository_url":"https://api.github.com/repos/square/picasso","labels_url":"https://api.github.com/repos/square/picasso/issues/1238/labels{/name}","comments_url":"https://api.github.com/repos/square/picasso/issues/1238/comments","events_url":"https://api.github.com/repos/square/picasso/issues/1238/events","html_url":"https://github.com/square/picasso/pull/1238","id":123371727,"number":1238,"title":"centerCrop() align gravity options","user":{"login":"jskierbi","id":743666,"avatar_url":"https://avatars.githubusercontent.com/u/743666?v=3","gravatar_id":"","url":"https://api.github.com/users/jskierbi","html_url":"https://github.com/jskierbi","followers_url":"https://api.github.com/users/jskierbi/followers","following_url":"https://api.github.com/users/jskierbi/following{/other_user}","gists_url":"https://api.github.com/users/jskierbi/gists{/gist_id}","starred_url":"https://api.github.com/users/jskierbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jskierbi/subscriptions","organizations_url":"https://api.github.com/users/jskierbi/orgs","repos_url":"https://api.github.com/users/jskierbi/repos","events_url":"https://api.github.com/users/jskierbi/events{/privacy}","received_events_url":"https://api.github.com/users/jskierbi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-21T22:26:22Z","updated_at":"2016-03-14T14:10:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/square/picasso/pulls/1238","html_url":"https://github.com/square/picasso/pull/1238","diff_url":"https://github.com/square/picasso/pull/1238.diff","patch_url":"https://github.com/square/picasso/pull/1238.patch"},"body":"I've added overloaded centerCrop() method with align gravity parameter (```android.view.Gravity```).\r\n\r\nWhen gravity parameter is supplied, image is aligned first, then cropped.\r\n\r\nExample call:\r\n```\r\nPicasso.with(context)\r\n    .load(url)\r\n    .fit()\r\n    .centerCrop(Gravity.TOP)\r\n    .into(imageView);\r\n```\r\n\r\nParameterless ```centerCrop()``` is synonymous to ```centerCrop(Gravity.CENTER)```\r\n\r\nExample results:\r\n\r\n* ```centerCrop(Gravity.TOP | Gravity.START)```\r\n![top_start](https://cloud.githubusercontent.com/assets/743666/11942659/61d3d348-a838-11e5-8f52-4a5565405c05.png)\r\n\r\n* ```centerCrop(Gravity.BOTTOM | Gravity.END)```\r\n![bottom_end](https://cloud.githubusercontent.com/assets/743666/11942661/65745a72-a838-11e5-8305-fcd398dbc3d6.png)\r\n\r\nImageViews used in examples:\r\n```\r\n<ImageView\r\n    android:id=\"@+id/image_horizontal\"\r\n    android:layout_width=\"200dp\"\r\n    android:layout_height=\"100dp\" \r\n    />\r\n    \r\n<ImageView\r\n    android:id=\"@+id/image_vertial\"\r\n    android:layout_width=\"100dp\"\r\n    android:layout_height=\"200dp\" \r\n    />\r\n```"},"comment":{"url":"https://api.github.com/repos/square/picasso/issues/comments/196323888","html_url":"https://github.com/square/picasso/pull/1238#issuecomment-196323888","issue_url":"https://api.github.com/repos/square/picasso/issues/1238","id":196323888,"user":{"login":"FilipNabrdalik","id":11941972,"avatar_url":"https://avatars.githubusercontent.com/u/11941972?v=3","gravatar_id":"","url":"https://api.github.com/users/FilipNabrdalik","html_url":"https://github.com/FilipNabrdalik","followers_url":"https://api.github.com/users/FilipNabrdalik/followers","following_url":"https://api.github.com/users/FilipNabrdalik/following{/other_user}","gists_url":"https://api.github.com/users/FilipNabrdalik/gists{/gist_id}","starred_url":"https://api.github.com/users/FilipNabrdalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FilipNabrdalik/subscriptions","organizations_url":"https://api.github.com/users/FilipNabrdalik/orgs","repos_url":"https://api.github.com/users/FilipNabrdalik/repos","events_url":"https://api.github.com/users/FilipNabrdalik/events{/privacy}","received_events_url":"https://api.github.com/users/FilipNabrdalik/received_events","type":"User","site_admin":false},"created_at":"2016-03-14T14:10:50Z","updated_at":"2016-03-14T14:10:50Z","body":"that is what I need :)"}}