Tag: endlessscroll

如何在RecyclerView中实现setOnScrollListener

当用户到达列表中可见的项目时,如何在底部显示进度条。 我编写了一个代码,我使用Web服务获取数据,现在我想填充部分记录,因为我的JSON中有大约630条记录 。 这是我用来从JSON获取数据并填充到RecyclerView中的整个代码。 以下是我的JSON外观,但真正的JSON包含600多条记录: http://walldroidhd.com/api.php 有人可以指导我在我的代码中进行更改吗? 我想在用户使用进度条滚动到底部时填充更多记录,但我仍然显示所有记录。 RecyclerViewFragment.java: public class RecyclerViewFragment extends Fragment { RecyclerView mRecyclerView; LinearLayoutManager mLayoutManager; RecyclerView.Adapter mAdapter; ArrayList actorsList; private int previousTotal = 0; private boolean loading = true; private int visibleThreshold = 5; int firstVisibleItem, visibleItemCount, totalItemCount; public static RecyclerViewFragment newInstance() { return new RecyclerViewFragment(); } @Override public View onCreateView(LayoutInflater […]

无尽的滚动列表视图无法正常工作

我正在开发一个应用程序。 在我的应用程序中,我使用listview来显示来自json的数据。 所有数据都完美显示。 但我想要的是,显示前10个对象,然后加载项目应显示,然后剩余10将显示。 我的json响应如下所示。 { “interestsent”: [ { “interestsent_user_id”:369, “name”:”abc”, “profile_id”:”686317″, “image”:””, }, { “interestsent_user_id”:369, “name”:”def”, “profile_id”:”686318″, “image”:””, }, { “interestsent_user_id”:369, “name”:”ghi”, “profile_id”:”686319″, “image”:””, }, { “interestsent_user_id”:369, “name”:”jkl”, “profile_id”:”686320″, “image”:””, }, { “interestsent_user_id”:369, “name”:”mno”, “profile_id”:”686321″, “image”:””, }, { “interestsent_user_id”:369, “name”:”pqr”, “profile_id”:”686322″, “image”:””, }, …………….. …………….. ] } Interestsent.java @Override protected void onCreate(Bundle savedInstanceState) { […]