aboutsummaryrefslogtreecommitdiffstats
path: root/src
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 /src
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)
Diffstat (limited to 'src')
-rw-r--r--src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java24
1 files changed, 23 insertions, 1 deletions
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);