mirror of
https://github.com/MinimalBible/MinimalBible
synced 2025-07-12 03:04:43 -04:00
Refactor out some dependencies
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user