1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

AndroidGCS: Get rid of remaining warnings

This commit is contained in:
James Cotton 2012-08-06 01:26:10 -05:00
parent 7a214dc6cb
commit 13392d0f20
9 changed files with 10 additions and 36 deletions

View File

@ -82,16 +82,16 @@ public class DockPanel extends LinearLayout {
if (position == DockPosition.LEFT || position == DockPosition.RIGHT) { if (position == DockPosition.LEFT || position == DockPosition.RIGHT) {
handleContainer.setLayoutParams(new LayoutParams( handleContainer.setLayoutParams(new LayoutParams(
android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT,
android.view.ViewGroup.LayoutParams.FILL_PARENT, 1)); android.view.ViewGroup.LayoutParams.MATCH_PARENT, 1));
contentPlaceHolder.setLayoutParams(new LayoutParams( contentPlaceHolder.setLayoutParams(new LayoutParams(
android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT,
android.view.ViewGroup.LayoutParams.FILL_PARENT, 1)); android.view.ViewGroup.LayoutParams.MATCH_PARENT, 1));
} else { } else {
handleContainer.setLayoutParams(new LayoutParams( handleContainer.setLayoutParams(new LayoutParams(
android.view.ViewGroup.LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT,
android.view.ViewGroup.LayoutParams.WRAP_CONTENT, 1)); android.view.ViewGroup.LayoutParams.WRAP_CONTENT, 1));
contentPlaceHolder.setLayoutParams(new LayoutParams( contentPlaceHolder.setLayoutParams(new LayoutParams(
android.view.ViewGroup.LayoutParams.FILL_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT,
android.view.ViewGroup.LayoutParams.WRAP_CONTENT, 1)); android.view.ViewGroup.LayoutParams.WRAP_CONTENT, 1));
} }

View File

@ -4,8 +4,8 @@ import android.content.Context;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Paint; import android.graphics.Paint;
import android.os.Handler;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.FloatMath;
import android.util.Log; import android.util.Log;
import android.view.HapticFeedbackConstants; import android.view.HapticFeedbackConstants;
import android.view.MotionEvent; import android.view.MotionEvent;
@ -70,8 +70,8 @@ public class JoystickView extends View {
private int cX, cY; private int cX, cY;
//Size of the view in view coordinates //Size of the view in view coordinates
private int dimX, dimY; private int dimX;
//Cartesian coordinates of last touch point - joystick center is (0,0) //Cartesian coordinates of last touch point - joystick center is (0,0)
private int cartX, cartY; private int cartX, cartY;
@ -242,8 +242,6 @@ public class JoystickView extends View {
int d = Math.min(getMeasuredWidth(), getMeasuredHeight()); int d = Math.min(getMeasuredWidth(), getMeasuredHeight());
dimX = d; dimX = d;
dimY = d;
cX = d / 2; cX = d / 2;
cY = d / 2; cY = d / 2;
@ -315,7 +313,7 @@ public class JoystickView extends View {
private void constrainCircle() { private void constrainCircle() {
float diffX = touchX; float diffX = touchX;
float diffY = touchY; float diffY = touchY;
double radial = Math.sqrt((diffX*diffX) + (diffY*diffY)); double radial = FloatMath.sqrt((diffX*diffX) + (diffY*diffY));
if ( radial > movementRadius ) { if ( radial > movementRadius ) {
touchX = (int)((diffX / radial) * movementRadius); touchX = (int)((diffX / radial) * movementRadius);
touchY = (int)((diffY / radial) * movementRadius); touchY = (int)((diffY / radial) * movementRadius);

View File

@ -3,10 +3,7 @@ package com.MobileAnarchy.Android.Widgets.TilesLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import android.R;
import android.content.Context; import android.content.Context;
import android.graphics.Color;
import android.os.Handler;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Log; import android.util.Log;
import android.view.Gravity; import android.view.Gravity;
@ -108,7 +105,7 @@ public class TilesLayout extends FrameLayout {
private void Init(AttributeSet attrs) { private void Init(AttributeSet attrs) {
animatedTransitionDuration = 750; animatedTransitionDuration = 750;
tileBackgroundResourceId = R.drawable.edit_text; tileBackgroundResourceId = android.R.drawable.edit_text;
tiles = new ArrayList<SingleTileLayout>(); tiles = new ArrayList<SingleTileLayout>();
} }

View File

@ -13,14 +13,12 @@ public class TilesLayoutPreset {
// ========================================= // =========================================
private List<TilePosition> _positions; private List<TilePosition> _positions;
private String _presetName;
// ========================================= // =========================================
// Constructors // Constructors
// ========================================= // =========================================
public TilesLayoutPreset(String name) { public TilesLayoutPreset(String name) {
_presetName = name;
_positions = new LinkedList<TilePosition>(); _positions = new LinkedList<TilePosition>();
} }

View File

@ -18,8 +18,6 @@ public class UAVTalk extends Observable {
private Thread inputProcessingThread = null; private Thread inputProcessingThread = null;
private boolean streamFailed = false;
/** /**
* A reference to the thread for processing the incoming stream. Currently this method is ONLY * A reference to the thread for processing the incoming stream. Currently this method is ONLY
* used for unit testing * used for unit testing

View File

@ -10,8 +10,6 @@ import org.junit.Test;
import org.openpilot.uavtalk.uavobjects.ActuatorCommand; import org.openpilot.uavtalk.uavobjects.ActuatorCommand;
import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize; import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize;
import android.database.Observable;
public class DataObjectTest { public class DataObjectTest {
boolean succeed = false; boolean succeed = false;

View File

@ -1,7 +1,5 @@
package org.openpilot.uavtalk; package org.openpilot.uavtalk;
import static org.junit.Assert.*;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize; import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize;

View File

@ -4,14 +4,8 @@ import static org.junit.Assert.*;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.DatagramSocket;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.Socket; import java.net.Socket;
import java.nio.ByteBuffer;
import java.util.Observable; import java.util.Observable;
import java.util.Observer; import java.util.Observer;

View File

@ -3,17 +3,9 @@ package org.openpilot.uavtalk;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.DatagramSocket;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.Socket; import java.net.Socket;
import java.nio.ByteBuffer;
import java.util.Observable;
import java.util.Observer;
import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;
import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize; import org.openpilot.uavtalk.uavobjects.UAVObjectsInitialize;
import org.openpilot.uavtalk.UAVTalk; import org.openpilot.uavtalk.UAVTalk;
@ -53,6 +45,7 @@ public class TelemetryMonitorTest {
inputStream.start(); inputStream.start();
Telemetry tel = new Telemetry(talk, objMngr); Telemetry tel = new Telemetry(talk, objMngr);
@SuppressWarnings("unused")
TelemetryMonitor mon = new TelemetryMonitor(objMngr,tel); TelemetryMonitor mon = new TelemetryMonitor(objMngr,tel);
Thread.sleep(10000); Thread.sleep(10000);