{"action":"created","issue":{"url":"https://api.github.com/repos/mikepenz/FastAdapter/issues/295","repository_url":"https://api.github.com/repos/mikepenz/FastAdapter","labels_url":"https://api.github.com/repos/mikepenz/FastAdapter/issues/295/labels{/name}","comments_url":"https://api.github.com/repos/mikepenz/FastAdapter/issues/295/comments","events_url":"https://api.github.com/repos/mikepenz/FastAdapter/issues/295/events","html_url":"https://github.com/mikepenz/FastAdapter/issues/295","id":196381601,"number":295,"title":"Right way to load data to recylerview","user":{"login":"rakesh1988","id":1203851,"avatar_url":"https://avatars.githubusercontent.com/u/1203851?v=3","gravatar_id":"","url":"https://api.github.com/users/rakesh1988","html_url":"https://github.com/rakesh1988","followers_url":"https://api.github.com/users/rakesh1988/followers","following_url":"https://api.github.com/users/rakesh1988/following{/other_user}","gists_url":"https://api.github.com/users/rakesh1988/gists{/gist_id}","starred_url":"https://api.github.com/users/rakesh1988/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakesh1988/subscriptions","organizations_url":"https://api.github.com/users/rakesh1988/orgs","repos_url":"https://api.github.com/users/rakesh1988/repos","events_url":"https://api.github.com/users/rakesh1988/events{/privacy}","received_events_url":"https://api.github.com/users/rakesh1988/received_events","type":"User","site_admin":false},"labels":[{"id":304496575,"url":"https://api.github.com/repos/mikepenz/FastAdapter/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":{"login":"mikepenz","id":1476232,"avatar_url":"https://avatars.githubusercontent.com/u/1476232?v=3","gravatar_id":"","url":"https://api.github.com/users/mikepenz","html_url":"https://github.com/mikepenz","followers_url":"https://api.github.com/users/mikepenz/followers","following_url":"https://api.github.com/users/mikepenz/following{/other_user}","gists_url":"https://api.github.com/users/mikepenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikepenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikepenz/subscriptions","organizations_url":"https://api.github.com/users/mikepenz/orgs","repos_url":"https://api.github.com/users/mikepenz/repos","events_url":"https://api.github.com/users/mikepenz/events{/privacy}","received_events_url":"https://api.github.com/users/mikepenz/received_events","type":"User","site_admin":false},"assignees":[{"login":"mikepenz","id":1476232,"avatar_url":"https://avatars.githubusercontent.com/u/1476232?v=3","gravatar_id":"","url":"https://api.github.com/users/mikepenz","html_url":"https://github.com/mikepenz","followers_url":"https://api.github.com/users/mikepenz/followers","following_url":"https://api.github.com/users/mikepenz/following{/other_user}","gists_url":"https://api.github.com/users/mikepenz/gists{/gist_id}","starred_url":"https://api.github.com/users/mikepenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikepenz/subscriptions","organizations_url":"https://api.github.com/users/mikepenz/orgs","repos_url":"https://api.github.com/users/mikepenz/repos","events_url":"https://api.github.com/users/mikepenz/events{/privacy}","received_events_url":"https://api.github.com/users/mikepenz/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-12-19T10:39:54Z","updated_at":"2016-12-19T12:16:58Z","closed_at":"2016-12-19T10:48:15Z","body":"This question is more on implementation. I have a BottomSheet which has two recyclerview. Data to these recyclerview is loaded from two different API's. \r\n\r\nInitially I had split the initialization and data load into two methods. \r\n\r\n```\r\n//pseudo code\r\ninit(){\r\n//recyclerview has fixedsize\r\n//recyclerview set layout manager\r\n//recyclerview set adapter\r\n}\r\n```\r\n\r\nevery time i have to change data of the recyclerview i used to call below method\r\n```\r\n//pseudo code again\r\nloadData(){\r\n//fastAapter.clear()\r\n//make a retrofit api call and on success do fastAapter.add()\r\n}\r\n```\r\nFor some strange reason, data never used to populate into the recyclerview. Then i merged both the methods. and every time i load data, i initialise recyclerview. \r\n\r\nAm I doing it right, or I need to debug why the data is not loading in the first setup.?"},"comment":{"url":"https://api.github.com/repos/mikepenz/FastAdapter/issues/comments/267950884","html_url":"https://github.com/mikepenz/FastAdapter/issues/295#issuecomment-267950884","issue_url":"https://api.github.com/repos/mikepenz/FastAdapter/issues/295","id":267950884,"user":{"login":"rakesh1988","id":1203851,"avatar_url":"https://avatars.githubusercontent.com/u/1203851?v=3","gravatar_id":"","url":"https://api.github.com/users/rakesh1988","html_url":"https://github.com/rakesh1988","followers_url":"https://api.github.com/users/rakesh1988/followers","following_url":"https://api.github.com/users/rakesh1988/following{/other_user}","gists_url":"https://api.github.com/users/rakesh1988/gists{/gist_id}","starred_url":"https://api.github.com/users/rakesh1988/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakesh1988/subscriptions","organizations_url":"https://api.github.com/users/rakesh1988/orgs","repos_url":"https://api.github.com/users/rakesh1988/repos","events_url":"https://api.github.com/users/rakesh1988/events{/privacy}","received_events_url":"https://api.github.com/users/rakesh1988/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T12:16:58Z","updated_at":"2016-12-19T12:16:58Z","body":"This is how I am initialising and adding data to RV.\r\nRV is visible and is declared as \r\n```\r\n <android.support.v4.widget.NestedScrollView\r\n                android:layout_width=\"match_parent\"\r\n                android:layout_height=\"wrap_content\">\r\n\r\n                <android.support.v7.widget.RecyclerView\r\n                    android:id=\"@+id/rv_bottom_sheet_store_comments\"\r\n                    android:layout_width=\"match_parent\"\r\n                    android:layout_height=\"wrap_content\"\r\n                    />\r\n            </android.support.v4.widget.NestedScrollView>\r\n```\r\n\r\n```\r\n    private void loadLatestCommentsToRecyclerView(String storeId)\r\n    {\r\n        \r\n        mCommentRecyclerView.setHasFixedSize(true);\r\n\r\n        mCommentRecyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext(), LinearLayoutManager.VERTICAL, false));\r\n        mCommentRecyclerView.setItemAnimator(new DefaultItemAnimator());\r\n        mCommentRecyclerView.setAdapter(mStoreCommentFastAdapter);\r\n\r\n        Call<List<StoreComment>> call = new D2hApiHelper().\r\n                getStoreComments(storeId);\r\n        call.enqueue(new Callback<List<StoreComment>>()\r\n        {\r\n\r\n            @Override\r\n            public void onResponse(Call<List<StoreComment>> call, Response<List<StoreComment>> response)\r\n            {\r\n                Timber.d(\"I got all comments\");\r\n                for (StoreComment comment :\r\n                        response.body())\r\n                {\r\n                    mStoreCommentFastAdapter.add(new StoreCommentItem(comment));\r\n                }\r\n            }\r\n\r\n            @Override\r\n            public void onFailure(Call<List<StoreComment>> call, Throwable t)\r\n            {\r\n                if (t instanceof HttpException)\r\n                {\r\n\r\n                }\r\n                Timber.e(\"unable to get data\");\r\n                Timber.e(t);\r\n            }\r\n        });\r\n    }\r\n```"}}
{"actor":{"display_login":"rakesh1988"}}