BaseAndroidDev
一個(gè)基本的開發(fā)框架毫缆,便于自己及團(tuán)隊(duì)快速開發(fā)唯竹,包含各種實(shí)用的 BaseActivity 、BaseFragment 苦丁、framework 浸颓、utils 等,工(lao)程(si)師(ji)必備旺拉。
使用
JitPack 引入方法
1. 在 Project 下的 build.gradle 添加
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
2. 在 Module 下的 build.gradle 添加
dependencies {
compile 'com.github.lishide:BaseAndroidDev:v+latest version' //latest version 見上方 JitPack 圖標(biāo)所示
//如:
compile 'com.github.lishide:BaseAndroidDev:v1.0.7'
}
Ps:在使用的時(shí)候請看清是以 com.base.adev
開頭的包名产上。
文檔 Wiki
--- 版本更新說明 - 入口
一、Base
1. BaseActivity
基礎(chǔ) Activity
2. BaseRecyclerActivity
只有列表顯示的界面的基礎(chǔ) Activity
3. BaseTabBottomActivity
底部 Tab 的基礎(chǔ) Activity
4. BaseTabLayActivity
頂部 TabLayout 的基礎(chǔ) Activity
5. BaseFragment
基礎(chǔ) Fragment
6. BaseRecyclerFragment
只有列表顯示的界面的基礎(chǔ) Fragment
7. BaseAdapter
基礎(chǔ) Adapter
二蛾狗、Net framework
1. Volley
關(guān)于更多 volley 的介紹和使用方法晋涣,請移步至本人的另一 repo:MyVolley:Volley 的使用及其工具類的封裝 查看更多。
(本人已放棄使用沉桌,仍然可用谢鹊。不過強(qiáng)烈推薦使用 2. NoHttp !A羝尽5瓒蟆)
2. NoHttp
NoHttp —— 一個(gè)有情懷的網(wǎng)絡(luò)框架 ,讓你的網(wǎng)絡(luò)請求更簡單冰抢。
基于 NoHttp 的封裝:NoHttpConnecter
三松嘶、自定義控件
收集整理一些實(shí)用的自定義控件艘狭,會持續(xù)更新挎扰。
widget | 描述 |
---|---|
com.base.adev.view.MarqueeTextView | 文字跑馬燈功能(自定義跑馬燈控件) |
com.base.adev.view.NoticeView | 廣告條控件 |
com.base.adev.view.LedTextView | LED 文字控件 |
com.base.adev.view.coverflow.CoverFlowView | CoverFlow 自定義控件 |
com.base.adev.view.ActionSheetDialog | 仿 iOS 的底部彈出 dialog |
com.base.adev.view.IosAlertDialog | 仿 iOS 的中間彈出 dialog |
com.base.adev.view.ToastView | 自定義 ToastView 控件 |
四、工具類
收集整理一些實(shí)用的工具類巢音,會持續(xù)更新遵倦。
utils | 描述 |
---|---|
CommonUtils | 通用工具類(字符合法性等常見工具類) |
DateUtil | 日期時(shí)間幫助類 |
ScreenUtil | 獲取屏幕的大小 |
ToastUtils | 吐司相關(guān)工具類 |
ClickUtil | 點(diǎn)擊事件工具類 |
SystemBarTintManager | 沉浸狀態(tài)欄使用 |
MyGlideLoadUtil | Glide 加載圖片工具類 |
MyBitmapImageViewTarget | Glide 加載圖片設(shè)置合適 ScaleType 的工具類 |
StatusBarUtils | 狀態(tài)欄設(shè)置工具類 |
GetFolderSizeManager | 獲取文件夾大小 |
DataCleanManager | 本應(yīng)用數(shù)據(jù)清除管理器 |
五、用到的開源庫
- Gson
比較常用的 JSON 解析序列化庫
compile 'com.google.code.gson:gson:2.8.2'
- Glide
圖片加載庫
An image loading and caching library for Android focused on smooth scrolling
compile 'com.github.bumptech.glide:glide:4.1.1'
- Bottom Navigation Bar
This Library helps users to use Bottom Navigation Bar (A new pattern from google) with ease and allows ton of customizations
compile 'com.ashokvarma.android:bottom-navigation-bar:2.0.2'
- SVProgressHUD
精仿 iOS 的提示庫 SVProgressHUD
compile 'com.bigkoo:svprogresshud:1.0.6'
- SwipeRecyclerView
RecyclerView 側(cè)滑菜單官撼,Item拖拽梧躺,滑動(dòng)刪除 Item,自動(dòng)加載更多,和 ViewPager掠哥、DrawerLayout 結(jié)合使用巩踏,和任何下拉刷新框架結(jié)合使用。
compile 'com.yanzhenjie:recyclerview-swipe:1.0.4'
- 省市區(qū)三級聯(lián)動(dòng)
citypicker 高仿 iOS 滾輪實(shí)現(xiàn) 省市區(qū) 城市選擇三級聯(lián)動(dòng)
compile 'liji.library.dev:citypickerview:0.9.0'
- RxGalleryFinal
圖片/視頻文件選擇器
compile 'cn.finalteam.rxgalleryfinal:library:0.0.9'
- MaterialDialog
Material Design 風(fēng)格的自定義 Dialog
compile 'me.drakeet.materialdialog:library:1.3.1'
- CircleImageView
A circular ImageView for Android
compile 'de.hdodenhof:circleimageview:2.1.0'
- PhotoView
圖片瀏覽縮放控件
compile 'com.bm.photoview:library:1.4.1'
- Banner
廣告欄控件
compile 'com.bigkoo:convenientbanner:2.0.5'
- 翻頁效果
各種翻頁效果
compile 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:1.2.32@aar'
- GSYVideoPlayer 視頻播放器
視頻播放器(IJKplayer)续搀,HTTPS支持塞琼,支持彈幕,支持基本的拖動(dòng)禁舷,聲音彪杉、亮度調(diào)節(jié),支持邊播邊緩存牵咙,支持視頻本身自帶rotation的旋轉(zhuǎn)(90,270之類)派近,重力旋轉(zhuǎn)與手動(dòng)旋轉(zhuǎn)的同步支持,支持列表播放 洁桌,直接添加控件為封面渴丸,列表全屏動(dòng)畫,視頻加載速度另凌,列表小窗口支持拖動(dòng)曙强,5.0的過場效果,調(diào)整比例途茫,多分辨率切換碟嘴,支持切換播放器,進(jìn)度條小窗口預(yù)覽囊卜,其他一些小動(dòng)畫效果娜扇。
compile 'com.shuyu:GSYVideoPlayer:2.0.8'
- AndroidVideoCache
Cache support for any video player with help of single line
compile 'com.danikula:videocache:2.6.4'
- BaseRecyclerViewAdapterHelper
RecyclerView 的強(qiáng)大的 BaseAdapter
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.3'
- Volley
網(wǎng)絡(luò)請求框架
compile 'com.mcxiaoke.volley:library:1.0.19'
- NoHttp
Android實(shí)現(xiàn)Http標(biāo)準(zhǔn)協(xié)議框架,支持緩存(提供五種緩存模式)栅组、代理雀瓢、重定向,底層可動(dòng)態(tài)切換OkHttp玉掸、URLConnection刃麸,與RxJava完美結(jié)合,比Retrofit更簡單易用司浪。 http://www.nohttp.net
compile 'com.yanzhenjie.nohttp:okhttp:1.1.1'
- AndPermission
Android 6.0運(yùn)行時(shí)權(quán)限管理
compile 'com.yanzhenjie:permission:1.1.0'
- Butter Knife
Bind Android views and callbacks to fields and methods.
- NoHttpConnecter
小編簡單封裝的 NoHttp
compile 'com.github.lishide:NoHttpConnecter:v1.0.3'
- ImgCoverFlow
CoverFlow 列表
compile 'com.github.lishide:ImgCoverFlow:v1.0.1'
- MarqueeViewLibrary
通過MarqueeFactory來提供各種樣式的跑馬燈View泊业,支持自定義跑馬燈ItemView
compile 'compile 'com.gongwen:marqueelibrary:1.0.4'
- EventBus
事件總線
compile 'org.greenrobot:eventbus:3.0.0'
- Album
Album是一個(gè)MD風(fēng)格的開源相冊,支持國際化啊易,支持國際化擴(kuò)展吁伺;主要功能模塊:選擇圖片與視頻、拍照租谈、錄視頻篮奄、畫廊(支持本地和網(wǎng)絡(luò))。
compile 'com.yanzhenjie:album:2.0.0'
- Durban
Durban是一個(gè)MD風(fēng)格的圖片裁剪工具
compile 'com.yanzhenjie:durban:1.0.1'
Ps:以上開源庫版本可能不是最新的,建議使用時(shí)查看原作 GitHub 使用最新版窟却。
六昼丑、Material Design
widget | 描述 |
---|---|
android.support.v7.widget.Toolbar | Toolbar |
android.support.design.widget.TabLayout | TabLayout |
android.support.design.widget.CoordinatorLayout | CoordinatorLayout |
android.support.design.widget.AppBarLayout | AppBarLayout |
android.support.design.widget.CollapsingToolbarLayout | CollapsingToolbarLayout |
android.support.v4.widget.NestedScrollView | NestedScrollView |
android.support.design.widget.FloatingActionButton | FloatingActionButton:浮動(dòng)按鈕 |
Snackbar.make(view, "", Snackbar.LENGTH_SHORT).show(); | Snackbar:消息的提示和動(dòng)作反饋 |
本人會堅(jiān)持在這個(gè)項(xiàng)目上實(shí)踐最新的技術(shù),逐漸完善夸赫,讓它越來越完美矾克! Ps:本項(xiàng)目中使用的許多好用的輪子均根據(jù)網(wǎng)上各位大牛的開源項(xiàng)目參考和修改而來,首先向各位致謝憔足,如果有什么使用不當(dāng)?shù)牡胤叫哺剑埪?lián)系我。代碼開源在 GitHub:BaseAndroidDev滓彰,您在使用過程中控妻,發(fā)現(xiàn) bug 或有好的建議歡迎 issue 、email (lishidezy@gmail.com)揭绑,如果感覺對你有幫助也歡迎點(diǎn)個(gè) star弓候,留下點(diǎn)印記吧。