Skip to content

Commit

Permalink
Clean up App/Fragment/Activityi component for useless methods
Browse files Browse the repository at this point in the history
  • Loading branch information
helloworld1 committed Apr 2, 2018
1 parent de88686 commit 2bd2a92
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 116 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
package org.liberty.android.fantastischmemo.modules;

import android.app.Activity;
import android.content.Context;

import com.google.android.gms.common.api.GoogleApiClient;

import org.liberty.android.fantastischmemo.common.BaseActivity;
import org.liberty.android.fantastischmemo.converter.Converter;
import org.liberty.android.fantastischmemo.downloader.common.DownloaderUtils;
import org.liberty.android.fantastischmemo.downloader.dropbox.DropboxOauth2AccountActivity;
import org.liberty.android.fantastischmemo.downloader.dropbox.UploadDropboxActivity;
import org.liberty.android.fantastischmemo.downloader.google.GoogleAccountActivity;
import org.liberty.android.fantastischmemo.downloader.google.SpreadsheetListScreen;
import org.liberty.android.fantastischmemo.downloader.oauth.Oauth2AccountActivity;
import org.liberty.android.fantastischmemo.downloader.oauth.Oauth2TokenUtil;
import org.liberty.android.fantastischmemo.downloader.quizlet.QuizletDownloadHelper;
import org.liberty.android.fantastischmemo.entity.Option;
import org.liberty.android.fantastischmemo.scheduler.Scheduler;
import org.liberty.android.fantastischmemo.ui.AnyMemo;
import org.liberty.android.fantastischmemo.ui.CardEditor;
import org.liberty.android.fantastischmemo.ui.CardListActivity;
Expand All @@ -27,21 +16,6 @@
import org.liberty.android.fantastischmemo.ui.SettingsScreen;
import org.liberty.android.fantastischmemo.ui.ShareScreen;
import org.liberty.android.fantastischmemo.ui.StudyActivity;
import org.liberty.android.fantastischmemo.utils.AMDateUtil;
import org.liberty.android.fantastischmemo.utils.AMFileUtil;
import org.liberty.android.fantastischmemo.utils.AMPrefUtil;
import org.liberty.android.fantastischmemo.utils.AMUiUtil;
import org.liberty.android.fantastischmemo.utils.AboutUtil;
import org.liberty.android.fantastischmemo.utils.DatabaseOperationDialogUtil;
import org.liberty.android.fantastischmemo.utils.DatabaseUtil;
import org.liberty.android.fantastischmemo.utils.ErrorUtil;
import org.liberty.android.fantastischmemo.utils.GooglePlayUtil;
import org.liberty.android.fantastischmemo.utils.RecentListActionModeUtil;
import org.liberty.android.fantastischmemo.utils.RecentListUtil;
import org.liberty.android.fantastischmemo.utils.ShareUtil;

import java.util.Map;
import java.util.concurrent.ExecutorService;

import javax.inject.Provider;

Expand All @@ -51,51 +25,6 @@
@PerActivity
@Subcomponent(modules = {ActivityModules.class})
public interface ActivityComponents {
Activity activity();

BaseActivity baseActivity();

Scheduler scheduler();

AMDateUtil amDateUtil();

ShareUtil shareUtil();

AMUiUtil amUiUtil();

AboutUtil aboutUtil();

DownloaderUtils downloaderUtils();

DatabaseUtil databaseUtil();

QuizletDownloadHelper quizletDownloadHelper();

Option option();

RecentListUtil recentListUtil();

AMPrefUtil amPrefUtil();

AMFileUtil amFileUtil();

Oauth2TokenUtil oauth2TokenUtil();

RecentListActionModeUtil recentListActionModeUtil();

DatabaseOperationDialogUtil databaseOperationDialogUtil();

ExecutorService executorService();

ErrorUtil errorUtil();

GooglePlayUtil googlePlayUtil();

GoogleApiClient googleApiClient();

Map<Class<?>, Converter> converterMap();

@ForApplication Context applicationContext();

void inject(AnyMemo activity);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,62 +1,20 @@
package org.liberty.android.fantastischmemo.modules;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;

import org.greenrobot.eventbus.EventBus;
import org.liberty.android.fantastischmemo.common.AMApplication;
import org.liberty.android.fantastischmemo.converter.Converter;
import org.liberty.android.fantastischmemo.downloader.common.DownloaderUtils;
import org.liberty.android.fantastischmemo.downloader.dropbox.DropboxApiHelper;
import org.liberty.android.fantastischmemo.downloader.google.GoogleDriveDownloadHelper;
import org.liberty.android.fantastischmemo.downloader.quizlet.QuizletDownloadHelper;
import org.liberty.android.fantastischmemo.entity.Option;
import org.liberty.android.fantastischmemo.entity.SchedulingAlgorithmParameters;
import org.liberty.android.fantastischmemo.scheduler.Scheduler;
import org.liberty.android.fantastischmemo.service.AnyMemoService;
import org.liberty.android.fantastischmemo.service.CardPlayerService;
import org.liberty.android.fantastischmemo.service.ConvertIntentService;
import org.liberty.android.fantastischmemo.ui.QuizActivity;
import org.liberty.android.fantastischmemo.ui.StudyActivity;
import org.liberty.android.fantastischmemo.utils.AMDateUtil;
import org.liberty.android.fantastischmemo.utils.AMFileUtil;
import org.liberty.android.fantastischmemo.utils.AMPrefUtil;
import org.liberty.android.fantastischmemo.utils.AMUiUtil;
import org.liberty.android.fantastischmemo.utils.DatabaseUtil;
import org.liberty.android.fantastischmemo.utils.RecentListUtil;
import org.liberty.android.fantastischmemo.widget.WidgetRemoteViewsFactory;

import java.util.Map;
import java.util.concurrent.ExecutorService;

import dagger.BindsInstance;
import dagger.Component;
import okhttp3.OkHttpClient;

@PerApplication
@Component(modules = AppModules.class)
public interface AppComponents {
AMApplication application();
Scheduler scheduler();
SharedPreferences sharedPreferences();
AMFileUtil amFileUtil();
AMPrefUtil amPrefUtil();
AMDateUtil amDateUtil();
AMUiUtil amUiUtil();
OkHttpClient okHttpClient();
RecentListUtil recenetListUtil();
SchedulingAlgorithmParameters schedulingAlgorithmParameters();
DownloaderUtils downloaderUtils();
DatabaseUtil databaseUtil();
DropboxApiHelper dropboxApiHelper();
QuizletDownloadHelper quizletDownloadHelper();
EventBus eventBus();
Map<Class<?>, Converter> converterMap();
Option option();
ExecutorService executorService();

@ForApplication Context applicationContext();

void inject(AMApplication application);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.liberty.android.fantastischmemo.ui.RecentListFragment;

import dagger.BindsInstance;
import dagger.Component;
import dagger.Subcomponent;

@PerFragment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.file_browser_createdb:{
disposables.add(activityComponents().databaseOperationDialogUtil().showCreateDbDialog(currentDirectory.getAbsolutePath())
disposables.add(databaseOperationDialogUtil.showCreateDbDialog(currentDirectory.getAbsolutePath())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<File>() {
@Override
Expand All @@ -299,7 +299,7 @@ public void accept(File file) throws Exception {
}

case R.id.file_browser_createdirectory:{
disposables.add(activityComponents().databaseOperationDialogUtil().showCreateFolderDialog(currentDirectory)
disposables.add(databaseOperationDialogUtil.showCreateFolderDialog(currentDirectory)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<File>() {
@Override
Expand Down

0 comments on commit 2bd2a92

Please sign in to comment.