Giter Club home page Giter Club logo

asynclistview's Introduction

AsyncListView

本次Demo实现了使用Android中的异步任务来加载网络上的内容,同时实现了图片的下载与展示 实现的过程中也有一些需要注意的地方,比如网络的访问权限在AndroidManifest中一定要加上,否则不能访问网络。

编写Demo时的一些思路与注意事项:

  1. 图片和文字要分开来加载,先加载文字,图片在用到的时候才去加载,这样会提高用户体验
  2. 由于我们优化ListView的时候使用了复用的布局converttView,所以可能会出现图片错乱的情况,这时可以为对应的imageView设置一个唯一Tag标签,用来匹配传递过来的图片和标识符。
  3. 为了节省用户流量等考虑,我们应该将之前加载过的一些内容缓存起来,这里我们用了Map<>来缓存图片,使用一个list集合来缓存加载过的文字信息,以后有更好的方法再去修改。

asynclistview's People

Contributors

bubblexin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.