aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2010-11-03 21:48:10 +0100
committerHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2010-11-07 21:05:05 +0100
commitd6fcb7c61febd4e19469053de562e23f08934e65 (patch)
treed9ec588c35d2142fa0daf7c8d02986a305a3e09d
parent023e492275bd1c96d595b5d57859861e4f3fda6e (diff)
downloadBlueGPS-d6fcb7c61febd4e19469053de562e23f08934e65.zip
BlueGPS-d6fcb7c61febd4e19469053de562e23f08934e65.tar.gz
BlueGPS-d6fcb7c61febd4e19469053de562e23f08934e65.tar.bz2
first try to add an about window
-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.java21
3 files changed, 123 insertions, 0 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 b58afed..060f8c2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -49,4 +49,27 @@
<string name="foreground_service_started_notification_title">BlueGps</string>
<string name="foreground_gps_provider_started_notification">BlueGps service started</string>
<string name="foreground_nmea_recording_started_notification">BlueGps NMEA recording service started</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 08d2c8c..1c1eac3 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.
@@ -106,6 +109,23 @@ public class BluetoothGpsActivity extends PreferenceActivity implements OnPrefer
super.onDestroy();
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) {
@@ -116,6 +136,7 @@ public class BluetoothGpsActivity extends PreferenceActivity implements OnPrefer
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
String key) {
+ displayAboutDialog();
if (BluetoothGpsProviderService.PREF_START_GPS_PROVIDER.equals(key)){
boolean val = false;
if (val = sharedPreferences.getBoolean(key, false)){