Show empty state in my tracks

This commit is contained in:
PavelRatushny 2017-08-02 11:25:08 +03:00
parent ba7dee373f
commit db18af870f
3 changed files with 10 additions and 3 deletions

View file

@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/ctx_menu_info_view_bg"
android:orientation="vertical"> android:orientation="vertical">
<ExpandableListView <ExpandableListView
@ -17,4 +18,9 @@
android:drawSelectorOnTop="false" android:drawSelectorOnTop="false"
android:groupIndicator="@android:color/transparent"/> android:groupIndicator="@android:color/transparent"/>
<TextView
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout> </LinearLayout>

View file

@ -327,6 +327,9 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
} }
footerView = inflater.inflate(R.layout.list_shadow_footer, null, false); footerView = inflater.inflate(R.layout.list_shadow_footer, null, false);
listView.addFooterView(footerView); 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) { if (this.adapter != null) {
listView.setAdapter(this.adapter); listView.setAdapter(this.adapter);
} }

View file

@ -148,9 +148,7 @@ public class FavoritesActivity extends TabActivity {
List<TabItem> mTabs = new ArrayList<>(); List<TabItem> mTabs = new ArrayList<>();
mTabs.add(getTabIndicator(FAV_TAB, FavoritesTreeFragment.class)); 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()); OsmandPlugin.addMyPlacesTabPlugins(this, mTabs, getIntent());
return mTabs; return mTabs;
} }