對于GitHub上開源項目的整理,很多部落格都有寫過。但是我覺得有些部落格整理的開源項目過多,讓我們看的眼花缭亂,以至于我們不知道該用哪一個好。是以為了更好的有利于初學者的學習,我從實戰和易用性的角度重新整理這些優秀的開源項目,貪多無厭,一兩個精品足以。
這些開源項目可以分為UI類和架構類。UI類主要介紹那些自定義特性的View,包括ListView、ActionBar、ViewPager、Gallery、GridView、ImageView、ProgressBar等等。架構類的話有包含由快速開發架構Afinal,xUtils,以及Google開源的網絡架構Volley.
UI類:
一、ListView
1、android-pulltorefresh
一個強大的拉動重新整理開源項目,支援各種控件下拉重新整理ListView、ViewPager、WevView、ExpandableListView、GridView、(Horizontal)ScrollView、Fragment上下左右拉動重新整理,比下面johannilsson那個隻支援ListView的強大的多。并且他實作的下拉重新整理ListView在item不足一屏情況下也不會顯示重新整理提示,體驗更好。
項目位址:https://github.com/chrisbanes/Android-PullToRefresh
Demo位址:https://github.com/Trinea/TrineaDownload/blob/master/pull-to-refreshview-demo.apk?raw=true
APP示例:新浪微網誌各個頁面
2、DragSortListView
拖動排序的ListView同時支援ListView滑動item删除,各個Item高度不一、單選、複選、CursorAdapter做為擴充卡、拖動背景變化等項目位址:https://github.com/bauerca/drag-sort-listview
Demo位址:https://play.google.com/store/apps/details?id=com.mobeta.android.demodslv
APP示例:Wordpress Android
3、SwipelistView
支援定義ListView左右滑動事件,支援左右滑動位移,支援定義動畫時間 項目 位址: https://github.com/47deg/android-swipelistview Demo位址: https://play.google.com/store/apps/details?id=com.fortysevendeg.android.swipelistview APP示例:微信
4、 pinned-section-listview GroupName
滑動到頂端時會固定不動直到另外一個GroupName到達頂端的ExpandListView項目位址:https://github.com/beworker/pinned-section-listview
效果圖:

二、ActionBar
1. ActionBarSherlock
為Android所有版本提供統一的ActionBar,解決4.0以下ActionBar的适配問題
項目位址:https://github.com/JakeWharton/ActionBarSherlock
Demo位址:https://play.google.com/store/apps/details?id=com.actionbarsherlock.sample.demos
APP示例:太多了。。現在連google都在用
2.ActionBar-PullToRefresh
下拉重新整理,ActionBar出現加載中提示
項目位址:https://github.com/chrisbanes/ActionBar-PullToRefresh
Demo位址:https://play.google.com/store/apps/details?id=uk.co.senab.actionbarpulltorefresh.samples.stock
APP示例:Gmail,Google plus,知乎等
三、 Menu
1.SlidingMenu
滑出式菜單,通過拖動螢幕邊緣滑出菜單,支援螢幕左右劃出,支援菜單zoom、scale、slide up三種動畫樣式出現。項目位址:https://github.com/jfeinstein10/SlidingMenu
Demo位址:https://play.google.com/store/apps/details?id=com.slidingmenu.example
APP示例:Foursquare, LinkedIn, Zappos, Rdio, Evernote Food, Plume, VLC for Android, ESPN ScoreCenter, MLS MatchDay, 9GAG, Wunderlist 2, The Verge, MTG Familiar, Mantano Reader, Falcon Pro (BETA), MW3 BarracksMenuDrawer和SlidingMenu比較:SlidingMenu支援菜單動畫樣式出現,MenuDrawer支援菜單view處于内容的上下層
四、ViewPager
1.Android-ViewPagerIndicator
配合ViewPager使用的Indicator,支援各種位置和樣式
項目位址:https://github.com/JakeWharton/Android-ViewPagerIndicator
Demo位址:https://play.google.com/store/apps/details?id=com.viewpagerindicator.sample
APP示例:太多了。
五、GridView
1、StaggeredGridView
允許非對齊行的GridView
類似Pinterest的瀑布流,并且跟ListView一樣自帶View緩存,繼承自ViewGroup
項目位址:https://github.com/maurycyw/StaggeredGridView
Demo位址:https://github.com/Trinea/TrineaDownload/blob/master/staggered-gridview-demo.apk?raw=true
APP示例:Pinterest等
2.DraggableGridView Item
可拖動交換位置的GridView,類似桌面的單屏效果
項目位址:https://github.com/thquinn/DraggableGridView
Demo位址:https://github.com/thquinn/DraggableGridView/blob/master/bin/DraggableGridViewSample.apk?raw=true
六、ImageView
1.PhotoView
支援輕按兩下或雙指縮放的ImageView
- 在ViewPager等Scrolling view中正常使用,相比上面的AndroidTouchGallery,不僅支援ViewPager,同時支援單個ImageView
- 項目位址:https://github.com/chrisbanes/PhotoView
- Demo位址:https://play.google.com/store/apps/details?id=uk.co.senab.photoview.sample
-
2.android-gif-drawable
-
支援gif顯示的view
項目位址:https://github.com/koral–/android-gif-drawable
用jni實作的,編譯生成so庫後直接xml定義view即可,而且本身不依賴于其他開源項目。
-
3.CircleImageView
-
-
圓形的ImageView
項目位址:https://github.com/hdodenhof/CircleImageView
效果圖:
github優秀開源項目整理 UI類: 工具類:
-
-
七、其他
-
1.android-square-progressbar
-
在圖檔周圍顯示進度
項目位址:https://github.com/mrwonderman/android-square-progressbar
Demo位址:https://play.google.com/store/apps/details?id=net.yscs.android.square_progressbar_example
APP示例:square
-
2.SwipeBackLayout
-
左右或向上滑動傳回的Activity
項目位址:https://github.com/Issacw0ng/SwipeBackLayout
Demo位址:https://play.google.com/store/apps/details?id=me.imid.swipebacklayout.demo
APP示例:知乎
-
3.achartengine
支援折線圖、面積圖、散點圖、時間圖、柱狀圖、條圖、餅圖、氣泡圖、圓環圖、範圍(高至低)條形圖、撥号圖/表、立方線圖及各種圖的結合
項目位址: https://code.google.com/p/achartengine/
官方網站: http://www.achartengine.org/
效果圖:
- http://www.achartengine.org/dimages/temperature_range_chart.png
- http://www.achartengine.org/dimages/combined_chart.png
- http://www.achartengine.org/dimages/budget_chart.png
- APP示例:Wordpress Android,Google Analytics
-
4.AndroidWheel
- 支援城市、多種日期時間、密碼、圖檔
-
項目位址:https://github.com/sephiroth74/AndroidWheel
效果圖:
github優秀開源項目整理 UI類: 工具類: -
5.android-lockpattern
-
Android的圖案密碼解鎖
項目位址:https://code.google.com/p/android-lockpattern/
Demo位址:https://play.google.com/store/apps/details?id=group.pals.android.lib.ui.lockpattern.demo
使用介紹:https://code.google.com/p/android-lockpattern/wiki/QuickUse
示例APP:Android開機的圖案密碼解鎖,支付寶的密碼解鎖
-
工具類:
1.Afinal
-
一、快速開發架構
-
Afinal是一個android的ioc,orm架構,内置了四大子產品功能:FinalAcitivity,FinalBitmap,FinalDb,FinalHttp。
通過finalActivity,我們可以通過注解的方式進行綁定ui和事件。
通過finalBitmap,我們可以友善的加載bitmap圖檔,而無需考慮oom等問題。
通過finalDB子產品,我們一行代碼就可以對android的sqlite資料庫進行增删改查。
通過FinalHttp子產品,我們可以以ajax形式請求http資料。
- GitHub 位址:https://github.com/yangfuhai/afinal
2.xUtils
xUtils 最初源于Afinal架構,進行了大量重構,使得xUtils支援大檔案上傳,更全面的http請求協定支援(10種謂詞),擁有更加靈活的ORM,更多的事件注解支援且不受混淆影響…
xUtils 包含了很多實用的android工具。
- xUitls最低相容android 2.2 (api level 8)。
- GitHub 位址: https://github.com/wyouflf/xUtils/
3. Android-Universal-Image-Loader
Android上最讓人頭疼的莫過于從網絡擷取圖檔、顯示、回收,任何一個環節有問題都可能直接OOM,這個項目或許能幫到你。Universal Image Loader for Android的目的是為了實作異步的網絡圖檔加載、緩存及顯示,支援多線程異步加載。它最初來源于Fedor Vlasov的項目,且自此之後,經過大規模的重構和改進。![]()
github優秀開源項目整理 UI類: 工具類: 4.Android Volley
在Google
I/O 2013上,Volley釋出了。Volley是Android平台上的網絡通信庫,能使網絡通信更快,更簡單,更健壯。
- Volley可是說是把AsyncHttpClient和Universal-Image-Loader的優點集于了一身,既可以像AsyncHttpClient一樣非常簡單地進行HTTP通信,也可以像Universal-Image-Loader一樣輕松加載網絡上的圖檔。除了簡單易用之外,Volley在性能方面也進行了大幅度的調整,它的設計目标就是非常适合去進行資料量不大,但通信頻繁的網絡操作,而對于大資料量的網絡操作,比如說下載下傳檔案等,Volley的表現就會非常糟糕。
- Volley首頁: https://android.googlesource.com/platform/frameworks/volley