From 7d29b4533e514e5e5e71a89a99431ad4db3ccc43 Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 21 Dec 2014 12:16:38 +0100 Subject: [PATCH 1/6] NPE is not caused by null info either ... --- .../plus/download/LocalIndexesFragment.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java index b131f96497..56db5b8fc0 100644 --- a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java @@ -480,15 +480,13 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { //fixes issue when local files not shown after switching tabs //TODO: But next line throws NPE in some circumstances when called from dashboard, so needs fixing, commented out for now - if (listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0) { - for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()) { - if (info != null) { - listAdapter.addLocalIndexInfo(info); - } - } - listAdapter.sortData(); - getExpandableListView().setAdapter(listAdapter); - } + //if (listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0) { + // for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()) { + // listAdapter.addLocalIndexInfo(info); + // } + // listAdapter.sortData(); + // getExpandableListView().setAdapter(listAdapter); + //} ActionBar actionBar = getDownloadActivity().getSupportActionBar(); //hide action bar from downloadindexfragment actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); From c651dc6b32ef4b5645f9249d621d56ce56e05c22 Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 21 Dec 2014 12:25:33 +0100 Subject: [PATCH 2/6] check out variables --- OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java index 56db5b8fc0..b9689971ae 100644 --- a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java @@ -480,6 +480,8 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { //fixes issue when local files not shown after switching tabs //TODO: But next line throws NPE in some circumstances when called from dashboard, so needs fixing, commented out for now + int test1 = listAdapter.getGroupCount(); + int test2 = getDownloadActivity().getLocalIndexInfos().size(); //if (listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0) { // for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()) { // listAdapter.addLocalIndexInfo(info); From 0adcce0d91534a260bf2a82213c3595ba00c6982 Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 21 Dec 2014 12:48:27 +0100 Subject: [PATCH 3/6] try catch listAdapter = null --- .../plus/download/LocalIndexesFragment.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java index b9689971ae..9bb2ac5354 100644 --- a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java @@ -480,15 +480,13 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { //fixes issue when local files not shown after switching tabs //TODO: But next line throws NPE in some circumstances when called from dashboard, so needs fixing, commented out for now - int test1 = listAdapter.getGroupCount(); - int test2 = getDownloadActivity().getLocalIndexInfos().size(); - //if (listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0) { - // for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()) { - // listAdapter.addLocalIndexInfo(info); - // } - // listAdapter.sortData(); - // getExpandableListView().setAdapter(listAdapter); - //} + if (listAdapter != null && listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0) { + for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()) { + listAdapter.addLocalIndexInfo(info); + } + listAdapter.sortData(); + getExpandableListView().setAdapter(listAdapter); + } ActionBar actionBar = getDownloadActivity().getSupportActionBar(); //hide action bar from downloadindexfragment actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); From 2f034ee92a41fec3d5b89a6d4825439b60809eb6 Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 21 Dec 2014 13:04:15 +0100 Subject: [PATCH 4/6] comment fix for LocalIndexesFragment NPE --- OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java index 9bb2ac5354..50bc1c7650 100644 --- a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java @@ -479,7 +479,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { //fixes issue when local files not shown after switching tabs - //TODO: But next line throws NPE in some circumstances when called from dashboard, so needs fixing, commented out for now + //Next line throws NPE in some circumstances when called from dashboard and listAdpater=null is not checked if (listAdapter != null && listAdapter.getGroupCount() == 0 && getDownloadActivity().getLocalIndexInfos().size() > 0) { for(LocalIndexInfo info : getDownloadActivity().getLocalIndexInfos()) { listAdapter.addLocalIndexInfo(info); From 109ba6bf2798b72c4703d353ad9c5c70fc0cfe5f Mon Sep 17 00:00:00 2001 From: ace shadow Date: Sun, 21 Dec 2014 13:22:32 +0100 Subject: [PATCH 5/6] Translated using Weblate (Slovak) Currently translated at 100.0% (1595 of 1595 strings) --- OsmAnd/res/values-sk/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index f12f7904ae..9e0490ec0f 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -2026,4 +2026,5 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, Americký atlas ciest Bez smerovacích pravidiel verzie 1.9 Nepoužívať pravidlá výpočtu trasy zavedené vo verzii 1.9 + Oznamovať priechody pre chodcov From 5b0e04098e352aef80e9478b5f5fb393c940984a Mon Sep 17 00:00:00 2001 From: sonora Date: Sun, 21 Dec 2014 14:30:33 +0100 Subject: [PATCH 6/6] align order of cards --- OsmAnd/res/layout-large-land/dashboard.xml | 6 +++--- OsmAnd/res/layout/dashboard.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/res/layout-large-land/dashboard.xml b/OsmAnd/res/layout-large-land/dashboard.xml index 1e48cbdff9..73bd2231ca 100644 --- a/OsmAnd/res/layout-large-land/dashboard.xml +++ b/OsmAnd/res/layout-large-land/dashboard.xml @@ -32,14 +32,14 @@ @@ -67,7 +67,7 @@ diff --git a/OsmAnd/res/layout/dashboard.xml b/OsmAnd/res/layout/dashboard.xml index 41c50ed252..93038aec2a 100644 --- a/OsmAnd/res/layout/dashboard.xml +++ b/OsmAnd/res/layout/dashboard.xml @@ -49,14 +49,14 @@