{"action":"created","issue":{"url":"https://api.github.com/repos/davideas/FlexibleAdapter/issues/554","repository_url":"https://api.github.com/repos/davideas/FlexibleAdapter","labels_url":"https://api.github.com/repos/davideas/FlexibleAdapter/issues/554/labels{/name}","comments_url":"https://api.github.com/repos/davideas/FlexibleAdapter/issues/554/comments","events_url":"https://api.github.com/repos/davideas/FlexibleAdapter/issues/554/events","html_url":"https://github.com/davideas/FlexibleAdapter/issues/554","id":299936866,"number":554,"title":"RecyclerView ItemDecoration","user":{"login":"meness","id":7955356,"avatar_url":"https://avatars3.githubusercontent.com/u/7955356?v=4","gravatar_id":"","url":"https://api.github.com/users/meness","html_url":"https://github.com/meness","followers_url":"https://api.github.com/users/meness/followers","following_url":"https://api.github.com/users/meness/following{/other_user}","gists_url":"https://api.github.com/users/meness/gists{/gist_id}","starred_url":"https://api.github.com/users/meness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meness/subscriptions","organizations_url":"https://api.github.com/users/meness/orgs","repos_url":"https://api.github.com/users/meness/repos","events_url":"https://api.github.com/users/meness/events{/privacy}","received_events_url":"https://api.github.com/users/meness/received_events","type":"User","site_admin":false},"labels":[{"id":206873906,"url":"https://api.github.com/repos/davideas/FlexibleAdapter/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-02-24T12:15:24Z","updated_at":"2018-02-27T18:10:45Z","closed_at":"2018-02-27T18:10:45Z","author_association":"NONE","body":"Please check off the following points BEFORE submitting a new issue / asking support.\r\n- [x] Write a self explanatory Subject.\r\n- [x] Check if the issue has already been raised by someone else (see closed issue).\r\n\r\nI add an item decoration to the `RecyclerView`, everything is fine, but the divider shown after each header item and this is not what I want.\r\n\r\n```java\r\npublic class ContactItemDivider extends RecyclerView.ItemDecoration {\r\n\r\n    private static final int[] ATTRS = new int[]{android.R.attr.listDivider};\r\n\r\n    private Drawable divider;\r\n\r\n    public ContactItemDivider(Context context) {\r\n        final TypedArray styledAttributes = context.obtainStyledAttributes(ATTRS);\r\n        divider = styledAttributes.getDrawable(0);\r\n        styledAttributes.recycle();\r\n    }\r\n\r\n    public ContactItemDivider(Context context, int resId) {\r\n        divider = ContextCompat.getDrawable(context, resId);\r\n    }\r\n\r\n    @Override\r\n    public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {\r\n        int padding = 140;\r\n        int left = parent.getPaddingLeft() + padding;\r\n        int right = parent.getWidth() - (parent.getPaddingRight() + padding);\r\n\r\n        int childCount = parent.getChildCount();\r\n        for (int i = 0; i < childCount; i++) {\r\n            View child = parent.getChildAt(i);\r\n\r\n            RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();\r\n\r\n            int top = child.getBottom() + params.bottomMargin;\r\n            int bottom = top + divider.getIntrinsicHeight();\r\n\r\n            divider.setBounds(left, top, right, bottom);\r\n            divider.draw(c);\r\n        }\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/davideas/FlexibleAdapter/issues/comments/368972396","html_url":"https://github.com/davideas/FlexibleAdapter/issues/554#issuecomment-368972396","issue_url":"https://api.github.com/repos/davideas/FlexibleAdapter/issues/554","id":368972396,"user":{"login":"davideas","id":12213847,"avatar_url":"https://avatars2.githubusercontent.com/u/12213847?v=4","gravatar_id":"","url":"https://api.github.com/users/davideas","html_url":"https://github.com/davideas","followers_url":"https://api.github.com/users/davideas/followers","following_url":"https://api.github.com/users/davideas/following{/other_user}","gists_url":"https://api.github.com/users/davideas/gists{/gist_id}","starred_url":"https://api.github.com/users/davideas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davideas/subscriptions","organizations_url":"https://api.github.com/users/davideas/orgs","repos_url":"https://api.github.com/users/davideas/repos","events_url":"https://api.github.com/users/davideas/events{/privacy}","received_events_url":"https://api.github.com/users/davideas/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T18:10:45Z","updated_at":"2018-02-27T18:10:45Z","author_association":"OWNER","body":"`int padding = 140;` is custom so you need to override that function or to create your own ItemDecoration."}}
{"actor":{"display_login":"davideas"}}