… | |
… | |
255 | }
|
255 | }
|
256 |
|
256 |
|
257 | @Override
|
257 | @Override
|
258 | protected void onCreate(Bundle savedInstanceState)
|
258 | protected void onCreate(Bundle savedInstanceState)
|
259 | {
|
259 | {
|
260 | Navit.applySharedTheme(this, Navit.PREF_current_theme);
|
260 | Navit.applySharedTheme(this, Navit.p.PREF_current_theme);
|
261 |
|
261 |
|
262 | super.onCreate(savedInstanceState);
|
262 | super.onCreate(savedInstanceState);
|
263 |
|
263 |
|
264 | // Override how this activity is animated into view
|
264 | // Override how this activity is animated into view
|
265 | // The new activity is pulled in from the left and the current activity is kept still
|
265 | // The new activity is pulled in from the left and the current activity is kept still
|
… | |
… | |
278 | // }
|
278 | // }
|
279 |
|
279 |
|
280 | try
|
280 | try
|
281 | {
|
281 | {
|
282 | EditTextPreference about_text_pref = ((EditTextPreference) findPreference("about_edit_text"));
|
282 | EditTextPreference about_text_pref = ((EditTextPreference) findPreference("about_edit_text"));
|
|
|
283 |
|
|
|
284 | if (Navit.FDBL)
|
|
|
285 | {
|
|
|
286 | about_text_pref.setSummary("v" + Navit.NavitAppVersion_string + "-" + Navit.VERSION_TEXT_LONG_INC_REV+":FD");
|
|
|
287 | }
|
|
|
288 | else
|
|
|
289 | {
|
283 | about_text_pref.setSummary("v" + Navit.NavitAppVersion_string + "-" + Navit.VERSION_TEXT_LONG_INC_REV);
|
290 | about_text_pref.setSummary("v" + Navit.NavitAppVersion_string + "-" + Navit.VERSION_TEXT_LONG_INC_REV);
|
|
|
291 | }
|
284 | }
|
292 | }
|
285 | catch (Exception e)
|
293 | catch (Exception e)
|
286 | {
|
294 | {
|
287 | e.printStackTrace();
|
295 | e.printStackTrace();
|
288 | }
|
296 | }
|
… | |
… | |
308 | road_prof_001.setEnabled(false);
|
316 | road_prof_001.setEnabled(false);
|
309 | }
|
317 | }
|
310 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("road_priority_001", (68 - 10)) + 10;
|
318 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("road_priority_001", (68 - 10)) + 10;
|
311 | road_prof_001.setSummary(road_prof_001.getSummary() + " [" + read_value + "]");
|
319 | road_prof_001.setSummary(road_prof_001.getSummary() + " [" + read_value + "]");
|
312 |
|
320 |
|
313 | if (!Navit.PREF_enable_debug_functions)
|
321 | if (!Navit.p.PREF_enable_debug_functions)
|
314 | {
|
322 | {
|
315 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
323 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
316 | cat.removePreference(road_prof_001);
|
324 | cat.removePreference(road_prof_001);
|
317 | }
|
325 | }
|
318 | }
|
326 | }
|
… | |
… | |
329 | road_prof_002.setEnabled(false);
|
337 | road_prof_002.setEnabled(false);
|
330 | }
|
338 | }
|
331 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("road_priority_002", (329 - 10)) + 10;
|
339 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("road_priority_002", (329 - 10)) + 10;
|
332 | road_prof_002.setSummary(road_prof_002.getSummary() + " [" + read_value + "]");
|
340 | road_prof_002.setSummary(road_prof_002.getSummary() + " [" + read_value + "]");
|
333 |
|
341 |
|
334 | if (!Navit.PREF_enable_debug_functions)
|
342 | if (!Navit.p.PREF_enable_debug_functions)
|
335 | {
|
343 | {
|
336 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
344 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
337 | cat.removePreference(road_prof_002);
|
345 | cat.removePreference(road_prof_002);
|
338 | }
|
346 | }
|
339 | }
|
347 | }
|
… | |
… | |
350 | road_prof_003.setEnabled(false);
|
358 | road_prof_003.setEnabled(false);
|
351 | }
|
359 | }
|
352 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("road_priority_003", (5000 - 10)) + 10;
|
360 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("road_priority_003", (5000 - 10)) + 10;
|
353 | road_prof_003.setSummary(road_prof_003.getSummary() + " [" + read_value + "]");
|
361 | road_prof_003.setSummary(road_prof_003.getSummary() + " [" + read_value + "]");
|
354 |
|
362 |
|
355 | if (!Navit.PREF_enable_debug_functions)
|
363 | if (!Navit.p.PREF_enable_debug_functions)
|
356 | {
|
364 | {
|
357 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
365 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
358 | cat.removePreference(road_prof_003);
|
366 | cat.removePreference(road_prof_003);
|
359 | }
|
367 | }
|
360 | }
|
368 | }
|
… | |
… | |
371 | road_prof_004.setEnabled(false);
|
379 | road_prof_004.setEnabled(false);
|
372 | }
|
380 | }
|
373 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("road_priority_004", (5 - 0)) + 0;
|
381 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("road_priority_004", (5 - 0)) + 0;
|
374 | road_prof_004.setSummary(road_prof_004.getSummary() + " [" + read_value + "]");
|
382 | road_prof_004.setSummary(road_prof_004.getSummary() + " [" + read_value + "]");
|
375 |
|
383 |
|
376 | if (!Navit.PREF_enable_debug_functions)
|
384 | if (!Navit.p.PREF_enable_debug_functions)
|
377 | {
|
385 | {
|
378 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
386 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
379 | cat.removePreference(road_prof_004);
|
387 | cat.removePreference(road_prof_004);
|
380 | }
|
388 | }
|
381 | }
|
389 | }
|
… | |
… | |
392 | a.setEnabled(false);
|
400 | a.setEnabled(false);
|
393 | }
|
401 | }
|
394 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("tracking_connected_pref", (250 - 0)) + 0;
|
402 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("tracking_connected_pref", (250 - 0)) + 0;
|
395 | a.setSummary(a.getSummary() + " [" + read_value + "]");
|
403 | a.setSummary(a.getSummary() + " [" + read_value + "]");
|
396 |
|
404 |
|
397 | if (!Navit.PREF_enable_debug_functions)
|
405 | if (!Navit.p.PREF_enable_debug_functions)
|
398 | {
|
406 | {
|
399 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
407 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
400 | cat.removePreference(a);
|
408 | cat.removePreference(a);
|
401 | }
|
409 | }
|
402 | }
|
410 | }
|
… | |
… | |
413 | a.setEnabled(false);
|
421 | a.setEnabled(false);
|
414 | }
|
422 | }
|
415 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("tracking_angle_pref", (40 - 0)) + 0;
|
423 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("tracking_angle_pref", (40 - 0)) + 0;
|
416 | a.setSummary(a.getSummary() + " [" + read_value + "]");
|
424 | a.setSummary(a.getSummary() + " [" + read_value + "]");
|
417 |
|
425 |
|
418 | if (!Navit.PREF_enable_debug_functions)
|
426 | if (!Navit.p.PREF_enable_debug_functions)
|
419 | {
|
427 | {
|
420 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
428 | PreferenceCategory cat = (PreferenceCategory) findPreference("category_tracking");
|
421 | cat.removePreference(a);
|
429 | cat.removePreference(a);
|
422 | }
|
430 | }
|
|
|
431 | }
|
|
|
432 | catch (Exception e)
|
|
|
433 | {
|
|
|
434 | e.printStackTrace();
|
|
|
435 | }
|
|
|
436 |
|
|
|
437 | try
|
|
|
438 | {
|
|
|
439 | Preference a = findPreference("traffic_speed_factor");
|
|
|
440 | int read_value = PreferenceManager.getDefaultSharedPreferences(this).getInt("traffic_speed_factor", (83 - 20)) + 20;
|
|
|
441 | a.setSummary(a.getSummary() + " [" + read_value + "]");
|
423 | }
|
442 | }
|
424 | catch (Exception e)
|
443 | catch (Exception e)
|
425 | {
|
444 | {
|
426 | e.printStackTrace();
|
445 | e.printStackTrace();
|
427 | }
|
446 | }
|
… | |
… | |
691 | catch (Exception e)
|
710 | catch (Exception e)
|
692 | {
|
711 | {
|
693 | e.printStackTrace();
|
712 | e.printStackTrace();
|
694 | }
|
713 | }
|
695 |
|
714 |
|
|
|
715 | try
|
|
|
716 | {
|
|
|
717 | if (key.equals("traffic_speed_factor"))
|
|
|
718 | {
|
|
|
719 | Preference a = findPreference("traffic_speed_factor");
|
|
|
720 | int read_value = sharedPreferences.getInt("traffic_speed_factor", (83 - 20)) + 20;
|
|
|
721 | int pos_start = a.getSummary().toString().lastIndexOf("[");
|
|
|
722 | a.setSummary(a.getSummary().subSequence(0, pos_start - 1) + " [" + read_value + "]");
|
|
|
723 | }
|
|
|
724 | }
|
|
|
725 | catch (Exception e)
|
|
|
726 | {
|
|
|
727 | e.printStackTrace();
|
|
|
728 | }
|
|
|
729 |
|
696 | }
|
730 | }
|
697 |
|
731 |
|
698 | void disable_pref(String pref_name, boolean large_donate_only, boolean debug_function)
|
732 | void disable_pref(String pref_name, boolean large_donate_only, boolean debug_function)
|
699 | {
|
733 | {
|
700 | try
|
734 | try
|
… | |
… | |
707 | else if ((Navit.Navit_DonateVersion_Installed == false) && (Navit.Navit_Largemap_DonateVersion_Installed == false))
|
741 | else if ((Navit.Navit_DonateVersion_Installed == false) && (Navit.Navit_Largemap_DonateVersion_Installed == false))
|
708 | {
|
742 | {
|
709 | a.setEnabled(false);
|
743 | a.setEnabled(false);
|
710 | }
|
744 | }
|
711 |
|
745 |
|
712 | if ((debug_function) && (!Navit.PREF_enable_debug_functions))
|
746 | if ((debug_function) && (!Navit.p.PREF_enable_debug_functions))
|
713 | {
|
747 | {
|
714 | a.setEnabled(false);
|
748 | a.setEnabled(false);
|
715 | }
|
749 | }
|
716 | }
|
750 | }
|
717 | catch (Exception e)
|
751 | catch (Exception e)
|