Navbar for download activity now displays things from jsword!

This commit is contained in:
Bradlee Speice 2014-04-16 22:39:47 -04:00
parent fd6c063079
commit 1380a66f88

View File

@ -2,6 +2,8 @@ package org.bspeice.minimalbible.activities.downloader;
import org.bspeice.minimalbible.R; import org.bspeice.minimalbible.R;
import org.bspeice.minimalbible.activities.BaseNavigationDrawerFragment; import org.bspeice.minimalbible.activities.BaseNavigationDrawerFragment;
import org.crosswire.jsword.book.BookCategory;
import org.crosswire.jsword.book.BookFilters;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -13,6 +15,10 @@ import android.widget.ListView;
public class DownloadNavDrawerFragment extends BaseNavigationDrawerFragment { public class DownloadNavDrawerFragment extends BaseNavigationDrawerFragment {
private final BookCategory[] displayCategories = {BookCategory.BIBLE, BookCategory.COMMENTARY,
BookCategory.DICTIONARY, BookCategory.IMAGES, BookCategory.MAPS
};
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
@ -26,12 +32,15 @@ public class DownloadNavDrawerFragment extends BaseNavigationDrawerFragment {
selectItem(position); selectItem(position);
} }
}); });
String[] sCategories = new String[displayCategories.length];
for (int i = 0; i < displayCategories.length; i++) {
sCategories[i] = displayCategories[i].toString();
}
mDrawerListView.setAdapter(new ArrayAdapter<String>(getActionBar() mDrawerListView.setAdapter(new ArrayAdapter<String>(getActionBar()
.getThemedContext(), android.R.layout.simple_list_item_1, .getThemedContext(), android.R.layout.simple_list_item_1,
android.R.id.text1, new String[] { android.R.id.text1, sCategories));
getString(R.string.title_section1),
getString(R.string.title_section2),
getString(R.string.title_section3), }));
mDrawerListView.setItemChecked(mCurrentSelectedPosition, true); mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
return mDrawerListView; return mDrawerListView;
} }