aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2010-12-03 02:01:17 +0100
committerHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2010-12-03 02:01:17 +0100
commita904b9153bc5b34a6b5491b885d93fdb5b0179b0 (patch)
tree5b4187c365a3d68711fd2580c54d10dd01d472af
parent17f8164913422da101be1c667207608c5c6c1003 (diff)
downloadBlueGPS-a904b9153bc5b34a6b5491b885d93fdb5b0179b0.zip
BlueGPS-a904b9153bc5b34a6b5491b885d93fdb5b0179b0.tar.gz
BlueGPS-a904b9153bc5b34a6b5491b885d93fdb5b0179b0.tar.bz2
first try to add an about window (merge from 1.0.x dev branch)
-rw-r--r--res/layout/about.xml79
-rw-r--r--res/values/strings.xml23
-rw-r--r--src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java24
3 files changed, 125 insertions, 1 deletions
diff --git a/res/layout/about.xml b/res/layout/about.xml
new file mode 100644
index 0000000..f74e710
--- /dev/null
+++ b/res/layout/about.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ >
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ >
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="16sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:text="@string/about_version"
+ />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="16sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:text="@string/versionName"
+ />
+ </LinearLayout>
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16sp"
+ android:textSize="16sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:autoLink="web"
+ android:text="@string/about_copyright"
+ />
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16sp"
+ android:textSize="16sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:autoLink="web"
+ android:text="@string/about_app_desc"
+ />
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16sp"
+ android:textSize="16sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:autoLink="web"
+ android:text="@string/about_license"
+ />
+ <TextView
+ android:id="@+id/about_sources"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16sp"
+ android:textSize="16sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:autoLink="web"
+ android:text="@string/about_sources"
+ /><!--
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16sp"
+ android:textSize="16sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:autoLink="web"
+ android:text="@string/about"
+ />
+ --></LinearLayout>
+</ScrollView> \ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2b2e2d1..598677d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -70,4 +70,27 @@
</plurals>
<string name="service_closed_because_connection_problem_notification_title">BlueGps stopped</string>
<string name="service_closed_because_connection_problem_notification">"Reason: %s"</string>
+
+ <string name="aboutTitle">About</string>
+ <string name="about_version">BlueGPS4Droid version </string>
+ <string name="about_copyright">Copyright (C) 2010 Herbert von Broeuschmeul
+ \n\nCopyright (C) 2010 BluetoothGPS4Droid Project
+ </string>
+ <string name="about_app_desc">Bluetooth GPS for Android is an application
+ for using an external bluetooth GPS on Android devices.
+ </string>
+ <string name="about_license">BluetoothGPS4Droid (BlueGPS4Droid) is open source software
+ distributed free of charge under the terms of the <b>GNU General Public License</b>.
+ </string>
+ <string name="about_sources">The source code is available from the project\'s Git repository:
+ http://sourceforge.net/p/bluegps4droid
+ </string>
+ <string name="about">Copyright (C) 2010 Herbert von Broeuschmeul
+ \n\nCopyright (C) 2010 BluetoothGPS4Droid Project
+ \n\nBluetooth GPS for Android is an application for using an external bluetooth GPS on Android devices.
+ \n\nBluetoothGPS4Droid (BlueGPS4Droid) is open source software distributed free of charge under the terms of
+ the <b>GNU General Public License</b>.
+ \n\nThe source code is available from the project\'s Git repository:
+ http://sourceforge.net/p/bluegps4droid
+ </string>
</resources>
diff --git a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
index 742a3d4..76782fc 100644
--- a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
+++ b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
@@ -22,6 +22,7 @@ package org.broeuschmeul.android.gps.bluetooth.provider;
import java.util.Set;
+import android.app.AlertDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
@@ -35,6 +36,8 @@ import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.preference.Preference.OnPreferenceChangeListener;
import android.util.Log;
+import android.view.View;
+import android.widget.TextView;
/**
* A PreferenceActivity Class used to configure, start and stop the NMEA tracker service.
@@ -128,6 +131,23 @@ public class BluetoothGpsActivity extends PreferenceActivity implements OnPrefer
sharedPref.unregisterOnSharedPreferenceChangeListener(this);
}
+ private void displayAboutDialog(){
+ View messageView = getLayoutInflater().inflate(R.layout.about, null, false);
+ // When linking text, force to always use default color. This works
+ // around a pressed color state bug.
+ TextView textView = (TextView) messageView.findViewById(R.id.about_sources);
+ int defaultColor = textView.getTextColors().getDefaultColor();
+ textView.setTextColor(defaultColor);
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle(R.string.aboutTitle);
+ builder.setView(messageView);
+
+// CharSequence styledText = Html.fromHtml(getString(R.string.about));
+// builder.setMessage(R.string.about);
+// builder.setMessage(styledText);
+ builder.show();
+ }
+
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
// TODO Auto-generated method stub
@@ -135,7 +155,9 @@ public class BluetoothGpsActivity extends PreferenceActivity implements OnPrefer
}
@Override
- public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
+ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
+ String key) {
+ displayAboutDialog();
if (BluetoothGpsProviderService.PREF_START_GPS_PROVIDER.equals(key)){
boolean val = sharedPreferences.getBoolean(key, false);
CheckBoxPreference pref = (CheckBoxPreference)findPreference(key);