// Path: app/src/main/java/com/projects/elad/hacklist/presentation/presenters/BookmarksPresenter.java
// public class BookmarksPresenter extends BasePresenter<BookmarksMvpView> {
// 
//     @Inject
//     DataManager dataManager;
//     @Inject
//     Context context;
//     private Subscription subscription;
// 
//     public BookmarksPresenter() {
//     }
// 
// 
//     @Override
//     public void detachView() {
//         super.detachView();
//         RxUtil.unsubscribe(subscription);
//     }
// 
//     @Override
//     public void attachView(BookmarksMvpView mvpView) {
//         super.attachView(mvpView);
//         ((HacklistApplication) (((FragmentBookmarks) getMvpView()).getActivity().getApplication())).getComponent().inject(this);
// 
//     }
// 
// 
//     public void loadBookmarks() {
//         RxUtil.unsubscribe(subscription);
//         subscription = dataManager.getAllBookmarks()
//                 .map(dbEntities -> Mappers.mapBookmarkDbEntityToItem(dbEntities, context))
//                 .subscribeOn(AndroidSchedulers.mainThread())
//                 .observeOn(AndroidSchedulers.mainThread())
//                 .subscribe(new Subscriber<List<BookmarkItem>>() {
//                     @Override
//                     public void onCompleted() {
//                     }
// 
//                     @Override
//                     public void onError(Throwable e) {
//                         Toast.makeText(context, "Error when fetching bookmarks" + e.toString(), Toast.LENGTH_LONG).show();
//                     }
// 
//                     @Override
//                     public void onNext(List<BookmarkItem> bookmarkItems) {
//                         if (bookmarkItems.isEmpty()) {
//                             getMvpView().showEmpty();
//                         } else {
//                             getMvpView().showBookmarks(bookmarkItems);
//                         }
//                     }
//                 });
//     }
// 
// 
//     public void deleteBookmark(BookmarkItem bookmark) {
//         dataManager.deleteBookmark(bookmark.getBookmarkTitle());
//         loadBookmarks();
//     }
// }


import com.projects.elad.hacklist.injection.scopes.PerFragment;
import com.projects.elad.hacklist.presentation.presenters.BookmarksPresenter;
import dagger.Module;
import dagger.Provides;
package com.projects.elad.hacklist.injection.modules;



/**
 * Created by EladKeyshawn on 01/03/2017.
 */

@Module
public class BookmarksFragmentModule {

    @PerFragment
    @Provides
// Path: app/src/main/java/com/projects/elad/hacklist/presentation/presenters/BookmarksPresenter.java
// public class BookmarksPresenter extends BasePresenter<BookmarksMvpView> {
// 
//     @Inject
//     DataManager dataManager;
//     @Inject
//     Context context;
//     private Subscription subscription;
// 
//     public BookmarksPresenter() {
//     }
// 
// 
//     @Override
//     public void detachView() {
//         super.detachView();
//         RxUtil.unsubscribe(subscription);
//     }
// 
//     @Override
//     public void attachView(BookmarksMvpView mvpView) {
//         super.attachView(mvpView);
//         ((HacklistApplication) (((FragmentBookmarks) getMvpView()).getActivity().getApplication())).getComponent().inject(this);
// 
//     }
// 
// 
//     public void loadBookmarks() {
//         RxUtil.unsubscribe(subscription);
//         subscription = dataManager.getAllBookmarks()
//                 .map(dbEntities -> Mappers.mapBookmarkDbEntityToItem(dbEntities, context))
//                 .subscribeOn(AndroidSchedulers.mainThread())
//                 .observeOn(AndroidSchedulers.mainThread())
//                 .subscribe(new Subscriber<List<BookmarkItem>>() {
//                     @Override
//                     public void onCompleted() {
//                     }
// 
//                     @Override
//                     public void onError(Throwable e) {
//                         Toast.makeText(context, "Error when fetching bookmarks" + e.toString(), Toast.LENGTH_LONG).show();
//                     }
// 
//                     @Override
//                     public void onNext(List<BookmarkItem> bookmarkItems) {
//                         if (bookmarkItems.isEmpty()) {
//                             getMvpView().showEmpty();
//                         } else {
//                             getMvpView().showBookmarks(bookmarkItems);
//                         }
//                     }
//                 });
//     }
// 
// 
//     public void deleteBookmark(BookmarkItem bookmark) {
//         dataManager.deleteBookmark(bookmark.getBookmarkTitle());
//         loadBookmarks();
//     }
// }


// Path: app/src/main/java/com/projects/elad/hacklist/injection/modules/BookmarksFragmentModule.java
import com.projects.elad.hacklist.injection.scopes.PerFragment;
import com.projects.elad.hacklist.presentation.presenters.BookmarksPresenter;
import dagger.Module;
import dagger.Provides;

package com.projects.elad.hacklist.injection.modules;



/**
 * Created by EladKeyshawn on 01/03/2017.
 */

@Module
public class BookmarksFragmentModule {

    @PerFragment
    @Provides
    public BookmarksPresenter provideBookmarksPresenter() {