From 555e6431b238f081fd877718165dac06ae9c8a46 Mon Sep 17 00:00:00 2001 From: cketti Date: Sat, 29 Jan 2011 02:49:39 +0000 Subject: [PATCH] Add credits for third-party libraries and emoji icons to about box --- res/values/strings.xml | 2 + src/com/fsck/k9/activity/Accounts.java | 63 +++++++++++++++++++------- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 41bc6de6b..31580fde8 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -9,6 +9,8 @@ http://code.google.com/p/k9mail/wiki/ReleaseNotes Revision Information: %s http://code.google.com/p/k9mail/ + We\'re using the following third-party libraries: %s + Emoji icons: %s read Email attachments Allows this application to read your Email attachments. diff --git a/src/com/fsck/k9/activity/Accounts.java b/src/com/fsck/k9/activity/Accounts.java index bd0fd14bd..5c8386fe6 100644 --- a/src/com/fsck/k9/activity/Accounts.java +++ b/src/com/fsck/k9/activity/Accounts.java @@ -819,29 +819,60 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC return true; } + private static String[][] USED_LIBRARIES = new String[][] { + new String[] {"jutf7", "http://jutf7.sourceforge.net/"}, + new String[] {"JZlib", "http://www.jcraft.com/jzlib/"}, + new String[] {"Commons IO", "http://commons.apache.org/io/"}, + new String[] {"Mime4j", "http://james.apache.org/mime4j/"}, + }; + private void onAbout() { String appName = getString(R.string.app_name); + String year = "2011"; WebView wv = new WebView(this); - String html = "" + - "\""+appName+"\"" + - "

" + String.format(getString(R.string.about_title_fmt), - "" + appName + "") + "

" + - "

" + appName + " " + - String.format(getString(R.string.debug_version_fmt), - getVersionNumber()) + "

" + - "

" + String.format(getString(R.string.app_authors_fmt), - getString(R.string.app_authors)) + "

" + - "

" + String.format(getString(R.string.app_revision_fmt), - "" + - getString(R.string.app_revision_url) + "

" + - "

" + String.format(getString(R.string.app_copyright_fmt), "2011","2011")+ "

" + - "

" + getString(R.string.app_license) + "

" + StringBuilder html = new StringBuilder() + .append("") + .append("\"").append(appName).append("\"/") + .append("

") + .append(String.format(getString(R.string.about_title_fmt), + "") + .append(appName) + .append("") + .append("

") + .append(appName) + .append(" ") + .append(String.format(getString(R.string.debug_version_fmt), getVersionNumber())) + .append("

") + .append(String.format(getString(R.string.app_authors_fmt), + getString(R.string.app_authors))) + .append("

") + .append(String.format(getString(R.string.app_revision_fmt), + "" + + getString(R.string.app_revision_url) + + "")) + .append("


") + .append(String.format(getString(R.string.app_copyright_fmt), year, year)) + .append("


") + .append(getString(R.string.app_license)) + .append("


"); + StringBuilder libs = new StringBuilder().append("

"); + html.append(String.format(getString(R.string.app_libraries), libs.toString())) + .append("


") + .append(String.format(getString(R.string.app_emoji_icons), + "

TypePad \u7d75\u6587\u5b57\u30a2\u30a4\u30b3\u30f3\u753b\u50cf " + + "(Six Apart Ltd) / " + + "CC BY 2.1
")) + .append("

"); - ); - wv.loadData(html, "text/html", "utf-8"); + wv.loadDataWithBaseURL("file:///android_res/drawable/", html.toString(), "text/html", "utf-8", null); new AlertDialog.Builder(this) .setView(wv) .setCancelable(true)