mirror of
https://github.com/MinimalBible/MinimalBible
synced 2024-12-22 14:48:23 -05:00
Refactor out some dependencies
This commit is contained in:
parent
66076c759a
commit
ee62ddb707
@ -103,6 +103,13 @@ public class BibleViewerModules {
|
||||
return new VerseLookup(b);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Named("MainAdapter")
|
||||
@Singleton
|
||||
BookAdapter bookAdapter(@Named("MainBook") Book b, VerseLookup v) {
|
||||
return new BookAdapter(b, v);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
PublishSubject<BookScrollEvent> scrollEventProvider() {
|
||||
|
@ -12,7 +12,6 @@ import android.view.ViewGroup;
|
||||
import org.bspeice.minimalbible.Injector;
|
||||
import org.bspeice.minimalbible.R;
|
||||
import org.bspeice.minimalbible.activity.BaseFragment;
|
||||
import org.bspeice.minimalbible.service.lookup.VerseLookup;
|
||||
import org.crosswire.jsword.book.Book;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -36,7 +35,8 @@ public class BookFragment extends BaseFragment {
|
||||
@Inject
|
||||
PublishSubject<BookScrollEvent> scrollEventProvider;
|
||||
@Inject
|
||||
VerseLookup lookup;
|
||||
@Named("MainAdapter")
|
||||
BookAdapter adapter;
|
||||
|
||||
@InjectView(R.id.book_content)
|
||||
RecyclerView bookContent;
|
||||
@ -94,7 +94,6 @@ public class BookFragment extends BaseFragment {
|
||||
((BibleViewer)getActivity()).setActionBarTitle(b.getInitials());
|
||||
|
||||
final RecyclerView.LayoutManager manager = new LinearLayoutManager(getActivity());
|
||||
BookAdapter adapter = new BookAdapter(b, lookup);
|
||||
bookContent.setLayoutManager(manager);
|
||||
bookContent.setAdapter(adapter);
|
||||
|
||||
|
@ -10,9 +10,9 @@ import org.crosswire.jsword.book.Book
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
/**
|
||||
* Created by bspeice on 9/10/14.
|
||||
* Parse out the OSIS XML into whatever we want!
|
||||
* TODO: Speed up parsing. This is the single most expensive repeated operation
|
||||
*/
|
||||
|
||||
class OsisParser() : DefaultHandler() {
|
||||
|
||||
// Don't pass a verse as part of the constructor, but still guarantee
|
||||
|
Loading…
Reference in New Issue
Block a user