1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Few tweaks and suppress some warnings

This commit is contained in:
James Cotton 2011-03-22 21:59:36 -05:00
parent 3f5be92cc3
commit 1a4db33328
4 changed files with 38 additions and 13 deletions

View File

@ -8,4 +8,4 @@
# project structure.
# Project target.
target=Google Inc.:Google APIs:8
target=Google Inc.:Google APIs:11

View File

@ -1,12 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference android:title="@string/preference_checkbox_autoconnect" android:key="autoconnect" />
<ListPreference
android:title="@string/preference_checkbox_connection_type"
android:key="connection_type"
android:summary="@string/preference_connection_method_summary"
android:defaultValue="None"
android:entries="@array/connectTypeArray"
android:entryValues="@array/connectTypeValues" />
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="Connection Settings">
<CheckBoxPreference android:title="@string/preference_checkbox_autoconnect"
android:key="autoconnect" />
<ListPreference android:title="@string/preference_checkbox_connection_type"
android:key="connection_type" android:summary="@string/preference_connection_method_summary"
android:defaultValue="None" android:entries="@array/connectTypeArray"
android:entryValues="@array/connectTypeValues" />
<EditTextPreference android:name="ip_address"
android:summary="Enter a TCP/IP address here"
android:defaultValue="192.168.0.1" android:title="IP address:"
android:key="editTextPref" />
</PreferenceCategory>
</PreferenceScreen>

View File

@ -2,11 +2,34 @@ package org.openpilot.androidgcs;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.widget.RemoteViews;
public class TelemetryWidget extends AppWidgetProvider {
@Override
public void onReceive(Context context, Intent intent) {
if(intent.getAction().equals(OPTelemetryService.INTENT_ACTION_CONNECTED)) {
changeStatus(context, true);
}
if(intent.getAction().equals(OPTelemetryService.INTENT_ACTION_DISCONNECTED)) {
changeStatus(context, false);
}
super.onReceive(context, intent);
}
public void changeStatus(Context context, boolean status) {
RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.telemetry_widget);
updateViews.setTextViewText(R.id.telemetryWidgetStatus, "Connection status: " + status);
ComponentName thisWidget = new ComponentName(context, TelemetryWidget.class);
AppWidgetManager manager = AppWidgetManager.getInstance(context);
manager.updateAppWidget(thisWidget, updateViews);
}
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
final int N = appWidgetIds.length;
@ -16,7 +39,6 @@ public class TelemetryWidget extends AppWidgetProvider {
// Get the layout for the App Widget and attach an on-click listener to the button
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.telemetry_widget);
//views.setOnClickPendingIntent(R.id.button, pendingIntent);
// Tell the AppWidgetManager to perform an update on the current App Widget
appWidgetManager.updateAppWidget(appWidgetId, views);

View File

@ -28,7 +28,7 @@
package org.openpilot.uavtalk.uavobjects;
import org.openpilot.uavtalk.uavobjects.*;
//import org.openpilot.uavtalk.uavobjects.*;
import org.openpilot.uavtalk.UAVObjectManager;
public class UAVObjectsInitialize {