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:
parent
3f5be92cc3
commit
1a4db33328
@ -8,4 +8,4 @@
|
|||||||
# project structure.
|
# project structure.
|
||||||
|
|
||||||
# Project target.
|
# Project target.
|
||||||
target=Google Inc.:Google APIs:8
|
target=Google Inc.:Google APIs:11
|
||||||
|
@ -1,12 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
<PreferenceCategory android:title="Connection Settings">
|
||||||
<CheckBoxPreference android:title="@string/preference_checkbox_autoconnect" android:key="autoconnect" />
|
<CheckBoxPreference android:title="@string/preference_checkbox_autoconnect"
|
||||||
<ListPreference
|
android:key="autoconnect" />
|
||||||
android:title="@string/preference_checkbox_connection_type"
|
<ListPreference android:title="@string/preference_checkbox_connection_type"
|
||||||
android:key="connection_type"
|
android:key="connection_type" android:summary="@string/preference_connection_method_summary"
|
||||||
android:summary="@string/preference_connection_method_summary"
|
android:defaultValue="None" android:entries="@array/connectTypeArray"
|
||||||
android:defaultValue="None"
|
android:entryValues="@array/connectTypeValues" />
|
||||||
android:entries="@array/connectTypeArray"
|
<EditTextPreference android:name="ip_address"
|
||||||
android:entryValues="@array/connectTypeValues" />
|
android:summary="Enter a TCP/IP address here"
|
||||||
|
android:defaultValue="192.168.0.1" android:title="IP address:"
|
||||||
|
android:key="editTextPref" />
|
||||||
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@ -2,11 +2,34 @@ package org.openpilot.androidgcs;
|
|||||||
|
|
||||||
import android.appwidget.AppWidgetManager;
|
import android.appwidget.AppWidgetManager;
|
||||||
import android.appwidget.AppWidgetProvider;
|
import android.appwidget.AppWidgetProvider;
|
||||||
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.widget.RemoteViews;
|
import android.widget.RemoteViews;
|
||||||
|
|
||||||
public class TelemetryWidget extends AppWidgetProvider {
|
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) {
|
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
|
||||||
final int N = appWidgetIds.length;
|
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
|
// 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);
|
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
|
// Tell the AppWidgetManager to perform an update on the current App Widget
|
||||||
appWidgetManager.updateAppWidget(appWidgetId, views);
|
appWidgetManager.updateAppWidget(appWidgetId, views);
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
package org.openpilot.uavtalk.uavobjects;
|
package org.openpilot.uavtalk.uavobjects;
|
||||||
|
|
||||||
import org.openpilot.uavtalk.uavobjects.*;
|
//import org.openpilot.uavtalk.uavobjects.*;
|
||||||
import org.openpilot.uavtalk.UAVObjectManager;
|
import org.openpilot.uavtalk.UAVObjectManager;
|
||||||
|
|
||||||
public class UAVObjectsInitialize {
|
public class UAVObjectsInitialize {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user