Android:实现进度条和“加载..."适用于 Android Market 等无尽列表 [英] Android: Implementing progressbar and "loading..." for Endless List like Android Market

查看:19
本文介绍了Android:实现进度条和“加载..."适用于 Android Market 等无尽列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 Android Market 中汲取灵感,我实现了一个 Endless List,当我们到达 List 的末尾时,它会从服务器加载更多数据.

Taking inspiration from Android Market, i have implemented a Endless List which loads more data from the server when we reach the end of the List.

现在,我需要实现进度条 &正在加载.."文本如图所示

Now, i need to implement the progressbar & "Loading.." text as shown

可以从中汲取灵感的示例代码会很棒.

Sample code to take inspiration from would be great.

推荐答案

这里有一个解决方案,它也可以在 ListView 加载时轻松地在其末尾显示加载视图.

Here is a solution that also makes it easy to show a loading view in the end of the ListView while it's loading.

您可以在此处查看课程:

You can see the classes here:

https://github.com/Cyber​​Eagle/OpenProjects/blob/master/android-projects/widgets/src/main/java/br/com/cybereagle/androidwidgets/helper/ListViewWithLoadingIndicatorHelper.java- 无需从 SimpleListViewWithLoadingIndicator 扩展即可使用功能的助手.

https://github.com/CyberEagle/OpenProjects/blob/master/android-projects/widgets/src/main/java/br/com/cybereagle/androidwidgets/helper/ListViewWithLoadingIndicatorHelper.java - Helper to make it possible to use the features without extending from SimpleListViewWithLoadingIndicator.

https://github.com/Cyber​​Eagle/OpenProjects/blob/master/android-projects/widgets/src/main/java/br/com/cybereagle/androidwidgets/listener/EndlessScrollListener.java- 当用户即将到达 ListView 底部时开始加载数据的侦听器.

https://github.com/CyberEagle/OpenProjects/blob/master/android-projects/widgets/src/main/java/br/com/cybereagle/androidwidgets/listener/EndlessScrollListener.java - Listener that starts loading data when the user is about to reach the bottom of the ListView.

https://github.com/Cyber​​Eagle/OpenProjects/blob/master/android-projects/widgets/src/main/java/br/com/cybereagle/androidwidgets/view/SimpleListViewWithLoadingIndicator.java- EndlessListView.你可以直接使用这个类,也可以继承它.

https://github.com/CyberEagle/OpenProjects/blob/master/android-projects/widgets/src/main/java/br/com/cybereagle/androidwidgets/view/SimpleListViewWithLoadingIndicator.java - The EndlessListView. You can use this class directly or extend from it.

这篇关于Android:实现进度条和“加载..."适用于 Android Market 等无尽列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆