Search in sources :

Example 16 with PhilmMovie

use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.

the class MovieController method fetchDetailMovie.

private void fetchDetailMovie(final int callingId, String id) {
    Preconditions.checkNotNull(id, "id cannot be null");
    final PhilmMovie movie = mMoviesState.getMovie(id);
    if (movie != null) {
        fetchDetailMovieIfNeeded(callingId, movie, true);
    } else {
        // TODO Try and parse id to guess type
        fetchDetailMovieFromTrakt(callingId, id);
    }
}
Also used : PhilmMovie(app.philm.in.model.PhilmMovie)

Example 17 with PhilmMovie

use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.

the class MovieController method fetchMovieImages.

private void fetchMovieImages(final int callingId, String id) {
    Preconditions.checkNotNull(id, "id cannot be null");
    PhilmMovie movie = mMoviesState.getMovie(id);
    if (movie != null && movie.getTmdbId() != null) {
        executeTask(new FetchTmdbMovieImagesRunnable(callingId, movie.getTmdbId()));
    }
}
Also used : PhilmMovie(app.philm.in.model.PhilmMovie) FetchTmdbMovieImagesRunnable(app.philm.in.tasks.FetchTmdbMovieImagesRunnable)

Example 18 with PhilmMovie

use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.

the class MovieController method fetchDetailMovieFromTrakt.

private void fetchDetailMovieFromTrakt(final int callingId, String id) {
    Preconditions.checkNotNull(id, "id cannot be null");
    PhilmMovie movie = mMoviesState.getMovie(id);
    if (movie != null) {
        movie.markFullFetchStarted(PhilmModel.TYPE_TRAKT);
    }
    executeTask(new FetchTraktDetailMovieRunnable(callingId, id));
}
Also used : PhilmMovie(app.philm.in.model.PhilmMovie) FetchTraktDetailMovieRunnable(app.philm.in.tasks.FetchTraktDetailMovieRunnable)

Example 19 with PhilmMovie

use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.

the class MovieController method populateCheckinUi.

private void populateCheckinUi(MovieCheckinUi ui) {
    final PhilmMovie movie = mMoviesState.getMovie(ui.getRequestParameter());
    final PhilmUserProfile userProfile = mMoviesState.getUserProfile();
    if (movie != null) {
        ui.setMovie(movie);
        ui.showFacebookShare(userProfile != null && userProfile.isFacebookConnected());
        ui.showTwitterShare(userProfile != null && userProfile.isTwitterConnected());
        ui.showTumblrShare(userProfile != null && userProfile.isTumblrConnected());
        ui.showPathShare(userProfile != null && userProfile.isPathConnected());
        if (userProfile != null && userProfile.getDefaultShareMessage() != null) {
            ui.setShareText(userProfile.getDefaultShareMessage().replace(Constants.TRAKT_MESSAGE_ITEM_REPLACE, movie.getTitle()));
        }
    }
}
Also used : PhilmMovie(app.philm.in.model.PhilmMovie) PhilmUserProfile(app.philm.in.model.PhilmUserProfile)

Example 20 with PhilmMovie

use of app.philm.in.model.PhilmMovie in project philm by chrisbanes.

the class MovieController method fetchMovieImagesIfNeeded.

private void fetchMovieImagesIfNeeded(final int callingId, String id) {
    Preconditions.checkNotNull(id, "id cannot be null");
    PhilmMovie movie = mMoviesState.getMovie(id);
    if (movie != null && PhilmCollections.isEmpty(movie.getBackdropImages())) {
        fetchMovieImages(callingId, id);
    }
}
Also used : PhilmMovie(app.philm.in.model.PhilmMovie)

Aggregations

PhilmMovie (app.philm.in.model.PhilmMovie)39 MoviesState (app.philm.in.state.MoviesState)17 ArrayList (java.util.ArrayList)4 TextView (android.widget.TextView)2 WatchingMovie (app.philm.in.model.WatchingMovie)2 PhilmImageView (app.philm.in.view.PhilmImageView)2 SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1 Bitmap (android.graphics.Bitmap)1 Bundle (android.os.Bundle)1 View (android.view.View)1 Display (app.philm.in.Display)1 ColorScheme (app.philm.in.model.ColorScheme)1 PhilmMovieCredit (app.philm.in.model.PhilmMovieCredit)1 PhilmMovieVideo (app.philm.in.model.PhilmMovieVideo)1 PhilmPerson (app.philm.in.model.PhilmPerson)1 PhilmPersonCredit (app.philm.in.model.PhilmPersonCredit)1 PhilmUserProfile (app.philm.in.model.PhilmUserProfile)1 FetchTmdbDetailMovieRunnable (app.philm.in.tasks.FetchTmdbDetailMovieRunnable)1 FetchTmdbMovieImagesRunnable (app.philm.in.tasks.FetchTmdbMovieImagesRunnable)1 FetchTraktDetailMovieRunnable (app.philm.in.tasks.FetchTraktDetailMovieRunnable)1