\r
public class SearchResultsThread extends Thread\r
{\r
- private Boolean running;\r
Handler mHandler;\r
int my_dialog_num;\r
\r
SearchResultsThread(Handler h, int dialog_num)\r
{\r
- this.running = true;\r
this.mHandler = h;\r
this.my_dialog_num = dialog_num;\r
Log.e("Navit", "SearchResultsThread created");\r
}\r
\r
- public void stop_me()\r
- {\r
- this.running = false;\r
- }\r
-\r
public void run()\r
{\r
Log.e("Navit", "SearchResultsThread started");\r
Log.e("Navit", "onDismiss: search_results_wait");\r
dialog.dismiss();\r
dialog.cancel();\r
- searchresultsThread.stop_me();\r
}\r
};\r
search_results_wait.setOnDismissListener(mOnDismissListener3);\r
//Log.e("Navit", "NavitAndroidOverlay -> show_bubble");\r
if (!this.draw_bubble)\r
{\r
- this.confirmed_bubble = false;\r
+ NavitAndroidOverlay.confirmed_bubble = false;\r
this.draw_bubble = true;\r
this.bubble_showing_since = System.currentTimeMillis();\r
bubble_thread = new BubbleThread(this);\r
\r
public void hide_bubble()\r
{\r
- this.confirmed_bubble = false;\r
+ NavitAndroidOverlay.confirmed_bubble = false;\r
this.draw_bubble = false;\r
this.bubble_showing_since = 0L;\r
try\r
//Log.e("Navit", "NavitAndroidOverlay -> onTouchEvent");\r
super.onTouchEvent(event);\r
\r
- int action = event.getAction();\r
int x = (int) event.getX();\r
int y = (int) event.getY();\r
\r
- if ((this.draw_bubble) && (!this.confirmed_bubble))\r
+ if ((this.draw_bubble) && (!NavitAndroidOverlay.confirmed_bubble))\r
{\r
// bubble is showing, test if we touch it to confirm destination\r
float draw_factor = 1.0f;\r
if (box_rect.contains(x, y))\r
{\r
// bubble touched to confirm destination\r
- this.confirmed_bubble = true;\r
+ NavitAndroidOverlay.confirmed_bubble = true;\r
// draw confirmed bubble\r
this.postInvalidate();\r
\r
\r
if (this.draw_bubble)\r
{\r
- if ((System.currentTimeMillis() - this.bubble_showing_since) > this.bubble_max_showing_timespan)\r
+ if ((System.currentTimeMillis() - this.bubble_showing_since) > NavitAndroidOverlay.bubble_max_showing_timespan)\r
{\r
// bubble has been showing too log, hide it\r
this.hide_bubble();\r
int ry = (int) (20 / 1.5f * draw_factor);\r
c.drawRoundRect(box_rect, rx, ry, bubble_paint);\r
\r
- if (this.confirmed_bubble)\r
+ if (NavitAndroidOverlay.confirmed_bubble)\r
{\r
// filled red rect (for confirmed bubble)\r
//bubble_paint.setStyle(Style.FILL);\r
*/
package org.navitproject.navit;
-import android.app.Activity;
-import android.widget.TextView;
-import android.os.Bundle;
-import android.os.Debug;
-import android.os.Message;
-import android.os.Handler;
+import java.io.IOException;
+
import android.content.Context;
-import android.util.Log;
import android.hardware.Camera;
-import android.hardware.Camera.Parameters;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.PixelFormat;
+import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
-import java.io.IOException;
public class NavitGraphics
{
private NavitGraphics parent_graphics;
- private ArrayList overlays = new ArrayList();
+ private ArrayList<NavitGraphics> overlays = new ArrayList<NavitGraphics>();
int bitmap_w;
int bitmap_h;
int pos_x;
private long last_down_action = 0L;
private Boolean is_still_pressing;
private View v = null;
- private NavitAndroidOverlay n_overlay = null;
- private float prev_x;
- private float prev_y;
private float x;
private float y;
SensorThread(long last_touch, View v, NavitAndroidOverlay n_ov, float x, float y)
{
- this.prev_x = x;
- this.prev_y = y;
this.x = x;
this.y = y;
this.running = true;
- this.n_overlay = n_ov;
this.v = v;
this.is_still_pressing = true;
last_down_action = System.currentTimeMillis();
Log.e("NavitGraphics", "SensorThread created");
}
- public void down()
- {
- this.is_still_pressing = true;
- }
-
- // public void up()
- // {
- // this.is_still_pressing=false;
- // }
-
public void stop_me()
{
this.running = false;
{
// find the class, to get the method "do_longpress_action"
// and then call the method
- Class cls = this.v.getClass();
+ Class<? extends View> cls = this.v.getClass();
//Log.e("NavitGraphics", "c=" + String.valueOf(cls));
- Class partypes[] = new Class[2];
+ Class<?> partypes[] = new Class[2];
partypes[0] = Float.TYPE;
partypes[1] = Float.TYPE;
Method meth = cls.getMethod("do_longpress_action", partypes);
Object arglist[] = new Object[2];
arglist[0] = new Float(this.x);
arglist[1] = new Float(this.y);
- Object retobj = meth.invoke(methobj, arglist);
+ meth.invoke(methobj, arglist);
}
catch (Throwable e)
{
{
PointF touch_now2 = null;
PointF touch_start2 = null;
- PointF touch_prev2 = null;
- PointF touch_last_load_tiles2 = null;
//Log.e("NavitGraphics", "onTouchEvent");
super.onTouchEvent(event);
- int action = event.getAction();
int x = (int) event.getX();
int y = (int) event.getY();
this.touch_now.set(event.getX(), event.getY());
touch_now2 = touch_now;
touch_start2 = touch_start;
- touch_prev2 = touch_prev;
this.touch_prev.set(event.getX(), event.getY());
try
package org.navitproject.navit;
-import android.app.Activity;
-import android.content.Context;
-import android.graphics.*;
-import android.os.Bundle;
-import android.os.Debug;
-import android.view.*;
-import android.view.Window;
-import android.util.Log;
-import android.widget.RelativeLayout;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.FloatBuffer;
import java.util.ArrayList;
-import java.lang.String;
-import android.app.Activity;
-import android.content.Context;
-import android.hardware.Camera;
-import android.os.Bundle;
-import android.opengl.GLSurfaceView;
-import android.view.SurfaceHolder;
-import android.view.SurfaceView;
-import android.view.Window;
-import java.io.IOException;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
+
+import android.app.Activity;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.Rect;
+import android.opengl.GLSurfaceView;
import android.opengl.GLU;
-import java.nio.ByteBuffer;
-import java.nio.FloatBuffer;
-import java.nio.ByteOrder;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.widget.RelativeLayout;
if (busy) {
return;
}
- float[] square = new float[] { -0.25f, -0.25f, 0.0f,
- 0.25f, -0.25f, 0.0f,
- -0.25f, 0.25f, 0.0f,
- 0.25f, 0.25f, 0.0f };
gl.glClearColor(1.0f, 1.0f, 0.2f, 0.0f);
gl.glMatrixMode(GL10.GL_PROJECTION);
public class NavitGraphics2 {
private NavitGraphics2 parent_graphics;
- private ArrayList overlays=new ArrayList();
+ private ArrayList<NavitGraphics2> overlays=new ArrayList<NavitGraphics2>();
int bitmap_w;
int bitmap_h;
int pos_x;
*/
package org.navitproject.navit;
-import android.app.Activity;
-import android.widget.TextView;
-import android.os.Bundle;
-import android.os.Debug;
-import android.os.Message;
-import android.os.Handler;
import android.content.Context;
-import android.util.Log;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
-import android.hardware.SensorManager;
-import android.hardware.SensorListener;
import android.hardware.SensorEventListener;
+import android.hardware.SensorManager;
package org.navitproject.navit;
-import java.lang.Thread;
-import android.app.Activity;
-import android.widget.TextView;
-import android.os.Bundle;
-import android.os.Debug;
-import android.os.Message;
-import android.os.Handler;
-import android.content.Context;
import android.util.Log;
+
import com.google.tts.TTS;
package org.navitproject.navit;
-import java.lang.Thread;
-import android.app.Activity;
-import android.widget.TextView;
-import android.os.Bundle;
-import android.os.Debug;
-import android.os.Message;
-import android.os.Handler;
-import android.content.Context;
import android.content.Intent;
-import android.util.Log;
import android.speech.tts.TextToSpeech;
+import android.util.Log;
public class NavitSpeech2 implements TextToSpeech.OnInitListener, NavitActivityResult {
package org.navitproject.navit;
-import android.app.Activity;
-import android.widget.TextView;
-import android.os.Bundle;
-import android.os.Debug;
-import android.os.Message;
import android.os.Handler;
-import android.content.Context;
+import android.os.Message;
import android.util.Log;
package org.navitproject.navit;
-import android.app.Activity;
import android.content.Context;
-import android.graphics.*;
+import android.location.Criteria;
+import android.location.Location;
+import android.location.LocationListener;
+import android.location.LocationManager;
import android.os.Bundle;
-import android.os.Debug;
-import android.view.*;
import android.util.Log;
-import android.location.*;
public class NavitVehicle {
private LocationManager locationManager;
not so precise, but possible faster. The fast provider is
disabled when the precise provider gets its first fix. */
- // Selection criterias for the precise provider
+ // Selection criteria for the precise provider
Criteria highCriteria = new Criteria();
highCriteria.setAccuracy(Criteria.ACCURACY_FINE);
highCriteria.setAltitudeRequired(true);
highCriteria.setCostAllowed(true);
highCriteria.setPowerRequirement(Criteria.POWER_HIGH);
- // Selection criterias for the fast provider
+ // Selection criteria for the fast provider
Criteria lowCriteria = new Criteria();
lowCriteria.setAccuracy(Criteria.ACCURACY_COARSE);
lowCriteria.setAltitudeRequired(false);