private BookmarkPresenter(Context context) { mAppContext = context.getApplicationContext(); mQuranSettings = QuranSettings.getInstance(context); mBookmarkModel = BookmarkModel.getInstance(context); mSortOrder = mQuranSettings.getBookmarksSortOrder(); mGroupByTags = mQuranSettings.getBookmarksGroupedByTags(); try { mArabicDatabaseUtils = ArabicDatabaseUtils.getInstance(context); } catch (Exception e) { mArabicDatabaseUtils = null; } subscribeToChanges(); }
@VisibleForTesting BookmarkPresenter( Context context, QuranSettings settings, BookmarkModel bookmarkModel, boolean subscribeToChanges) { mAppContext = context.getApplicationContext(); mQuranSettings = settings; mBookmarkModel = bookmarkModel; mSortOrder = mQuranSettings.getBookmarksSortOrder(); mGroupByTags = mQuranSettings.getBookmarksGroupedByTags(); if (subscribeToChanges) { subscribeToChanges(); } }