Android開発用ライブラリの整理(2015年11月時点その2)
引き続きライブラリの調査です。
メモリリーク検出用ライブラリ
・leakcanary
Applicationクラス内で(クラス名は適当にGlobalsと命名)セットして、
import com.squareup.leakcanary.LeakCanary;
public class Globals extends Application {
@Override
public void onCreate() {
super.onCreate();
LeakCanary.install(this);
}
}
マニフェストファイルで
<application
android:name=".Globals"
・・・省略
でOKです
試しに、デモ用のアプリに入れ、ガチャガチャ操作したところ、見事検知しました。
導入もラクですし、ええです。
イケてるデザインのボタン/アイコン提供ライブラリ
・Android -BootStrap
※補足 もう1つAndroid Bootstrapと名前被りしているライブラリがあるので注意
そっちはいくつかのライブラリをまとめたやつみたいです
これも今ではだいぶ重宝させていただいてます。
レイアウトXMLにて、
ボタンの場合、
xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
<com.beardedhen.androidbootstrap.BootstrapButton
android:id="@+id/decide_mode"
android:layout_marginBottom="100dp"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:text="@string/decision"
android:textSize="35sp"
bootstrap:bb_roundedCorners="true"
bootstrap:bb_size="large"
bootstrap:bb_type="danger" />
アイコンの場合はこんな感じ
xmlns:fontawesometext="http://schemas.android.com/apk/res-auto"
<com.beardedhen.androidbootstrap.FontAwesomeText
android:layout_marginTop="30dp"
android:layout_marginLeft="25dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="45sp"
android:textColor="@color/mtgreen"
fontawesometext:fa_icon="fa-tree"/>
で、標準より少し良い感じの部品が提供出来ます。
ほんで、この記事作成中にboot strapがアップデートされている事に気づきました。
新しく下記のコンポーネントも追加されていました! より便利になりそう
・BootstrapButtonGroup