… | |
… | |
101 | {
|
101 | {
|
102 | if ((System.currentTimeMillis() - this.bubble_showing_since) > bubble_max_showing_timespan)
|
102 | if ((System.currentTimeMillis() - this.bubble_showing_since) > bubble_max_showing_timespan)
|
103 | {
|
103 | {
|
104 | //Log.e("Navit", "BubbleThread: bubble displaying too long, hide it");
|
104 | //Log.e("Navit", "BubbleThread: bubble displaying too long, hide it");
|
105 | // with invalidate we call the onDraw() function, that will take care of it
|
105 | // with invalidate we call the onDraw() function, that will take care of it
|
|
|
106 | //System.out.println("invalidate 001");
|
106 | this.a_overlay.postInvalidate();
|
107 | this.a_overlay.postInvalidate();
|
107 | this.running = false;
|
108 | this.running = false;
|
108 | }
|
109 | }
|
109 | else
|
110 | else
|
110 | {
|
111 | {
|
111 | try
|
112 | try
|
112 | {
|
113 | {
|
113 | Thread.sleep(50);
|
114 | Thread.sleep(280);
|
114 | }
|
115 | }
|
115 | catch (InterruptedException e)
|
116 | catch (InterruptedException e)
|
116 | {
|
117 | {
|
117 | // e.printStackTrace();
|
118 | // e.printStackTrace();
|
118 | }
|
119 | }
|
… | |
… | |
136 | super(context);
|
137 | super(context);
|
137 | }
|
138 | }
|
138 |
|
139 |
|
139 | public void show_bubble()
|
140 | public void show_bubble()
|
140 | {
|
141 | {
|
141 | //Log.e("Navit", "NavitAndroidOverlay -> show_bubble");
|
142 | //System.out.println("NavitAndroidOverlay -> show_bubble");
|
142 | if (!this.draw_bubble)
|
143 | if (!this.draw_bubble)
|
143 | {
|
144 | {
|
144 | confirmed_bubble = false;
|
145 | confirmed_bubble = false;
|
145 | this.draw_bubble = true;
|
146 | this.draw_bubble = true;
|
146 | this.bubble_showing_since = System.currentTimeMillis();
|
147 | this.bubble_showing_since = System.currentTimeMillis();
|
… | |
… | |
235 | {
|
236 | {
|
236 | // bubble touched to confirm destination
|
237 | // bubble touched to confirm destination
|
237 | confirmed_bubble = true;
|
238 | confirmed_bubble = true;
|
238 | confirmed_bubble_part = 0;
|
239 | confirmed_bubble_part = 0;
|
239 | // draw confirmed bubble
|
240 | // draw confirmed bubble
|
|
|
241 | //System.out.println("invalidate 002");
|
240 | this.postInvalidate();
|
242 | this.postInvalidate();
|
241 | String dest_name = "Point on Screen";
|
243 | String dest_name = "Point on Screen";
|
242 |
|
244 |
|
243 | // remeber recent dest.
|
245 | // remeber recent dest.
|
244 | try
|
246 | try
|
… | |
… | |
296 | {
|
298 | {
|
297 | // bubble touched to confirm destination
|
299 | // bubble touched to confirm destination
|
298 | confirmed_bubble = true;
|
300 | confirmed_bubble = true;
|
299 | confirmed_bubble_part = 1;
|
301 | confirmed_bubble_part = 1;
|
300 | // draw confirmed bubble
|
302 | // draw confirmed bubble
|
|
|
303 | //System.out.println("invalidate 003");
|
301 | this.postInvalidate();
|
304 | this.postInvalidate();
|
302 |
|
305 |
|
303 | // whats here?
|
306 | // whats here?
|
304 | String item_dump_pretty = NavitGraphics.CallbackGeoCalc(10, this.bubble_001.x, this.bubble_001.y);
|
307 | String item_dump_pretty = NavitGraphics.CallbackGeoCalc(10, this.bubble_001.x, this.bubble_001.y);
|
305 | try
|
308 | try
|
… | |
… | |
374 | {
|
377 | {
|
375 | if (NavitGraphics.in_map)
|
378 | if (NavitGraphics.in_map)
|
376 | {
|
379 | {
|
377 | // toggle follow mode
|
380 | // toggle follow mode
|
378 | Navit.toggle_follow_button();
|
381 | Navit.toggle_follow_button();
|
|
|
382 | //System.out.println("invalidate 004");
|
379 | this.postInvalidate();
|
383 | this.postInvalidate();
|
380 | // consume the event
|
384 | // consume the event
|
381 | return true;
|
385 | return true;
|
382 | }
|
386 | }
|
383 | }
|
387 | }
|
… | |
… | |
423 | {
|
427 | {
|
424 | try
|
428 | try
|
425 | {
|
429 | {
|
426 | if (overlay_draw_thread1 == null)
|
430 | if (overlay_draw_thread1 == null)
|
427 | {
|
431 | {
|
428 | overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
432 | //overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
429 | overlay_draw_thread1.start();
|
433 | //overlay_draw_thread1.start();
|
430 | }
|
434 | }
|
431 | }
|
435 | }
|
432 | catch (Exception e)
|
436 | catch (Exception e)
|
433 | {
|
437 | {
|
434 | overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
438 | //overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
435 | overlay_draw_thread1.start();
|
439 | //overlay_draw_thread1.start();
|
436 | }
|
440 | }
|
437 |
|
441 |
|
438 | // System.out.println("ZZZZZZZZ O.11");
|
442 | // System.out.println("ZZZZZZZZ O.11");
|
439 | // //if (NavitGraphics.wait_for_redraw_map == true)
|
443 | // //if (NavitGraphics.wait_for_redraw_map == true)
|
440 | // {
|
444 | // {
|
… | |
… | |
453 | // {
|
457 | // {
|
454 | // e.printStackTrace();
|
458 | // e.printStackTrace();
|
455 | // }
|
459 | // }
|
456 | // }
|
460 | // }
|
457 | NavitGraphics.wait_for_redraw_map = true;
|
461 | NavitGraphics.wait_for_redraw_map = true;
|
|
|
462 | //System.out.println("invalidate 005");
|
458 | this.invalidate();
|
463 | this.invalidate();
|
459 | //System.out.println("wait_for_redraw_map=true o1");
|
464 | //System.out.println("wait_for_redraw_map=true o1");
|
460 | //Log.e("NavitGraphics", "wait_for_redraw_map=true o1");
|
465 | //Log.e("NavitGraphics", "wait_for_redraw_map=true o1");
|
461 | // zoom in
|
466 | // zoom in
|
462 | try
|
467 | try
|
… | |
… | |
482 | {
|
487 | {
|
483 | try
|
488 | try
|
484 | {
|
489 | {
|
485 | if (overlay_draw_thread1 == null)
|
490 | if (overlay_draw_thread1 == null)
|
486 | {
|
491 | {
|
487 | overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
492 | //overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
488 | overlay_draw_thread1.start();
|
493 | //overlay_draw_thread1.start();
|
489 | }
|
494 | }
|
490 | }
|
495 | }
|
491 | catch (Exception e)
|
496 | catch (Exception e)
|
492 | {
|
497 | {
|
493 | overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
498 | //overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
494 | overlay_draw_thread1.start();
|
499 | //overlay_draw_thread1.start();
|
495 | }
|
500 | }
|
496 |
|
501 |
|
497 | // System.out.println("ZZZZZZZZ O.22");
|
502 | // System.out.println("ZZZZZZZZ O.22");
|
498 | // if (NavitGraphics.wait_for_redraw_map == true)
|
503 | // if (NavitGraphics.wait_for_redraw_map == true)
|
499 | // {
|
504 | // {
|
… | |
… | |
515 | // }
|
520 | // }
|
516 |
|
521 |
|
517 | try
|
522 | try
|
518 | {
|
523 | {
|
519 | NavitGraphics.wait_for_redraw_map = true;
|
524 | NavitGraphics.wait_for_redraw_map = true;
|
|
|
525 | //System.out.println("invalidate 006");
|
520 | this.invalidate();
|
526 | this.invalidate();
|
521 | //System.out.println("wait_for_redraw_map=true o2");
|
527 | //System.out.println("wait_for_redraw_map=true o2");
|
522 | //Log.e("NavitGraphics", "wait_for_redraw_map=true o2");
|
528 | //Log.e("NavitGraphics", "wait_for_redraw_map=true o2");
|
523 | // zoom out
|
529 | // zoom out
|
524 |
|
530 |
|
… | |
… | |
541 | {
|
547 | {
|
542 | try
|
548 | try
|
543 | {
|
549 | {
|
544 | if (overlay_draw_thread1 == null)
|
550 | if (overlay_draw_thread1 == null)
|
545 | {
|
551 | {
|
546 | overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
552 | //overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
547 | overlay_draw_thread1.start();
|
553 | //overlay_draw_thread1.start();
|
548 | }
|
554 | }
|
549 | }
|
555 | }
|
550 | catch (Exception e)
|
556 | catch (Exception e)
|
551 | {
|
557 | {
|
552 | overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
558 | //overlay_draw_thread1 = new NavitGraphics.OverlayDrawThread();
|
553 | overlay_draw_thread1.start();
|
559 | //overlay_draw_thread1.start();
|
554 | }
|
560 | }
|
555 | }
|
561 | }
|
556 | }
|
562 | }
|
557 |
|
563 |
|
558 | // test if we touched the grey rectangle
|
564 | // test if we touched the grey rectangle
|
… | |
… | |
817 | }
|
823 | }
|
818 |
|
824 |
|
819 | if (NavitGraphics.in_map)
|
825 | if (NavitGraphics.in_map)
|
820 | {
|
826 | {
|
821 | //Log.e("NavitGraphics", "NavitAndroidOverlay -> draw2");
|
827 | //Log.e("NavitGraphics", "NavitAndroidOverlay -> draw2");
|
822 | if (NavitGraphics.wait_for_redraw_map)
|
828 | //if (NavitGraphics.wait_for_redraw_map)
|
823 | {
|
829 | //{
|
824 | //Log.e("NavitGraphics", "NavitAndroidOverlay -> draw wait rect");
|
830 | // //Log.e("NavitGraphics", "NavitAndroidOverlay -> draw wait rect");
|
825 | Paint paint = new Paint(0);
|
831 | // Paint paint = new Paint(0);
|
826 | paint.setAntiAlias(true);
|
832 | // paint.setAntiAlias(true);
|
827 | paint.setStyle(Style.FILL);
|
833 | // paint.setStyle(Style.FILL);
|
828 | paint.setColor(Color.LTGRAY);
|
834 | // paint.setColor(Color.LTGRAY);
|
829 | paint.setAlpha(70);
|
835 | // paint.setAlpha(70);
|
830 |
|
836 | //
|
831 | RectF r1 = new RectF(20 * draw_factor, 20 * draw_factor, this.mCanvasWidth - 20 * draw_factor, this.mCanvasHeight - 20 * draw_factor);
|
837 | // RectF r1 = new RectF(20 * draw_factor, 20 * draw_factor, this.mCanvasWidth - 20 * draw_factor, this.mCanvasHeight - 20 * draw_factor);
|
832 | c.drawRoundRect(r1, 20, 20, paint);
|
838 | // c.drawRoundRect(r1, 20, 20, paint);
|
833 | paint.setColor(Color.parseColor("#888888"));
|
839 | // paint.setColor(Color.parseColor("#888888"));
|
834 | paint.setAlpha(230);
|
840 | // paint.setAlpha(230);
|
835 | paint.setTextAlign(Paint.Align.CENTER);
|
841 | // paint.setTextAlign(Paint.Align.CENTER);
|
836 | paint.setStrokeWidth(2);
|
842 | // paint.setStrokeWidth(2);
|
837 | paint.setTextSize(30);
|
843 | // paint.setTextSize(30);
|
838 | c.drawText(Navit.get_text("wait ..."), this.mCanvasWidth / 2, this.mCanvasHeight / 2, paint); //TRANS
|
844 | // c.drawText(Navit.get_text("wait ..."), this.mCanvasWidth / 2, this.mCanvasHeight / 2, paint); //TRANS
|
839 | }
|
845 | //}
|
840 | }
|
846 | }
|
841 |
|
847 |
|
842 | if (Navit.PREF_item_dump)
|
848 | if (Navit.PREF_item_dump)
|
843 | {
|
849 | {
|
844 | if (!Navit.debug_item_dump.equals(""))
|
850 | if (!Navit.debug_item_dump.equals(""))
|