CommonsWare Android Components或CWAC是一个开源组件库,能够用于解决Android开发中的各种解决方案问题。每一个CWAC组件都可以单独打包成一个微小的JAR文件,方便您把它添加到你的项目中。
当前提供的CWAC组件和它们的github仓库如下:
- cwac-adapter: 提供了一个AdapterWrapper,一个简单的封装类,默认情况下,代表所有ListAdapter的方法来包装ListAdapter。
- cwac-bus: 提供一组类来实现一个内部应用程序消息总线。这个组件专门针对服务与Activitie之间的通信,尤其是当Activitie可以在屏幕上旋转变换时。
- cwac-cache: 提供一组类用于为Android应用程序提供缓存服务。
- cwac-custmenu: 演示如何创建一个自定义的选项菜单,和一个Activity来配置菜单的选择顺序,这些顺序在运行期才会被应用。
- cwac-endless: Provides the EndlessAdapter, a wrapper for an existing ListAdapter that adds "endless list" capability. When the user scrolls to the bottom of the list, if there is more data for this list to be retrieved, your code gets invoked in a background thread to fetch the new rows, which then get seamlessly attached to the bottom of the list.
- cwac-merge: Provides the MergeAdapter, a ListAdapter that blends multiple Views or ListAdapters into a single ListAdapter. Use this for section headings, blending multiple sources of data together, etc.
- cwac-mmcursor: Provides MutableMatrixCursor, a variation on the Android built-in MatrixCursor, but one that supports removing rows in addition to adding them.
- cwac-sacklist: Provides SackOfViewsAdapter, which accepts a list of View objects and presents them in a ListAdapter.
- cwac-task: Provides AsyncTaskEx, a variation on the Android built-in AsyncTask class, but one that offers multiple threads processing tasks in parallel and an arbitrary number of pending tasks.
- cwac-thumbnail: Provides support for ListViews having thumbnail images in their rows, with those images being loaded from URLs and cached transparently in the background. Also offers a ThumbnailActivity as a subclass of ListActivity for further simplifiying thumbnail management.
- cwac-wakeful: Provides the WakefulIntentService, a refinement of the IntentService that keeps the device awake while background tasks are being processed. This is useful for work to be scheduled via the AlarmManager.