這幾天剛做完一個項目。。有點空余時間,就想着吧這一兩年做的項目中的UI界面用到的一些庫整理一下。后來想了一下,既然要整理,就把網上常用的 AndroidUI界面的主流開源庫 一起整理一下,方便查看。
這次整理包涵一些常規的按鈕、Switch、進度條等控件都是通用控件,因此本文將其囊括,但一些很炫酷但不通用的控件除外。UI不僅包括控件,還包括效果、動畫甚至是一些UI輔助類庫等。
1、(https://github.com/Trinea/android-open-project)
2、(https://github.com/wasabeef/awesome-android-ui)
3、(http://www.jianshu.com/p/47a4a7b99364)
本文的取材大部分來自這三篇文章,在此感謝文章作者的辛勤付出。更要感謝的是那些無私奉獻代碼的Opener。
主流UI開源庫整理
一下是針對一些熱門 控件、開源項目做出一些介紹,有些項目效果看起來也很酷,但通用性很差,顯得有些雞肋,就靠后排列了,甚至介紹都免了。
Button(按鈕)
-
https://github.com/hoang8f/android-flat-button
很適合做扁平化、純色的按鈕,支持陰影。 -
https://github.com/Bearded-Hen/Android-Bootstrap
BootStrap風格的按鈕,做過前端的同學應該都知道。 -
https://github.com/dmytrodanylyk/circular-progress-button
可以顯示進度的按鈕,適用於點擊按鈕后執行一個長時間操作,此時可直接在按鈕上顯示進度。 - https://github.com/dmytrodanylyk/android-process-button
可以顯示進度的按鈕。同上。
Switch(開關)
-
https://github.com/kyleduo/SwitchButton
各式各樣風格的Switch,總有一個適合你。 -
https://github.com/Nightonke/JellyToggleButton
BootStrap帶有彈性效果的Switch。
編輯框(類EditText)
-
https://github.com/rengwuxian/MaterialEditText
Material Design風格的EditText。 -
https://github.com/mabbas007/TagsEditText
以標簽形式展示的EditText。 -
https://github.com/g707175425/CloudEditText
以標簽形式展示的EditText。 -
https://github.com/vekexasia/android-edittext-validator
帶錯誤校驗和提示的EditText。 -
https://github.com/qinci/AndroidEdit
為EditText提供撤銷、反撤銷功能。
文本控件(類TextView)
-
https://github.com/Manabu-GT/ExpandableTextView
可折疊的TextView,類似朋友圈查看全文。 -
https://github.com/grantland/android-autofittextview
自適應的TextView,在寬高固定的情況下,文字越多,字體越小。 -
https://github.com/rockerhieu/emojicon
支持emoji表情的TextView。 -
https://github.com/hanks-zyh/HTextView
支持很多文本特效的TextView,很贊。
進度條(圈)等展示進度相關
-
https://github.com/DreaminginCodeZH/MaterialProgressBar
Material Design風格的ProgressBar,支持多種效果。 -
https://github.com/hongyangAndroid/Android-ProgressBarWidthNumber
鴻洋大牛的作品,值得擁有。 -
https://github.com/lopspower/CircularProgressBar
很實用的進度條,雖然只有一種效果。 -
https://github.com/dinuscxj/LoadingDrawable
各式各樣創意、風格奇特的進度條。 -
https://github.com/akexorcist/Android-RoundCornerProgressBar
一個圓乎乎的、多彩的進度條。
拖動條(類SeekBar)
-
https://github.com/AnderWeb/discreteSeekBar
拖拽時可顯示氣泡提示的SeekBar。 -
https://github.com/oli107/material-range-bar
Material Design風格的、支持區間選取的SeekBar。
RatingBar
- https://github.com/DreaminginCodeZH/MaterialRatingBar
Material Design風格的RatingBar。
列表、網格、瀑布流控件
-
RecyclerView
這個就不用解釋了,使用請參考Android RecyclerView 使用完全解析 體驗藝術般的控件。 -
對於列表、網格的拖拽排序、側滑刪除,推薦使用RecyclerView來做,可參考https://github.com/YoKeyword/ItemTouchHelperDemo。
對話框(Dialog、BottomSheet等)
-
https://github.com/H07000223/FlycoDialog_Master
一套強大的Dialog集合,提供了類似BottomSheet的效果。 -
https://github.com/afollestad/material-dialogs
功能強大、支持各式各樣風格的Dialog。 -
https://github.com/drakeet/MaterialDialog
一套Material Design風格的對話框。 -
https://github.com/orhanobut/dialogplus
實現對話框的另一種選擇。
日歷、時間選擇
-
https://github.com/philliphsu/BottomSheetPickers
非常不錯的日歷、時間選擇控件。 -
https://github.com/wdullaer/MaterialDateTimePicker
Material Design風格的日歷、時間選擇器。 -
https://github.com/borax12/MaterialDateRangePicker
效果和MaterialDateTimePicker幾乎一樣,不知道是不是抄的,提供了日歷、時間區間的選擇。 -
https://github.com/traex/CalendarListview
基於ListView,效果類似原生android的日歷。 -
https://github.com/square/android-times-square
來自square的日歷選擇器。
分類篩選
- https://github.com/dongjunkun/DropDownMenu
一個實用的多條件篩選菜單。
角標、徽章
-
https://github.com/HeZaiJin/SlantedTextView
用TextView實現的標簽效果,值得一試。 -
https://github.com/stefanjauker/BadgeView
給特定的View添加角標效果。 -
https://github.com/leolin310148/ShortcutBadger
用來生成帶有角標的圖標。
圖表
-
https://github.com/xcltapestry/XCL-Charts
支持數十種圖表,總有一個適合你。 -
https://github.com/lecho/hellocharts-android
功能強大、支持各式各樣的圖表控件。 -
https://github.com/PhilJay/MPAndroidChart
強大、易於使用的圖表控件。
富文本編輯、代碼高亮等
-
https://github.com/wasabeef/richeditor-android
功能強大的富文本編輯器。 -
https://github.com/mthli/Knife
輕量級的富文本編輯器。 -
https://github.com/Thereisnospon/CodeView
強大的代碼高亮控件,支持多種語言。
圖片展示(類ImageView)
-
https://github.com/chrisbanes/PhotoView
強大的、人盡皆知的圖片瀏覽控件。 -
https://github.com/hdodenhof/CircleImageView
用來顯示圓角圖片的ImageView。 -
https://github.com/siyamed/android-shape-imageview
將圖片按照自定義的形狀顯示。 -
https://github.com/amulyakhare/TextDrawable
以Drawable的形式顯示字符,類似平時見到的“字符”頭像。 -
https://github.com/chengdazhi/StyleImageView
能實現簡單的圖像處理的ImageView。
標簽組控件(類FlowLayout)
-
https://github.com/BelooS/ChipsLayoutManager
基於RecyclerView實現的標簽控件。 -
https://github.com/hongyangAndroid/FlowLayout
鴻洋大牛的作品,支持單選、多選。
App新手引導、高亮
-
https://github.com/hongyangAndroid/Highlight
一個引導高亮的庫,來自鴻洋。 -
https://github.com/jaydenxiao2016/HighLightGuideView
又一個引導高亮庫。 -
https://github.com/matrixxun/ProductTour
非常酷的引導頁效果。 -
https://github.com/sacot41/SCViewPager
https://github.com/paolorotolo/AppIntro
一個比較炫酷的引導頁框架。
側邊欄索引、固定Header
-
https://github.com/beworker/pinned-section-listview
固定Header的ListView。 -
https://github.com/emilsjolander/StickyListHeaders
老牌的、固定Header的ListView。 -
https://github.com/timehop/sticky-headers-recyclerview
固定Header的RecyclerView。支持橫向、縱向。
菜單(類Menu,但不包括側滑菜單)
-
https://github.com/futuresimple/android-floating-action-button
大名鼎鼎的fab。 -
https://github.com/ogaclejapan/ArcLayout
弧形菜單,支持多種效果。 -
https://github.com/oguzbilgener/CircularFloatingActionMenu
炫酷的弧形菜單,支持自定義動畫。
通用下拉刷新、加載更多
-
https://github.com/liaohuqiu/android-Ultra-Pull-To-Refresh
廖祜秋大牛的下拉刷新框架,支持對任意View做下拉刷新,也僅限於做下拉刷新。 -
SwipeRefreshLayout
官方的、Material Design風格的下拉刷新框架。 -
https://github.com/chrisbanes/Android-PullToRefresh
老牌的下拉刷新框架,已廢棄。 -
那些只能對特定View做下拉刷新、上拉加載的非通用框架就不貼了。
廣告輪播、垂直公告
-
https://github.com/saiwu-bigkoo/Android-ConvenientBanner
基於ViewPager的廣告輪播控件,支持循環滾動。 -
https://github.com/sfsheng0322/MarqueeView
基於ViewFlipper的垂直公告控件。
滑動返回(類SwipeBack)
-
https://github.com/ikew0ng/SwipeBackLayout
老牌的滑動返回框架,需要結合透明主題,Activity不宜過多,否則卡頓嚴重。 -
https://github.com/YoKeyword/SwipeBackFragment
支持滑動返回的Fragment。 -
https://github.com/XBeats/and_swipeback
另一個滑動返回框架,無需設置透明主題。
指示器、Tab
-
https://github.com/hackware1993/MagicIndicator
強大、可定制、易擴展的 ViewPager 指示器框架。 -
https://github.com/romandanylyk/PageIndicatorView
支持多種小圈小點的指示器。 - TabLayout
總所周知的Tab框架,唯一的優勢是來自官方。
動畫相關庫
-
https://github.com/wasabeef/recyclerview-animators
一系列RecyclerView Item動畫合集。 -
https://github.com/nhaarman/ListViewAnimations
一系列ListView Item動畫合集。已廢棄,推薦使用RecyclerView。 -
https://github.com/daimajia/AndroidViewAnimations
老牌的View動畫合集。來自代碼家 -
https://github.com/gabrielemariotti/RecyclerViewItemAnimators
又一個ReyclerView Item動畫合集。 -
https://github.com/lgvalle/Material-Animations
一系列Material Design風格的動畫合集。 -
https://github.com/jfeinstein10/JazzyViewPager
一系列的PageTransformer合集。 -
https://github.com/JakeWharton/NineOldAndroids
動畫兼容庫,用來在2.3及以下系統上使用屬性動畫,現已廢棄。
側滑菜單(類SlidingMenu)
-
DrawerLayout
官方的側滑菜單,功能強大。 -
https://github.com/daimajia/AndroidSwipeLayout
一般用來實現View內部的側滑。
輔助類庫
-
ItemTouchHelper
用來實現RecyclerView側滑刪除、拖拽排序的工具類。 -
https://github.com/rubensousa/RecyclerViewSnap
讓RecyclerView具備類似ViewPager的效果。 -
ViewDragHelper
處理View拖拽的神器,使用參考Android ViewDragHelper完全解析 自定義ViewGroup神器。 -
Scroller
用於實現View的平滑滾動,使用參考Android Scroller完全解析,關於Scroller你所需知道的一切。