From db18af870f1d4cbace8bece138124e86a1019683 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Wed, 2 Aug 2017 11:25:08 +0300 Subject: [PATCH 001/174] Show empty state in my tracks --- OsmAnd/res/layout/available_gpx.xml | 6 ++++++ .../src/net/osmand/plus/myplaces/AvailableGPXFragment.java | 3 +++ OsmAnd/src/net/osmand/plus/myplaces/FavoritesActivity.java | 4 +--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/layout/available_gpx.xml b/OsmAnd/res/layout/available_gpx.xml index 56f9dc4bf5..a9c72849b1 100644 --- a/OsmAnd/res/layout/available_gpx.xml +++ b/OsmAnd/res/layout/available_gpx.xml @@ -2,6 +2,7 @@ + + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java index 05c658efe4..cdb44da1dd 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/AvailableGPXFragment.java @@ -327,6 +327,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { } footerView = inflater.inflate(R.layout.list_shadow_footer, null, false); listView.addFooterView(footerView); + TextView emptyTextView = (TextView) v.findViewById(android.R.id.empty); + emptyTextView.setText("There are no gpx items"); + listView.setEmptyView(emptyTextView); if (this.adapter != null) { listView.setAdapter(this.adapter); } diff --git a/OsmAnd/src/net/osmand/plus/myplaces/FavoritesActivity.java b/OsmAnd/src/net/osmand/plus/myplaces/FavoritesActivity.java index 54182345a1..aabb05828e 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/FavoritesActivity.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/FavoritesActivity.java @@ -148,9 +148,7 @@ public class FavoritesActivity extends TabActivity { List mTabs = new ArrayList<>(); mTabs.add(getTabIndicator(FAV_TAB, FavoritesTreeFragment.class)); - if (hasGpx) { - mTabs.add(getTabIndicator(GPX_TAB, AvailableGPXFragment.class)); - } + mTabs.add(getTabIndicator(GPX_TAB, AvailableGPXFragment.class)); OsmandPlugin.addMyPlacesTabPlugins(this, mTabs, getIntent()); return mTabs; } From 68e85bbbf3bc05c8049cfb7e665fb6704cb2de42 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Thu, 3 Aug 2017 15:32:49 +0300 Subject: [PATCH 002/174] Add empty states --- OsmAnd/res/layout/available_gpx.xml | 50 ++++++++++++++--- OsmAnd/res/layout/favorites_tree.xml | 54 +++++++++++++++++-- OsmAnd/res/values-large/sizes.xml | 7 +++ OsmAnd/res/values/sizes.xml | 7 +++ OsmAnd/res/values/strings.xml | 4 ++ .../activities/FavoritesTreeFragment.java | 18 +++++++ .../plus/myplaces/AvailableGPXFragment.java | 14 +++-- 7 files changed, 140 insertions(+), 14 deletions(-) diff --git a/OsmAnd/res/layout/available_gpx.xml b/OsmAnd/res/layout/available_gpx.xml index a9c72849b1..1b301f6fbb 100644 --- a/OsmAnd/res/layout/available_gpx.xml +++ b/OsmAnd/res/layout/available_gpx.xml @@ -1,9 +1,11 @@ + android:orientation="vertical"> - + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + + + + + + +