From 1380a66f883cf811564f4660b318e9795fbf0478 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Wed, 16 Apr 2014 22:39:47 -0400 Subject: [PATCH] Navbar for download activity now displays things from jsword! --- .../downloader/DownloadNavDrawerFragment.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/MinimalBible/src/org/bspeice/minimalbible/activities/downloader/DownloadNavDrawerFragment.java b/MinimalBible/src/org/bspeice/minimalbible/activities/downloader/DownloadNavDrawerFragment.java index 511d0b7..c540fd2 100644 --- a/MinimalBible/src/org/bspeice/minimalbible/activities/downloader/DownloadNavDrawerFragment.java +++ b/MinimalBible/src/org/bspeice/minimalbible/activities/downloader/DownloadNavDrawerFragment.java @@ -2,6 +2,8 @@ package org.bspeice.minimalbible.activities.downloader; import org.bspeice.minimalbible.R; import org.bspeice.minimalbible.activities.BaseNavigationDrawerFragment; +import org.crosswire.jsword.book.BookCategory; +import org.crosswire.jsword.book.BookFilters; import android.os.Bundle; import android.view.LayoutInflater; @@ -13,6 +15,10 @@ import android.widget.ListView; public class DownloadNavDrawerFragment extends BaseNavigationDrawerFragment { + private final BookCategory[] displayCategories = {BookCategory.BIBLE, BookCategory.COMMENTARY, + BookCategory.DICTIONARY, BookCategory.IMAGES, BookCategory.MAPS + }; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -26,12 +32,15 @@ public class DownloadNavDrawerFragment extends BaseNavigationDrawerFragment { 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(getActionBar() .getThemedContext(), android.R.layout.simple_list_item_1, - android.R.id.text1, new String[] { - getString(R.string.title_section1), - getString(R.string.title_section2), - getString(R.string.title_section3), })); + android.R.id.text1, sCategories)); mDrawerListView.setItemChecked(mCurrentSelectedPosition, true); return mDrawerListView; }