<commit_before>package net.simonvt.trakt;

import dagger.Module;
import dagger.ObjectGraph;
import dagger.Provides;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.squareup.otto.Bus;
import com.squareup.picasso.Picasso;
import com.squareup.tape.ObjectQueue;

import net.simonvt.trakt.api.ApiKey;
import net.simonvt.trakt.api.ResponseParser;
import net.simonvt.trakt.api.TraktModule;
import net.simonvt.trakt.api.UserCredentials;
import net.simonvt.trakt.scheduler.EpisodeTaskScheduler;
import net.simonvt.trakt.scheduler.MovieTaskScheduler;
import net.simonvt.trakt.scheduler.SeasonTaskScheduler;
import net.simonvt.trakt.scheduler.ShowTaskScheduler;
import net.simonvt.trakt.settings.Settings;
import net.simonvt.trakt.sync.PriorityTraktTaskQueue;
import net.simonvt.trakt.sync.TraktTaskQueue;
import net.simonvt.trakt.sync.TraktTaskSerializer;
import net.simonvt.trakt.sync.TraktTaskService;
import net.simonvt.trakt.sync.task.EpisodeCollectionTask;
import net.simonvt.trakt.sync.task.EpisodeRateTask;
import net.simonvt.trakt.sync.task.EpisodeWatchedTask;
import net.simonvt.trakt.sync.task.MovieRateTask;
import net.simonvt.trakt.sync.task.ShowRateTask;
import net.simonvt.trakt.sync.task.SyncEpisodeTask;
import net.simonvt.trakt.sync.task.SyncEpisodeWatchlist;
import net.simonvt.trakt.sync.task.SyncMovieTask;
import net.simonvt.trakt.sync.task.SyncMoviesTask;
import net.simonvt.trakt.sync.task.SyncMoviesWatchlistTask;
import net.simonvt.trakt.sync.task.SyncSeasonTask;
import net.simonvt.trakt.sync.task.SyncShowTask;
import net.simonvt.trakt.sync.task.SyncShowsCollectionTask;
import net.simonvt.trakt.sync.task.SyncShowsTask;
import net.simonvt.trakt.sync.task.SyncShowsWatchlistTask;
import net.simonvt.trakt.sync.task.SyncTask;
import net.simonvt.trakt.sync.task.SyncWatchedStatusTask;
import net.simonvt.trakt.sync.task.TraktTask;
import net.simonvt.trakt.sync.task.UpdateSeasonCountTask;
import net.simonvt.trakt.sync.task.UpdateShowCountTask;
import net.simonvt.trakt.ui.HomeActivity;
import net.simonvt.trakt.ui.adapter.EpisodeWatchlistAdapter;
import net.simonvt.trakt.ui.adapter.MovieSearchAdapter;
import net.simonvt.trakt.ui.adapter.MoviesAdapter;
import net.simonvt.trakt.ui.adapter.SeasonsAdapter;
import net.simonvt.trakt.ui.adapter.ShowSearchAdapter;
import net.simonvt.trakt.ui.adapter.ShowsAdapter;
import net.simonvt.trakt.ui.dialog.RatingDialog;
import net.simonvt.trakt.ui.fragment.EpisodeFragment;
import net.simonvt.trakt.ui.fragment.EpisodesWatchlistFragment;
import net.simonvt.trakt.ui.fragment.LoginFragment;
import net.simonvt.trakt.ui.fragment.MovieCollectionFragment;
import net.simonvt.trakt.ui.fragment.MovieFragment;
import net.simonvt.trakt.ui.fragment.MovieWatchlistFragment;
import net.simonvt.trakt.ui.fragment.SearchMovieFragment;
import net.simonvt.trakt.ui.fragment.SearchShowFragment;
import net.simonvt.trakt.ui.fragment.SeasonFragment;
import net.simonvt.trakt.ui.fragment.SeasonsFragment;
import net.simonvt.trakt.ui.fragment.ShowInfoFragment;
import net.simonvt.trakt.ui.fragment.ShowsCollectionFragment;
import net.simonvt.trakt.ui.fragment.ShowsWatchlistFragment;
import net.simonvt.trakt.ui.fragment.UpcomingShowsFragment;
import net.simonvt.trakt.ui.fragment.WatchedMoviesFragment;
import net.simonvt.trakt.ui.fragment.WatchedShowsFragment;
import net.simonvt.trakt.util.LogWrapper;
import net.simonvt.trakt.util.MovieSearchHandler;
import net.simonvt.trakt.util.ShowSearchHandler;
import net.simonvt.trakt.widget.PhoneEpisodeView;
import net.simonvt.trakt.widget.RemoteImageView;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import javax.inject.Singleton;

public class TraktApp extends Application {

    public static final boolean DEBUG = BuildConfig.DEBUG;

    private ObjectGraph mObjectGraph;

    @Override
    public void onCreate() {
        super.onCreate();

        mObjectGraph = ObjectGraph.create(new AppModule(this));
        mObjectGraph.plus(new TraktModule());
    }

    public static void inject(Context context) {
        ((TraktApp) context.getApplicationContext()).mObjectGraph.inject(context);
    }

    public static void inject(Context context, Object object) {
        ((TraktApp) context.getApplicationContext()).mObjectGraph.inject(object);
    }

    @Module(
            includes = {
                    TraktModule.class
            },

            injects = {
                    // Task queues
                    PriorityTraktTaskQueue.class,
                    TraktTaskQueue.class,

                    // Task schedulers
                    EpisodeTaskScheduler.class,
                    MovieTaskScheduler.class,
                    SeasonTaskScheduler.class,
                    ShowTaskScheduler.class,

                    // Activities
                    HomeActivity.class,

                    // Fragments
                    SearchShowFragment.class,
                    EpisodeFragment.class,
                    EpisodesWatchlistFragment.class,
                    LoginFragment.class,
                    MovieCollectionFragment.class,
                    MovieFragment.class,
                    MovieWatchlistFragment.class,
                    SearchMovieFragment.class,
                    SeasonFragment.class,
                    SeasonsFragment.class,
                    ShowInfoFragment.class,
                    ShowsCollectionFragment.class,
                    ShowsWatchlistFragment.class,
                    UpcomingShowsFragment.class,
                    WatchedMoviesFragment.class,
                    WatchedShowsFragment.class,

                    // Dialogs
                    RatingDialog.class,

                    // ListAdapters
                    EpisodeWatchlistAdapter.class,
                    SeasonsAdapter.class,
                    ShowsAdapter.class,
                    ShowSearchAdapter.class,
                    MoviesAdapter.class,
                    MovieSearchAdapter.class,

                    // Views
                    PhoneEpisodeView.class,
                    RemoteImageView.class,

                    // Services
                    TraktTaskService.class,

                    // Tasks
                    EpisodeCollectionTask.class,
                    EpisodeRateTask.class,
                    EpisodeWatchedTask.class,
                    MovieRateTask.class,
                    ShowRateTask.class,
                    SyncShowsCollectionTask.class,
                    SyncEpisodeTask.class,<commit_msg>Add SeasonAdapter to injections.<commit_after>package net.simonvt.trakt;

import dagger.Module;
import dagger.ObjectGraph;
import dagger.Provides;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.squareup.otto.Bus;
import com.squareup.picasso.Picasso;
import com.squareup.tape.ObjectQueue;

import net.simonvt.trakt.api.ApiKey;
import net.simonvt.trakt.api.ResponseParser;
import net.simonvt.trakt.api.TraktModule;
import net.simonvt.trakt.api.UserCredentials;
import net.simonvt.trakt.scheduler.EpisodeTaskScheduler;
import net.simonvt.trakt.scheduler.MovieTaskScheduler;
import net.simonvt.trakt.scheduler.SeasonTaskScheduler;
import net.simonvt.trakt.scheduler.ShowTaskScheduler;
import net.simonvt.trakt.settings.Settings;
import net.simonvt.trakt.sync.PriorityTraktTaskQueue;
import net.simonvt.trakt.sync.TraktTaskQueue;
import net.simonvt.trakt.sync.TraktTaskSerializer;
import net.simonvt.trakt.sync.TraktTaskService;
import net.simonvt.trakt.sync.task.EpisodeCollectionTask;
import net.simonvt.trakt.sync.task.EpisodeRateTask;
import net.simonvt.trakt.sync.task.EpisodeWatchedTask;
import net.simonvt.trakt.sync.task.MovieRateTask;
import net.simonvt.trakt.sync.task.ShowRateTask;
import net.simonvt.trakt.sync.task.SyncEpisodeTask;
import net.simonvt.trakt.sync.task.SyncEpisodeWatchlist;
import net.simonvt.trakt.sync.task.SyncMovieTask;
import net.simonvt.trakt.sync.task.SyncMoviesTask;
import net.simonvt.trakt.sync.task.SyncMoviesWatchlistTask;
import net.simonvt.trakt.sync.task.SyncSeasonTask;
import net.simonvt.trakt.sync.task.SyncShowTask;
import net.simonvt.trakt.sync.task.SyncShowsCollectionTask;
import net.simonvt.trakt.sync.task.SyncShowsTask;
import net.simonvt.trakt.sync.task.SyncShowsWatchlistTask;
import net.simonvt.trakt.sync.task.SyncTask;
import net.simonvt.trakt.sync.task.SyncWatchedStatusTask;
import net.simonvt.trakt.sync.task.TraktTask;
import net.simonvt.trakt.sync.task.UpdateSeasonCountTask;
import net.simonvt.trakt.sync.task.UpdateShowCountTask;
import net.simonvt.trakt.ui.HomeActivity;
import net.simonvt.trakt.ui.adapter.EpisodeWatchlistAdapter;
import net.simonvt.trakt.ui.adapter.MovieSearchAdapter;
import net.simonvt.trakt.ui.adapter.MoviesAdapter;
import net.simonvt.trakt.ui.adapter.SeasonAdapter;
import net.simonvt.trakt.ui.adapter.SeasonsAdapter;
import net.simonvt.trakt.ui.adapter.ShowSearchAdapter;
import net.simonvt.trakt.ui.adapter.ShowsAdapter;
import net.simonvt.trakt.ui.dialog.RatingDialog;
import net.simonvt.trakt.ui.fragment.EpisodeFragment;
import net.simonvt.trakt.ui.fragment.EpisodesWatchlistFragment;
import net.simonvt.trakt.ui.fragment.LoginFragment;
import net.simonvt.trakt.ui.fragment.MovieCollectionFragment;
import net.simonvt.trakt.ui.fragment.MovieFragment;
import net.simonvt.trakt.ui.fragment.MovieWatchlistFragment;
import net.simonvt.trakt.ui.fragment.SearchMovieFragment;
import net.simonvt.trakt.ui.fragment.SearchShowFragment;
import net.simonvt.trakt.ui.fragment.SeasonFragment;
import net.simonvt.trakt.ui.fragment.SeasonsFragment;
import net.simonvt.trakt.ui.fragment.ShowInfoFragment;
import net.simonvt.trakt.ui.fragment.ShowsCollectionFragment;
import net.simonvt.trakt.ui.fragment.ShowsWatchlistFragment;
import net.simonvt.trakt.ui.fragment.UpcomingShowsFragment;
import net.simonvt.trakt.ui.fragment.WatchedMoviesFragment;
import net.simonvt.trakt.ui.fragment.WatchedShowsFragment;
import net.simonvt.trakt.util.LogWrapper;
import net.simonvt.trakt.util.MovieSearchHandler;
import net.simonvt.trakt.util.ShowSearchHandler;
import net.simonvt.trakt.widget.PhoneEpisodeView;
import net.simonvt.trakt.widget.RemoteImageView;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import javax.inject.Singleton;

public class TraktApp extends Application {

    public static final boolean DEBUG = BuildConfig.DEBUG;

    private ObjectGraph mObjectGraph;

    @Override
    public void onCreate() {
        super.onCreate();

        mObjectGraph = ObjectGraph.create(new AppModule(this));
        mObjectGraph.plus(new TraktModule());
    }

    public static void inject(Context context) {
        ((TraktApp) context.getApplicationContext()).mObjectGraph.inject(context);
    }

    public static void inject(Context context, Object object) {
        ((TraktApp) context.getApplicationContext()).mObjectGraph.inject(object);
    }

    @Module(
            includes = {
                    TraktModule.class
            },

            injects = {
                    // Task queues
                    PriorityTraktTaskQueue.class,
                    TraktTaskQueue.class,

                    // Task schedulers
                    EpisodeTaskScheduler.class,
                    MovieTaskScheduler.class,
                    SeasonTaskScheduler.class,
                    ShowTaskScheduler.class,

                    // Activities
                    HomeActivity.class,

                    // Fragments
                    SearchShowFragment.class,
                    EpisodeFragment.class,
                    EpisodesWatchlistFragment.class,
                    LoginFragment.class,
                    MovieCollectionFragment.class,
                    MovieFragment.class,
                    MovieWatchlistFragment.class,
                    SearchMovieFragment.class,
                    SeasonFragment.class,
                    SeasonsFragment.class,
                    ShowInfoFragment.class,
                    ShowsCollectionFragment.class,
                    ShowsWatchlistFragment.class,
                    UpcomingShowsFragment.class,
                    WatchedMoviesFragment.class,
                    WatchedShowsFragment.class,

                    // Dialogs
                    RatingDialog.class,

                    // ListAdapters
                    EpisodeWatchlistAdapter.class,
                    SeasonAdapter.class,
                    SeasonsAdapter.class,
                    ShowsAdapter.class,
                    ShowSearchAdapter.class,
                    MoviesAdapter.class,
                    MovieSearchAdapter.class,

                    // Views
                    PhoneEpisodeView.class,
                    RemoteImageView.class,

                    // Services
                    TraktTaskService.class,

                    // Tasks
                    EpisodeCollectionTask.class,
                    EpisodeRateTask.class,
                    EpisodeWatchedTask.class,
                    MovieRateTask.class,
                    ShowRateTask.class,
                    SyncShowsCollectionTask.class,
                    SyncEpisodeTask.class,
{'fraction_non_alphanumeric': 0.08554748896040716, 'fraction_numerical': 0.0, 'mean_word_length': 2.683020948180816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2008118', 'n_tokens_mistral': 4023, 'n_tokens_neox': 3837, 'n_words': 499}