Merge pull request #883 from Bars107/downloads

Downloads
This commit is contained in:
vshcherb 2014-09-24 10:53:43 +02:00
commit 0cb8852667
4 changed files with 23 additions and 6 deletions

View file

@ -155,4 +155,6 @@ public class OsmAndAppCustomization {
}
public boolean showNavigationControls() { return true;}
public boolean onlyTourDownload() { return false;}
}

View file

@ -75,12 +75,18 @@ public class DownloadActivity extends SherlockFragmentActivity {
tabHost.setup();
ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
mTabsAdapter = new FavouritesActivity.TabsAdapter(this, tabHost, viewPager, settings, false);
mTabsAdapter.addTab(tabHost.newTabSpec("LOCAL_INDEX").setIndicator("Local"),
LocalIndexesFragment.class, null);
mTabsAdapter.addTab(tabHost.newTabSpec("DOWNLOADS").setIndicator("Downloads"),
DownloadIndexFragment.class, null);
mTabsAdapter.addTab(tabHost.newTabSpec("UPDATES").setIndicator("Updates"),
UpdatesIndexFragment.class, null);
if (getMyApplication().getAppCustomization().onlyTourDownload()){
mTabsAdapter.addTab(tabHost.newTabSpec("DOWNLOADS").setIndicator("Downloads"),
DownloadIndexFragment.class, null);
} else {
mTabsAdapter.addTab(tabHost.newTabSpec("LOCAL_INDEX").setIndicator("Local"),
LocalIndexesFragment.class, null);
mTabsAdapter.addTab(tabHost.newTabSpec("DOWNLOADS").setIndicator("Downloads"),
DownloadIndexFragment.class, null);
mTabsAdapter.addTab(tabHost.newTabSpec("UPDATES").setIndicator("Updates"),
UpdatesIndexFragment.class, null);
}
tabHost.setCurrentTab(0);
if(downloadListIndexThread == null) {

View file

@ -191,6 +191,10 @@ public class DownloadIndexFragment extends OsmandExpandableListFragment {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
if (getMyApplication().getAppCustomization().onlyTourDownload()){
return;
}
ActionBar actionBar = getDownloadActivity().getSupportActionBar();
final List<DownloadActivityType> downloadTypes = getDownloadActivity().getDownloadTypes();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

View file

@ -735,4 +735,9 @@ public class SherpafyCustomization extends OsmAndAppCustomization {
public boolean showNavigationControls() {
return false;
}
@Override
public boolean onlyTourDownload() {
return true;
}
}