{"action":"created","issue":{"url":"https://api.github.com/repos/blipinsk/RecyclerViewHeader/issues/19","labels_url":"https://api.github.com/repos/blipinsk/RecyclerViewHeader/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/blipinsk/RecyclerViewHeader/issues/19/comments","events_url":"https://api.github.com/repos/blipinsk/RecyclerViewHeader/issues/19/events","html_url":"https://github.com/blipinsk/RecyclerViewHeader/issues/19","id":97901581,"number":19,"title":"SwipeRefreshLayout Can't use with RecyclerView","user":{"login":"hwangjr","id":2850206,"avatar_url":"https://avatars.githubusercontent.com/u/2850206?v=3","gravatar_id":"","url":"https://api.github.com/users/hwangjr","html_url":"https://github.com/hwangjr","followers_url":"https://api.github.com/users/hwangjr/followers","following_url":"https://api.github.com/users/hwangjr/following{/other_user}","gists_url":"https://api.github.com/users/hwangjr/gists{/gist_id}","starred_url":"https://api.github.com/users/hwangjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hwangjr/subscriptions","organizations_url":"https://api.github.com/users/hwangjr/orgs","repos_url":"https://api.github.com/users/hwangjr/repos","events_url":"https://api.github.com/users/hwangjr/events{/privacy}","received_events_url":"https://api.github.com/users/hwangjr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/blipinsk/RecyclerViewHeader/labels/Investigating","name":"Investigating","color":"fbca04"}],"state":"closed","locked":false,"assignee":{"login":"blipinsk","id":6371716,"avatar_url":"https://avatars.githubusercontent.com/u/6371716?v=3","gravatar_id":"","url":"https://api.github.com/users/blipinsk","html_url":"https://github.com/blipinsk","followers_url":"https://api.github.com/users/blipinsk/followers","following_url":"https://api.github.com/users/blipinsk/following{/other_user}","gists_url":"https://api.github.com/users/blipinsk/gists{/gist_id}","starred_url":"https://api.github.com/users/blipinsk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blipinsk/subscriptions","organizations_url":"https://api.github.com/users/blipinsk/orgs","repos_url":"https://api.github.com/users/blipinsk/repos","events_url":"https://api.github.com/users/blipinsk/events{/privacy}","received_events_url":"https://api.github.com/users/blipinsk/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2015-07-29T10:00:00Z","updated_at":"2015-08-31T12:55:21Z","closed_at":"2015-08-31T02:07:59Z","body":"I use RecyclerView with SwipeRefreshLayout and get this exception:\r\n``` java\r\njava.lang.IllegalStateException: Currently, NOT already aligned RecyclerViewHeader can only be used for RecyclerView with a parent of one of types: LinearLayout, FrameLayout, RelativeLayout.\r\n```\r\n\r\nUnsupport for SwipeRefreshLayout?\r\nsource code:\r\n``` java\r\n\r\n    private void validateRecycler(RecyclerView recycler, boolean headerAlreadyAligned) {\r\n        RecyclerView.LayoutManager layoutManager = recycler.getLayoutManager();\r\n        if (layoutManager == null) {\r\n            throw new IllegalStateException(\"Be sure to call RecyclerViewHeader constructor after setting your RecyclerView's LayoutManager.\");\r\n        } else if (layoutManager.getClass() != LinearLayoutManager.class    //not using instanceof on purpose\r\n                && layoutManager.getClass() != GridLayoutManager.class\r\n                && !(layoutManager instanceof StaggeredGridLayoutManager)) {\r\n            throw new IllegalArgumentException(\"Currently RecyclerViewHeader supports only LinearLayoutManager, GridLayoutManager and StaggeredGridLayoutManager.\");\r\n        }\r\n\r\n        if (layoutManager instanceof LinearLayoutManager) {\r\n            if (((LinearLayoutManager) layoutManager).getOrientation() != LinearLayoutManager.VERTICAL) {\r\n                throw new IllegalArgumentException(\"Currently RecyclerViewHeader supports only VERTICAL orientation LayoutManagers.\");\r\n            }\r\n        } else if (layoutManager instanceof StaggeredGridLayoutManager) {\r\n            if (((StaggeredGridLayoutManager) layoutManager).getOrientation() != StaggeredGridLayoutManager.VERTICAL) {\r\n                throw new IllegalArgumentException(\"Currently RecyclerViewHeader supports only VERTICAL orientation StaggeredGridLayoutManagers.\");\r\n            }\r\n        }\r\n\r\n        if (!headerAlreadyAligned) {\r\n            ViewParent parent = recycler.getParent();\r\n            if (parent != null &&\r\n                    !(parent instanceof LinearLayout) &&\r\n                    !(parent instanceof FrameLayout) &&\r\n                    !(parent instanceof RelativeLayout)) {\r\n                throw new IllegalStateException(\"Currently, NOT already aligned RecyclerViewHeader \" +\r\n                        \"can only be used for RecyclerView with a parent of one of types: LinearLayout, FrameLayout, RelativeLayout.\");\r\n            }\r\n        }\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/blipinsk/RecyclerViewHeader/issues/comments/136363170","html_url":"https://github.com/blipinsk/RecyclerViewHeader/issues/19#issuecomment-136363170","issue_url":"https://api.github.com/repos/blipinsk/RecyclerViewHeader/issues/19","id":136363170,"user":{"login":"hwangjr","id":2850206,"avatar_url":"https://avatars.githubusercontent.com/u/2850206?v=3","gravatar_id":"","url":"https://api.github.com/users/hwangjr","html_url":"https://github.com/hwangjr","followers_url":"https://api.github.com/users/hwangjr/followers","following_url":"https://api.github.com/users/hwangjr/following{/other_user}","gists_url":"https://api.github.com/users/hwangjr/gists{/gist_id}","starred_url":"https://api.github.com/users/hwangjr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hwangjr/subscriptions","organizations_url":"https://api.github.com/users/hwangjr/orgs","repos_url":"https://api.github.com/users/hwangjr/repos","events_url":"https://api.github.com/users/hwangjr/events{/privacy}","received_events_url":"https://api.github.com/users/hwangjr/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T12:55:21Z","updated_at":"2015-08-31T12:55:21Z","body":"@blipinsk , it's my fault.. i miss look the **header-already-aligned** on README.md and try to found it on branch, and then add header myself..\r\nIn fact, my header view has a little complex, like multiple focusable elements etc.. so finally i add a view type to RecyclerView.Adapter.\r\nanyway, i will try it on my next integration, and add it  to my work board."}}