openlp-android team mailing list archive
-
openlp-android team
-
Mailing list archive
-
Message #00141
[Merge] lp:~trb143/openlp/android_05 into lp:openlp/android
Tim Bentley has proposed merging lp:~trb143/openlp/android_05 into lp:openlp/android.
Requested reviews:
OpenLP Android Developers (openlp-android)
For more details, see:
https://code.launchpad.net/~trb143/openlp/android_05/+merge/105577
Fix spelling error
Add About page to the settings screen
--
https://code.launchpad.net/~trb143/openlp/android_05/+merge/105577
Your team OpenLP Android Developers is requested to review the proposed merge of lp:~trb143/openlp/android_05 into lp:openlp/android.
=== modified file 'AndroidManifest.xml'
--- AndroidManifest.xml 2012-05-05 17:29:57 +0000
+++ AndroidManifest.xml 2012-05-13 08:14:19 +0000
@@ -34,7 +34,7 @@
<activity android:name=".activity.Preferences" android:label="@string/preferences"/>
<activity android:name=".activity.PagerActivity"/>
- <service android:name=".service.PingIntent"/>
+ <service android:name=".service.PingIntent"/>
<service android:name=".service.ApiCallIntent"/>
<meta-data
=== modified file 'OpenLP.apk'
Binary files OpenLP.apk 2012-05-06 15:53:56 +0000 and OpenLP.apk 2012-05-13 08:14:19 +0000 differ
=== modified file 'res/values/strings.xml'
--- res/values/strings.xml 2012-05-05 17:29:57 +0000
+++ res/values/strings.xml 2012-05-13 08:14:19 +0000
@@ -1,5 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
+ <string name="about">About</string>
+ <string name="about_text">OpenLP Android version</string>
+ <string name="about_display_1">OpenLP is free church presentation software.</string>
+ <string name="about_display_2">Find out more about OpenLP</string>
+ <string name="about_display_3">Copyright</string>
+ <string name="about_display_4">Portions copyright</string>
+ <string name="about_display_5">This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.</string>
+ <string name="about_display_6">This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</string>
<string name="app_name">OpenLP</string>
<string name="settings">Settings</string>
<string name="preferences">Preferences</string>
=== modified file 'res/xml/preferences.xml'
--- res/xml/preferences.xml 2012-05-05 17:29:57 +0000
+++ res/xml/preferences.xml 2012-05-13 08:14:19 +0000
@@ -69,4 +69,11 @@
android:entryValues="@array/socketValues"
android:defaultValue="@integer/socketTimeoutDefaultValue"/>
</PreferenceCategory>
+ <Preference
+ android:title="@string/about"
+ android:summary="@string/about_text">
+ <intent
+ android:action="android.intent.action.VIEW"
+ android:data="" />
+ </Preference>
</PreferenceScreen>
=== modified file 'src/org/openlp/android/activity/Preferences.java'
--- src/org/openlp/android/activity/Preferences.java 2012-05-05 17:29:57 +0000
+++ src/org/openlp/android/activity/Preferences.java 2012-05-13 08:14:19 +0000
@@ -20,11 +20,20 @@
*******************************************************************************/
package org.openlp.android.activity;
+import android.content.ComponentName;
+import android.content.Intent;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.net.Uri;
import android.os.Bundle;
+import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.util.Log;
import org.openlp.android.R;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
/**
* Credits: http://www.kaloer.com/android-preferences
* http://androidpartaker.wordpress.com/2010/07/11/android-preferences/
@@ -37,8 +46,54 @@
getPreferenceManager().setSharedPreferencesName(
getString(R.string.keySharedPreferences));
addPreferencesFromResource(R.xml.preferences);
+
+ PackageManager manager = this.getPackageManager();
+ String version = "";
+ try{
+ PackageInfo info = manager.getPackageInfo(this.getPackageName(), 0);
+ version = info.versionName;
+ }
+ catch (PackageManager.NameNotFoundException e){
+ // Nop as version defined
+ }
+ Preference pref = getPreferenceScreen().getPreference(getPreferenceScreen().getPreferenceCount() - 1);
+ pref.setSummary(getResources().getString(R.string.about_text) + " " + version);
+
+ ComponentName c = new ComponentName("com.android.browser", "com.android.browser.BrowserActivity");
+
+ Intent intent = pref.getIntent();
+ intent.setComponent(new ComponentName("com.android.browser", "com.android.browser.BrowserActivity"));
+ intent.setAction(Intent.ACTION_VIEW);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
+ Date date = new Date();
+ SimpleDateFormat simpleDateformat=new SimpleDateFormat("yyyy");
+
+ StringBuffer html = new StringBuffer();
+ html.append("data:text/*,<html><body>");
+ html.append(getResources().getString(R.string.about_display_1));
+ html.append("<br/><br/>");
+ html.append(getResources().getString(R.string.about_display_2));
+ html.append(": <a href=http://openlp.org/>OpenLP</a>");
+ html.append("<br/><br/>");
+ html.append(getResources().getString(R.string.about_display_3));
+ html.append(" © 2004-");
+ html.append(simpleDateformat.format(date));
+ html.append(" Raoul Snyman");
+ html.append("<br/><br/>");
+ html.append(getResources().getString(R.string.about_display_4));
+ html.append("© 2004-");
+ html.append(simpleDateformat.format(date));
+ html.append(" Tim Bentleydol, Johan Mynhardt, Samuel Sjöbergsson");
+ html.append("<br/><p>");
+ html.append(getResources().getString(R.string.about_display_5));
+ html.append("<p>");
+ html.append(getResources().getString(R.string.about_display_6));
+ html.append("</body></html>");
+
+ intent.setData(Uri.parse(html.toString()));
}
-
+
@Override
public void onDestroy() {
super.onDestroy();
=== modified file 'src/org/openlp/android/service/ApiCallIntent.java'
--- src/org/openlp/android/service/ApiCallIntent.java 2012-05-06 15:53:56 +0000
+++ src/org/openlp/android/service/ApiCallIntent.java 2012-05-13 08:14:19 +0000
@@ -34,8 +34,8 @@
import java.net.URISyntaxException;
/**
- * The purpose of this class is to provide a service that is separate from the UI, and assist in fetching informatin from
- * a server.
+ * The purpose of this class is to provide a service that is separate from the UI, and assist in fetching information
+ * from an OpenLP server.
*/
public class ApiCallIntent extends IntentService implements SearchService {
public static final String API_CALL_RECEIVE =