Androidライブラリ、LicensedDialogを使ってみた。
アプリに使ったオープンソースのライブラリにはライセンスがあります。ライセンス毎に表記する文章がことなったりするので、さっくとライブラリで出来ないか探しました。LicensedDialogが有名みたいだったので使ってみました。
インストール
compile('de.psdev.licensesdialog:licensesdialog:1.8.0')
new Notice("ライブラリ名", "", "Copyright 20xx年 作者", ライセンスの種類)
サポートしている、ライセンスの種類
- ApacheSoftwareLicense20
- MITLicense
- GnuLesserGeneralPublicLicense21
- BSD2ClauseLicense
- BSD3ClauseLicense
- CreativeCommonsAttributionNoDerivs30Unported
詳しくは、github.com
クリックイベントでライセンスの内容が書かれたダイアログを表示します。
final Notices notices = new Notices(); notices.addNotice(new Notice("butterknife", "", "Copyright 2013 Jake Wharton", new ApacheSoftwareLicense20())); notices.addNotice(new Notice("timber", "", "Copyright 2013 Jake Wharton", new ApacheSoftwareLicense20())); final LicensesDialogFragment fragment = new LicensesDialogFragment.Builder(getApplicationContext()) .setNotices(notices) .setShowFullLicenseText(false) .setIncludeOwnLicense(true) .build(); fragment.show(getSupportFragmentManager(), null);
必須の機能なので、これからも積極的に利用していきたい。