kopia lustrzana https://github.com/ge0rg/aprsdroid
Merge branch 'master' into mapsforge
commit
2538225759
|
@ -2,7 +2,11 @@
|
|||
<resources>
|
||||
<style name="MapViewTheme"
|
||||
parent="@android:style/Theme.Holo.Light.DarkActionBar">
|
||||
<!--item name="android:windowActionBarOverlay">true</item>
|
||||
<item name="android:background">#64000000</item-->
|
||||
<item name="android:windowActionBarOverlay">true</item>
|
||||
<item name="android:actionBarStyle">@style/Map.ActionBar</item>
|
||||
</style>
|
||||
|
||||
<style name="Map.ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
|
||||
<item name="android:background">#a0000000</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -190,23 +190,25 @@ class AprsService extends Service {
|
|||
pos, status_spd + status_alt + " " + status, /* messaging = */ true))
|
||||
}
|
||||
|
||||
def sendPacket(packet : APRSPacket, status_postfix : String) = {
|
||||
try {
|
||||
def sendPacket(packet : APRSPacket, status_postfix : String) {
|
||||
scala.concurrent.ops.spawn {
|
||||
val status = try {
|
||||
val status = poster.update(packet)
|
||||
val full_status = status + status_postfix
|
||||
addPost(StorageDatabase.Post.TYPE_POST, full_status, packet.toString)
|
||||
full_status
|
||||
} catch {
|
||||
case e : Exception =>
|
||||
addPost(StorageDatabase.Post.TYPE_ERROR, "Error", e.getMessage())
|
||||
addPost(StorageDatabase.Post.TYPE_ERROR, "Error", e.toString())
|
||||
e.printStackTrace()
|
||||
e.getMessage()
|
||||
e.toString()
|
||||
}
|
||||
handler.post { sendPacketFinished(status) }
|
||||
}
|
||||
}
|
||||
def sendPacket(packet : APRSPacket) : String = sendPacket(packet, "")
|
||||
def sendPacket(packet : APRSPacket) { sendPacket(packet, "") }
|
||||
|
||||
def postLocation(location : Location) {
|
||||
val callssid = prefs.getCallSsid()
|
||||
var symbol = prefs.getString("symbol", "")
|
||||
if (symbol.length != 2)
|
||||
symbol = getString(R.string.default_symbol)
|
||||
|
@ -214,12 +216,15 @@ class AprsService extends Service {
|
|||
val packet = formatLoc(symbol, status, location)
|
||||
|
||||
Log.d(TAG, "packet: " + packet)
|
||||
val result = sendPacket(packet, " (±%dm)".format(location.getAccuracy.asInstanceOf[Int]))
|
||||
sendPacket(packet, " (±%dm)".format(location.getAccuracy.asInstanceOf[Int]))
|
||||
}
|
||||
|
||||
def sendPacketFinished(result : String) {
|
||||
if (singleShot) {
|
||||
singleShot = false
|
||||
stopSelf()
|
||||
} else {
|
||||
val message = "%s: %s".format(callssid, result)
|
||||
val message = "%s: %s".format(prefs.getCallSsid(), result)
|
||||
ServiceNotifier.instance.notifyPosition(this, prefs, message)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,12 @@
|
|||
protected void onPrepareDialogBuilder(android.app.AlertDialog.Builder builder) {
|
||||
// hook into the builder to refresh the list
|
||||
BluetoothAdapter bta = BluetoothAdapter.getDefaultAdapter();
|
||||
Set<BluetoothDevice> pairedDevices = bta.getBondedDevices();
|
||||
Set<BluetoothDevice> pairedDevices = (bta != null) ? bta.getBondedDevices() : null;
|
||||
if (pairedDevices == null) {
|
||||
super.onPrepareDialogBuilder(builder);
|
||||
return;
|
||||
}
|
||||
|
||||
CharSequence[] entries = new CharSequence[pairedDevices.size()];
|
||||
CharSequence[] entryValues = new CharSequence[pairedDevices.size()];
|
||||
int i = 0;
|
||||
|
|
|
@ -57,6 +57,8 @@ class MapAct extends MapActivity with UIHelper {
|
|||
// only make it default if not tracking
|
||||
if (targetcall == "")
|
||||
makeLaunchActivity("map")
|
||||
else
|
||||
setTitle(getString(R.string.app_map) + ": " + targetcall)
|
||||
setKeepScreenOn()
|
||||
setVolumeControls()
|
||||
reloadMapAndTheme()
|
||||
|
|
|
@ -192,7 +192,7 @@ class TcpUploader(service : AprsService, prefs : PrefsWrapper) extends AprsBacke
|
|||
|
||||
def update(packet : APRSPacket) : String = {
|
||||
if (socket != null && socket.isConnected()) {
|
||||
scala.concurrent.ops.spawn { tnc.writePacket(packet) }
|
||||
tnc.writePacket(packet)
|
||||
"TCP OK"
|
||||
} else "TCP disconnected"
|
||||
}
|
||||
|
|
11
xml2po.sh
11
xml2po.sh
|
@ -8,6 +8,7 @@ RES=res/values
|
|||
POT=$TRAN/$PACKAGE.pot
|
||||
PODIR=translations/$PACKAGE
|
||||
PO=$PODIR/$PACKAGE-
|
||||
CREDITS=res/values/translators.xml
|
||||
|
||||
download() {
|
||||
FN=launchpad-$(date +%F).tar.gz
|
||||
|
@ -38,13 +39,17 @@ translate_po2xml() {
|
|||
lang=${po##$PO}
|
||||
lang=${lang%%.po} # strip .po
|
||||
lang=${lang/_/-r} # fix up lang_Locale -> lang-rLocale
|
||||
echo $lang:
|
||||
dir=$RES-$lang
|
||||
# fix Java f'ups <http://developer.android.com/reference/java/util/Locale.html>
|
||||
[ "$lang" == "he" ] && dir=$RES-iw
|
||||
[ "$lang" == "id" ] && dir=$RES-in
|
||||
[ "$lang" == "yi" ] && dir=$RES-ji
|
||||
echo $lang: $dir
|
||||
mkdir -p $dir
|
||||
xml2po -a -l $lang -p $po $RES/strings.xml | sed "s/'/\\\\'/g" > $dir/strings.xml
|
||||
done
|
||||
sed -i 's/\\\\'\''/\\'\''/g' res/values-*/strings.xml
|
||||
{
|
||||
[ -f $CREDITS ] && {
|
||||
cat <<EOF
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- AUTOGENERATED BY xml2po.sh! DO NOT CHANGE MANUALLY! -->
|
||||
|
@ -55,7 +60,7 @@ $(cat translations/$PACKAGE/$PACKAGE-*.po | awk -F ': | <' '/Last-Translator:/ {
|
|||
</string>
|
||||
</resources>
|
||||
EOF
|
||||
} > res/values/translators.xml
|
||||
} > $CREDITS
|
||||
}
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue