記錄自己最近在開發中使用的開源庫及部分使用方法,鏈接地址爲個人fork後的地址,可以參見原作者倉庫大家有什麼好用的可以留言,一起交流學習下。
原文地址:android 開源庫收藏
1. android 開發常用工具類
地址:https://github.com/txadf/Lazy
2. 字體圖標
地址:https://github.com/txadf/material-icon-lib
用法:
2.1.添加依賴
compile 'net.steamcrafted:materialiconlib:1.0.9'
2.2.xml中使用
注:需要添加命名空間
<net.steamcrafted.materialiconlib.MaterialIconView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:scaleType="center"
app:materialIcon="account"
app:materialIconColor="@color/mainColor"
app:materialIconSize="24dp"/>
示例效果:
3. UI Model
地址:http://genius.qiujuer.net/module/ui.html
按原作者網上站上的配置。
具體使用,按鈕的使用:
<net.qiujuer.genius.ui.widget.Button
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/gbtn_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp"
android:background="@color/mainColor"
android:onClick="LoginClickEvent"
android:text="@string/login_btn"
android:textColor="@color/white"
app:gFont="roboto.ttf"
app:gTouchColor="@color/black_alpha_32"
app:gTouchDurationRate="0.7"
app:gTouchEffect="ripple"/>
同樣需要注意添加命名空間。
4. xutils3
地址:https://github.com/txadf/xUtils3
5.進度條
地址:https://github.com/txadf/spots-dialog
效果:
6.對話框
地址:https://github.com/txadf/sweet-alert-dialog
示例效果:
7. EventBus
地址:https://github.com/txadf/EventBus
注意:在使用,進行註冊訂閱時,使用下面的方式,其中“XXX”表示需要訂閱的Activity或者Fragment名,避免直接使用“this”:
EventBus.getDefault().register(XXX.this);