├── .gitignore
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.txt
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ ├── fonts
│ │ ├── Roboto-Light.ttf
│ │ ├── RobotoCondensed-Bold.ttf
│ │ ├── RobotoCondensed-Light.ttf
│ │ ├── RobotoCondensed-Regular.ttf
│ │ └── RobotoSlab-Regular.ttf
│ └── licences.html
│ ├── java
│ └── app
│ │ └── philm
│ │ └── in
│ │ ├── AboutActivity.java
│ │ ├── AccountActivity.java
│ │ ├── AlarmReceiver.java
│ │ ├── AndroidConstants.java
│ │ ├── AndroidDisplay.java
│ │ ├── AndroidStringFetcher.java
│ │ ├── BasePhilmActivity.java
│ │ ├── MainActivity.java
│ │ ├── MovieActivity.java
│ │ ├── MovieImagesActivity.java
│ │ ├── PersonActivity.java
│ │ ├── PhilmApplication.java
│ │ ├── SettingsActivity.java
│ │ ├── account
│ │ ├── AndroidAccountManager.java
│ │ ├── PhilmAccountAuthenticator.java
│ │ └── PhilmAuthenticatorService.java
│ │ ├── adapters
│ │ ├── AboutListAdapter.java
│ │ ├── BasePhilmSectionedListAdapter.java
│ │ ├── MovieCreditSectionedListAdapter.java
│ │ ├── MovieGridAdapter.java
│ │ ├── MovieSectionedListAdapter.java
│ │ ├── PersonCreditSectionedListAdapter.java
│ │ └── PersonSectionedListAdapter.java
│ │ ├── drawable
│ │ ├── DrawableTintUtils.java
│ │ └── PercentageDrawable.java
│ │ ├── fragments
│ │ ├── AboutFragment.java
│ │ ├── CancelCheckinMovieFragment.java
│ │ ├── CheckinMovieFragment.java
│ │ ├── CredentialsChangedFragment.java
│ │ ├── DiscoverTabFragment.java
│ │ ├── InTheatresMoviesFragment.java
│ │ ├── LibraryMoviesFragment.java
│ │ ├── LicencesFragment.java
│ │ ├── LoginFragment.java
│ │ ├── MovieCastListFragment.java
│ │ ├── MovieCrewListFragment.java
│ │ ├── MovieDetailFragment.java
│ │ ├── MovieImagesFragment.java
│ │ ├── MovieSearchListFragment.java
│ │ ├── PersonCastListFragment.java
│ │ ├── PersonCrewListFragment.java
│ │ ├── PersonDetailFragment.java
│ │ ├── PersonSearchListFragment.java
│ │ ├── PopularMoviesFragment.java
│ │ ├── RateMovieFragment.java
│ │ ├── RecommendedMoviesFragment.java
│ │ ├── RelatedMoviesFragment.java
│ │ ├── SearchFragment.java
│ │ ├── SettingsFragment.java
│ │ ├── SideMenuFragment.java
│ │ ├── TrendingMoviesFragment.java
│ │ ├── UpcomingMoviesFragment.java
│ │ ├── WatchlistMoviesFragment.java
│ │ └── base
│ │ │ ├── BaseDetailFragment.java
│ │ │ ├── BaseMovieControllerListFragment.java
│ │ │ ├── BaseMovieCreditListFragment.java
│ │ │ ├── BasePersonCreditListFragment.java
│ │ │ ├── BasePhilmFragment.java
│ │ │ ├── BasePhilmMovieDialogFragment.java
│ │ │ ├── BasePhilmMovieFragment.java
│ │ │ ├── BasePhilmMovieListFragment.java
│ │ │ ├── BasePhilmTabFragment.java
│ │ │ ├── ListFragment.java
│ │ │ ├── MovieGridFragment.java
│ │ │ ├── MovieListFragment.java
│ │ │ └── PersonListFragment.java
│ │ ├── modules
│ │ ├── ApplicationModule.java
│ │ ├── ReceiverProvider.java
│ │ ├── TaskProvider.java
│ │ ├── ViewUtilProvider.java
│ │ └── library
│ │ │ ├── AccountsProvider.java
│ │ │ ├── ContextProvider.java
│ │ │ ├── InjectorModule.java
│ │ │ ├── NetworkProvider.java
│ │ │ ├── PersistenceProvider.java
│ │ │ ├── StateProvider.java
│ │ │ └── UtilProvider.java
│ │ ├── network
│ │ ├── PhilmTmdb.java
│ │ └── PhilmTrakt.java
│ │ ├── qualifiers
│ │ ├── ApplicationContext.java
│ │ ├── CacheDirectory.java
│ │ └── FilesDirectory.java
│ │ ├── state
│ │ └── PhilmSQLiteOpenHelper.java
│ │ ├── util
│ │ ├── ActivityTransitions.java
│ │ ├── AndroidCountryProvider.java
│ │ ├── AndroidFileManager.java
│ │ ├── AndroidLogger.java
│ │ ├── AndroidPhilmAlarmManager.java
│ │ ├── AndroidPhilmPreferences.java
│ │ ├── AnimationUtils.java
│ │ ├── AppUtils.java
│ │ ├── ColorUtils.java
│ │ ├── ColorValueAnimator.java
│ │ ├── FlagUrlProvider.java
│ │ ├── PhilmBackgroundExecutor.java
│ │ ├── PhilmTypefaceSpan.java
│ │ ├── TypefaceManager.java
│ │ └── ViewUtils.java
│ │ └── view
│ │ ├── AutofitTextView.java
│ │ ├── BackdropImageView.java
│ │ ├── CheatSheet.java
│ │ ├── CheckableImageButton.java
│ │ ├── CollapsingTitleLayout.java
│ │ ├── ColorSchemable.java
│ │ ├── ExpandingTextView.java
│ │ ├── FloatLabelLayout.java
│ │ ├── FontTextView.java
│ │ ├── ForegroundLinearLayout.java
│ │ ├── HackyViewPager.java
│ │ ├── InsetsLinearLayout.java
│ │ ├── MovieDetailCardLayout.java
│ │ ├── MovieDetailInfoLayout.java
│ │ ├── PhilmImageView.java
│ │ ├── PinnedSectionListView.java
│ │ ├── RatingBarLayout.java
│ │ ├── RatingCircleView.java
│ │ ├── StringManager.java
│ │ └── ViewRecycler.java
│ └── res
│ ├── color
│ ├── default_button.xml
│ ├── float_label.xml
│ └── tab_text.xml
│ ├── drawable-hdpi
│ ├── drawer_shadow.9.png
│ ├── ic_action_collection.png
│ ├── ic_action_filter.png
│ ├── ic_action_watchlist.png
│ ├── ic_back.png
│ ├── ic_btn_checkin.png
│ ├── ic_btn_collection.png
│ ├── ic_btn_movie.png
│ ├── ic_btn_search.png
│ ├── ic_btn_seen.png
│ ├── ic_btn_user.png
│ ├── ic_btn_watchlist.png
│ ├── ic_launcher.png
│ ├── ic_login.png
│ ├── ic_menu.png
│ ├── philmcolor_btn_rating_star_off_focused_holo_light.png
│ ├── philmcolor_btn_rating_star_off_normal_holo_light.png
│ ├── philmcolor_btn_rating_star_off_pressed_holo_light.png
│ ├── philmcolor_btn_rating_star_on_focused_holo_light.png
│ ├── philmcolor_btn_rating_star_on_normal_holo_light.png
│ └── philmcolor_btn_rating_star_on_pressed_holo_light.png
│ ├── drawable-mdpi
│ ├── drawer_shadow.9.png
│ ├── ic_action_collection.png
│ ├── ic_action_filter.png
│ ├── ic_action_watchlist.png
│ ├── ic_back.png
│ ├── ic_btn_checkin.png
│ ├── ic_btn_collection.png
│ ├── ic_btn_movie.png
│ ├── ic_btn_search.png
│ ├── ic_btn_seen.png
│ ├── ic_btn_user.png
│ ├── ic_btn_watchlist.png
│ ├── ic_launcher.png
│ ├── ic_login.png
│ ├── ic_menu.png
│ ├── philmcolor_btn_rating_star_off_focused_holo_light.png
│ ├── philmcolor_btn_rating_star_off_normal_holo_light.png
│ ├── philmcolor_btn_rating_star_off_pressed_holo_light.png
│ ├── philmcolor_btn_rating_star_on_focused_holo_light.png
│ ├── philmcolor_btn_rating_star_on_normal_holo_light.png
│ └── philmcolor_btn_rating_star_on_pressed_holo_light.png
│ ├── drawable-xhdpi
│ ├── drawer_shadow.9.png
│ ├── ic_action_collection.png
│ ├── ic_action_filter.png
│ ├── ic_action_watchlist.png
│ ├── ic_back.png
│ ├── ic_btn_checkin.png
│ ├── ic_btn_collection.png
│ ├── ic_btn_movie.png
│ ├── ic_btn_search.png
│ ├── ic_btn_seen.png
│ ├── ic_btn_user.png
│ ├── ic_btn_watchlist.png
│ ├── ic_launcher.png
│ ├── ic_login.png
│ ├── ic_menu.png
│ ├── ic_profile_placeholder.png
│ ├── philmcolor_btn_rating_star_off_focused_holo_light.png
│ ├── philmcolor_btn_rating_star_off_normal_holo_light.png
│ ├── philmcolor_btn_rating_star_off_pressed_holo_light.png
│ ├── philmcolor_btn_rating_star_on_focused_holo_light.png
│ ├── philmcolor_btn_rating_star_on_normal_holo_light.png
│ └── philmcolor_btn_rating_star_on_pressed_holo_light.png
│ ├── drawable-xxhdpi
│ ├── drawer_shadow.9.png
│ ├── ic_action_collection.png
│ ├── ic_action_filter.png
│ ├── ic_action_watchlist.png
│ ├── ic_back.png
│ ├── ic_btn_checkin.png
│ ├── ic_btn_collection.png
│ ├── ic_btn_movie.png
│ ├── ic_btn_search.png
│ ├── ic_btn_seen.png
│ ├── ic_btn_user.png
│ ├── ic_btn_watchlist.png
│ ├── ic_launcher.png
│ ├── ic_login.png
│ ├── ic_menu.png
│ ├── philmcolor_btn_rating_star_off_focused_holo_light.png
│ ├── philmcolor_btn_rating_star_off_normal_holo_light.png
│ ├── philmcolor_btn_rating_star_off_pressed_holo_light.png
│ ├── philmcolor_btn_rating_star_on_focused_holo_light.png
│ ├── philmcolor_btn_rating_star_on_normal_holo_light.png
│ └── philmcolor_btn_rating_star_on_pressed_holo_light.png
│ ├── drawable-xxxhdpi
│ ├── ic_action_collection.png
│ ├── ic_action_filter.png
│ ├── ic_action_watchlist.png
│ ├── ic_back.png
│ ├── ic_btn_collection.png
│ ├── ic_btn_movie.png
│ ├── ic_btn_search.png
│ ├── ic_btn_seen.png
│ ├── ic_btn_watchlist.png
│ ├── ic_launcher.png
│ ├── ic_login.png
│ └── ic_menu.png
│ ├── drawable
│ ├── black_translucent_gradient.xml
│ ├── ic_search.xml
│ ├── philmcolor_ratingbar_full_empty_holo_light.xml
│ ├── philmcolor_ratingbar_full_filled_holo_light.xml
│ └── philmcolor_ratingbar_full_holo_light.xml
│ ├── layout-w720dp
│ └── fragment_detail_list.xml
│ ├── layout
│ ├── activity_about.xml
│ ├── activity_account.xml
│ ├── activity_main.xml
│ ├── activity_no_drawer.xml
│ ├── fragment_cancel_checkin_movie.xml
│ ├── fragment_checkin_movie.xml
│ ├── fragment_detail_list.xml
│ ├── fragment_drawer.xml
│ ├── fragment_login.xml
│ ├── fragment_movie_detail_list.xml
│ ├── fragment_movie_images.xml
│ ├── fragment_rate_movie.xml
│ ├── fragment_viewpager.xml
│ ├── include_drawer_add_account.xml
│ ├── include_drawer_profile.xml
│ ├── include_fragment_detail_list.xml
│ ├── include_imageview_flag.xml
│ ├── include_movie_detail_card.xml
│ ├── include_rating_bar.xml
│ ├── include_toolbar.xml
│ ├── item_about.xml
│ ├── item_drawer.xml
│ ├── item_grid_movie.xml
│ ├── item_list_2line.xml
│ ├── item_list_3line.xml
│ ├── item_list_movie_section_header.xml
│ ├── item_movie_detail_buttons.xml
│ ├── item_movie_detail_details_line.xml
│ ├── item_movie_detail_generic_card.xml
│ ├── item_movie_detail_list_1line.xml
│ ├── item_movie_detail_list_2line.xml
│ ├── item_movie_detail_list_3line.xml
│ ├── item_movie_detail_rating.xml
│ ├── item_movie_detail_summary.xml
│ ├── item_movie_detail_title.xml
│ ├── item_movie_detail_trailers.xml
│ ├── item_movie_image.xml
│ ├── item_movie_trailer.xml
│ ├── item_person_detail_title.xml
│ ├── simple_list_item_activated.xml
│ ├── view_grid.xml
│ ├── view_list.xml
│ └── view_pinned_list.xml
│ ├── menu
│ ├── cab_movies.xml
│ ├── main.xml
│ ├── movies.xml
│ ├── movies_detail.xml
│ └── movies_search.xml
│ ├── values-sw600dp
│ ├── dimens.xml
│ └── integers.xml
│ ├── values-sw720dp
│ └── dimens.xml
│ ├── values-v21
│ ├── flags.xml
│ ├── styles.xml
│ └── themes.xml
│ ├── values
│ ├── attrs.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── flags.xml
│ ├── ids.xml
│ ├── integers.xml
│ ├── plurals.xml
│ ├── styles.xml
│ └── themes.xml
│ └── xml
│ ├── authenticator.xml
│ └── main_preferences.xml
├── art
├── large_logo.png
└── logo.psd
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── lib
├── build.gradle
├── libs
│ ├── tmdb-java-philm.jar
│ └── trakt-java-philm.jar
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── app
│ │ └── philm
│ │ └── in
│ │ ├── Constants.java
│ │ ├── Display.java
│ │ ├── accounts
│ │ └── PhilmAccountManager.java
│ │ ├── controllers
│ │ ├── AboutController.java
│ │ ├── BaseController.java
│ │ ├── BaseUiController.java
│ │ ├── MainController.java
│ │ ├── MovieController.java
│ │ └── UserController.java
│ │ ├── model
│ │ ├── ColorScheme.java
│ │ ├── ListItem.java
│ │ ├── PhilmAccount.java
│ │ ├── PhilmModel.java
│ │ ├── PhilmMovie.java
│ │ ├── PhilmMovieCredit.java
│ │ ├── PhilmMovieVideo.java
│ │ ├── PhilmPerson.java
│ │ ├── PhilmPersonCredit.java
│ │ ├── PhilmUserProfile.java
│ │ ├── TmdbConfiguration.java
│ │ └── WatchingMovie.java
│ │ ├── network
│ │ ├── BackgroundCallRunnable.java
│ │ ├── NetworkCallRunnable.java
│ │ └── NetworkError.java
│ │ ├── qualifiers
│ │ ├── ForDatabase.java
│ │ └── GeneralPurpose.java
│ │ ├── state
│ │ ├── ApplicationState.java
│ │ ├── AsyncDatabaseHelper.java
│ │ ├── AsyncDatabaseHelperImpl.java
│ │ ├── BaseState.java
│ │ ├── DatabaseHelper.java
│ │ ├── MoviesState.java
│ │ ├── UserState.java
│ │ └── mappers
│ │ │ ├── BaseEntityMapper.java
│ │ │ ├── MovieEntityMapper.java
│ │ │ ├── TmdbCastEntityMapper.java
│ │ │ ├── TmdbCrewEntityMapper.java
│ │ │ ├── TmdbMovieEntityMapper.java
│ │ │ ├── TmdbPersonEntityMapper.java
│ │ │ └── TraktMovieEntityMapper.java
│ │ ├── tasks
│ │ ├── AddToTraktCollectionRunnable.java
│ │ ├── AddToTraktWatchlistRunnable.java
│ │ ├── BaseMovieRunnable.java
│ │ ├── BaseTmdbPaginatedMovieRunnable.java
│ │ ├── BaseTmdbPaginatedPersonRunnable.java
│ │ ├── BaseTmdbPaginatedRunnable.java
│ │ ├── BaseTraktActionRunnable.java
│ │ ├── CancelCheckinTraktRunnable.java
│ │ ├── CheckinTraktRunnable.java
│ │ ├── FetchTmdbConfigurationRunnable.java
│ │ ├── FetchTmdbDetailMovieRunnable.java
│ │ ├── FetchTmdbMovieCreditsRunnable.java
│ │ ├── FetchTmdbMovieImagesRunnable.java
│ │ ├── FetchTmdbMovieTrailersRunnable.java
│ │ ├── FetchTmdbMoviesReleasesRunnable.java
│ │ ├── FetchTmdbNowPlayingRunnable.java
│ │ ├── FetchTmdbPersonCreditsRunnable.java
│ │ ├── FetchTmdbPersonRunnable.java
│ │ ├── FetchTmdbPopularRunnable.java
│ │ ├── FetchTmdbRelatedMoviesRunnable.java
│ │ ├── FetchTmdbSearchMoviesRunnable.java
│ │ ├── FetchTmdbSearchPeopleRunnable.java
│ │ ├── FetchTmdbUpcomingRunnable.java
│ │ ├── FetchTraktDetailMovieRunnable.java
│ │ ├── FetchTraktLibraryRunnable.java
│ │ ├── FetchTraktRecommendationsRunnable.java
│ │ ├── FetchTraktRelatedMoviesRunnable.java
│ │ ├── FetchTraktTrendingRunnable.java
│ │ ├── FetchTraktWatchingRunnable.java
│ │ ├── FetchTraktWatchlistRunnable.java
│ │ ├── MarkTraktMovieSeenRunnable.java
│ │ ├── MarkTraktMovieUnseenRunnable.java
│ │ ├── RemoveFromTraktCollectionRunnable.java
│ │ ├── RemoveFromTraktWatchlistRunnable.java
│ │ └── SubmitTraktMovieRatingRunnable.java
│ │ ├── trakt
│ │ └── TraktUtils.java
│ │ └── util
│ │ ├── BackgroundExecutor.java
│ │ ├── CountryProvider.java
│ │ ├── FileManager.java
│ │ ├── FloatUtils.java
│ │ ├── ImageHelper.java
│ │ ├── Injector.java
│ │ ├── IntUtils.java
│ │ ├── Logger.java
│ │ ├── PhilmAlarmManager.java
│ │ ├── PhilmCollections.java
│ │ ├── PhilmPreferences.java
│ │ ├── Sha1.java
│ │ ├── StringFetcher.java
│ │ ├── TextUtils.java
│ │ └── TimeUtils.java
│ └── res
│ ├── values-de
│ └── strings.xml
│ ├── values-es
│ └── strings.xml
│ ├── values-fr
│ └── strings.xml
│ ├── values-it
│ └── strings.xml
│ ├── values-ru
│ └── strings.xml
│ ├── values-zh
│ └── strings.xml
│ └── values
│ └── strings.xml
├── release
└── philm-0.6.apk
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | local.properties
3 | .DS_Store
4 | signing.properties
5 |
6 | # build files
7 | build
8 | bin
9 | gen
10 |
11 | # IntelliJ
12 | *.iml
13 | .idea
14 |
15 | # Crashlytics
16 | com_crashlytics_export_strings.xml
17 | crashlytics-build.properties
18 | crashlytics.properties
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Philm
2 |
3 | ## License
4 |
5 | Copyright 2014 Chris Banes
6 |
7 | Licensed under the Apache License, Version 2.0 (the "License");
8 | you may not use this file except in compliance with the License.
9 | You may obtain a copy of the License at
10 |
11 | http://www.apache.org/licenses/LICENSE-2.0
12 |
13 | Unless required by applicable law or agreed to in writing, software
14 | distributed under the License is distributed on an "AS IS" BASIS,
15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | See the License for the specific language governing permissions and
17 | limitations under the License.
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/proguard-rules.txt:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/chris/bin/android-sdk-macosx/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the ProGuard
5 | # include property in project.properties.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | -keepclassmembers class ** {
20 | @com.squareup.otto.Subscribe public *;
21 | @com.squareup.otto.Produce public *;
22 | }
23 |
24 | -keep class com.google.gson.** { *; }
25 | -keep class com.google.inject.** { *; }
26 | -keep class org.apache.http.** { *; }
27 | -keep class org.apache.james.mime4j.** { *; }
28 | -keep class javax.inject.** { *; }
29 | -keep class retrofit.** { *; }
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/Roboto-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/assets/fonts/Roboto-Light.ttf
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/RobotoCondensed-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/assets/fonts/RobotoCondensed-Bold.ttf
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/RobotoCondensed-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/assets/fonts/RobotoCondensed-Light.ttf
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/RobotoCondensed-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/assets/fonts/RobotoCondensed-Regular.ttf
--------------------------------------------------------------------------------
/app/src/main/assets/fonts/RobotoSlab-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/assets/fonts/RobotoSlab-Regular.ttf
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/AboutActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in;
18 |
19 | import android.content.Intent;
20 | import android.os.Bundle;
21 | import android.support.v7.app.ActionBar;
22 |
23 | public class AboutActivity extends BasePhilmActivity {
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 |
29 | final ActionBar ab = getSupportActionBar();
30 | if (ab != null) {
31 | ab.setDisplayHomeAsUpEnabled(true);
32 | ab.setHomeButtonEnabled(true);
33 | }
34 | }
35 |
36 | @Override
37 | protected int getContentViewLayoutId() {
38 | return R.layout.activity_about;
39 | }
40 |
41 | @Override
42 | protected void handleIntent(Intent intent, Display display) {
43 | if (!display.hasMainFragment()) {
44 | display.showAboutFragment();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/AlarmReceiver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in;
18 |
19 | import android.content.BroadcastReceiver;
20 | import android.content.Context;
21 | import android.content.Intent;
22 |
23 | import com.google.common.base.Preconditions;
24 |
25 | import javax.inject.Inject;
26 |
27 | import app.philm.in.util.AndroidPhilmAlarmManager;
28 |
29 | public class AlarmReceiver extends BroadcastReceiver {
30 |
31 | @Inject AndroidPhilmAlarmManager mPhilmAlarmManager;
32 |
33 | @Override
34 | public void onReceive(Context context, Intent intent) {
35 | PhilmApplication.from(context).inject(this);
36 | Preconditions.checkNotNull(mPhilmAlarmManager, "mPhilmAlarmManager cannot be null");
37 |
38 | mPhilmAlarmManager.onAlarmTriggered(intent);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/AndroidConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in;
18 |
19 | public class AndroidConstants {
20 |
21 | public static final boolean STRICT_MODE = false;
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/AndroidStringFetcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in;
18 |
19 | import android.content.Context;
20 |
21 | import com.google.common.base.Preconditions;
22 |
23 | import app.philm.in.util.StringFetcher;
24 |
25 | public class AndroidStringFetcher implements StringFetcher {
26 |
27 | private final Context mContext;
28 |
29 | public AndroidStringFetcher(Context context) {
30 | mContext = Preconditions.checkNotNull(context, "context cannot be null");
31 | }
32 |
33 | @Override
34 | public String getString(int id) {
35 | return mContext.getString(id);
36 | }
37 |
38 | @Override
39 | public String getString(int id, Object... format) {
40 | return mContext.getString(id, format);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/MovieActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in;
18 |
19 | import android.content.Intent;
20 |
21 | public class MovieActivity extends BasePhilmActivity {
22 |
23 | @Override
24 | protected int getContentViewLayoutId() {
25 | return R.layout.activity_no_drawer;
26 | }
27 |
28 | @Override
29 | protected void handleIntent(Intent intent, Display display) {
30 | if (!display.hasMainFragment()) {
31 | display.showMovieDetailFragment(intent.getStringExtra(Display.PARAM_ID));
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/MovieImagesActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in;
18 |
19 | import android.content.Intent;
20 |
21 | public class MovieImagesActivity extends BasePhilmActivity {
22 |
23 | @Override
24 | protected Intent getParentIntent() {
25 | final Intent thisIntent = getIntent();
26 |
27 | final Intent intent = super.getParentIntent();
28 | intent.putExtra(Display.PARAM_ID, thisIntent.getStringExtra(Display.PARAM_ID));
29 |
30 | return intent;
31 | }
32 |
33 | @Override
34 | protected void handleIntent(Intent intent, Display display) {
35 | if (!display.hasMainFragment()) {
36 | display.showMovieImagesFragment(intent.getStringExtra(Display.PARAM_ID));
37 | }
38 | }
39 |
40 | @Override
41 | protected int getContentViewLayoutId() {
42 | return R.layout.activity_no_drawer;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/PersonActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in;
18 |
19 | import android.content.Intent;
20 |
21 | public class PersonActivity extends BasePhilmActivity {
22 |
23 | @Override
24 | protected int getContentViewLayoutId() {
25 | return R.layout.activity_no_drawer;
26 | }
27 |
28 | @Override
29 | protected void handleIntent(Intent intent, Display display) {
30 | if (!display.hasMainFragment()) {
31 | display.showPersonDetail(intent.getStringExtra(Display.PARAM_ID));
32 | }
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/SettingsActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in;
18 |
19 | import android.app.Activity;
20 | import android.os.Bundle;
21 |
22 | import app.philm.in.fragments.SettingsFragment;
23 |
24 | public class SettingsActivity extends Activity {
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 |
30 | getFragmentManager().beginTransaction()
31 | .replace(android.R.id.content, new SettingsFragment())
32 | .commit();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/account/PhilmAuthenticatorService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.account;
18 |
19 | import android.app.Service;
20 | import android.content.Intent;
21 | import android.os.IBinder;
22 |
23 | public class PhilmAuthenticatorService extends Service {
24 |
25 | private PhilmAccountAuthenticator mPhilmAccountAuthenticator;
26 |
27 | @Override
28 | public void onCreate() {
29 | super.onCreate();
30 | mPhilmAccountAuthenticator = new PhilmAccountAuthenticator(this);
31 | }
32 |
33 | @Override
34 | public IBinder onBind(Intent intent) {
35 | return mPhilmAccountAuthenticator.getIBinder();
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/drawable/DrawableTintUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.drawable;
18 |
19 | import android.content.Context;
20 | import android.content.res.ColorStateList;
21 | import android.graphics.drawable.Drawable;
22 | import android.support.annotation.ColorRes;
23 | import android.support.annotation.DrawableRes;
24 | import android.support.annotation.NonNull;
25 | import android.support.v4.content.ContextCompat;
26 | import android.support.v4.graphics.drawable.DrawableCompat;
27 | import android.support.v7.content.res.AppCompatResources;
28 |
29 | public class DrawableTintUtils {
30 |
31 | public static Drawable createFromColorRes(@NonNull Context context,
32 | @DrawableRes int drawableId, @ColorRes int colorId) {
33 | Drawable d = ContextCompat.getDrawable(context, drawableId);
34 | d = DrawableCompat.wrap(d.mutate());
35 |
36 | ColorStateList tint = AppCompatResources.getColorStateList(context, colorId);
37 | DrawableCompat.setTintList(d, tint);
38 | return d;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/fragments/InTheatresMoviesFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.fragments;
18 |
19 |
20 | import app.philm.in.controllers.MovieController;
21 | import app.philm.in.fragments.base.MovieGridFragment;
22 |
23 | public class InTheatresMoviesFragment extends MovieGridFragment implements MovieController.SubUi {
24 |
25 | @Override
26 | public MovieController.MovieQueryType getMovieQueryType() {
27 | return MovieController.MovieQueryType.NOW_PLAYING;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/fragments/LibraryMoviesFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.fragments;
18 |
19 |
20 | import app.philm.in.controllers.MovieController;
21 | import app.philm.in.fragments.base.MovieGridFragment;
22 |
23 | public class LibraryMoviesFragment extends MovieGridFragment {
24 |
25 | @Override
26 | public MovieController.MovieQueryType getMovieQueryType() {
27 | return MovieController.MovieQueryType.LIBRARY;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/fragments/MovieSearchListFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.fragments;
18 |
19 | import app.philm.in.controllers.MovieController;
20 | import app.philm.in.fragments.base.MovieListFragment;
21 |
22 | public class MovieSearchListFragment extends MovieListFragment
23 | implements MovieController.SearchMovieUi {
24 |
25 | @Override
26 | public MovieController.MovieQueryType getMovieQueryType() {
27 | return MovieController.MovieQueryType.SEARCH_MOVIES;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/fragments/PersonSearchListFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.fragments;
18 |
19 | import app.philm.in.controllers.MovieController;
20 | import app.philm.in.fragments.base.PersonListFragment;
21 |
22 | public class PersonSearchListFragment extends PersonListFragment
23 | implements MovieController.SearchPersonUi {
24 |
25 | @Override
26 | public MovieController.MovieQueryType getMovieQueryType() {
27 | return MovieController.MovieQueryType.SEARCH_PEOPLE;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/fragments/PopularMoviesFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.fragments;
18 |
19 |
20 | import app.philm.in.controllers.MovieController;
21 | import app.philm.in.fragments.base.MovieGridFragment;
22 |
23 | public class PopularMoviesFragment extends MovieGridFragment implements MovieController.SubUi {
24 |
25 | @Override
26 | public MovieController.MovieQueryType getMovieQueryType() {
27 | return MovieController.MovieQueryType.POPULAR;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/fragments/RecommendedMoviesFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.fragments;
18 |
19 |
20 | import app.philm.in.controllers.MovieController;
21 | import app.philm.in.fragments.base.MovieGridFragment;
22 |
23 | public class RecommendedMoviesFragment extends MovieGridFragment implements MovieController.SubUi {
24 |
25 | @Override
26 | public MovieController.MovieQueryType getMovieQueryType() {
27 | return MovieController.MovieQueryType.RECOMMENDED;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/fragments/SettingsFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.fragments;
18 |
19 | import android.os.Bundle;
20 | import android.preference.PreferenceFragment;
21 |
22 | import app.philm.in.R;
23 |
24 | public class SettingsFragment extends PreferenceFragment {
25 |
26 | @Override
27 | public void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | addPreferencesFromResource(R.xml.main_preferences);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/fragments/TrendingMoviesFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.fragments;
18 |
19 |
20 | import app.philm.in.controllers.MovieController;
21 | import app.philm.in.fragments.base.MovieGridFragment;
22 |
23 | public class TrendingMoviesFragment extends MovieGridFragment {
24 |
25 | @Override
26 | public MovieController.MovieQueryType getMovieQueryType() {
27 | return MovieController.MovieQueryType.TRENDING;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/fragments/UpcomingMoviesFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.fragments;
18 |
19 |
20 | import app.philm.in.controllers.MovieController;
21 | import app.philm.in.fragments.base.MovieGridFragment;
22 |
23 | public class UpcomingMoviesFragment extends MovieGridFragment implements MovieController.SubUi {
24 |
25 | @Override
26 | public MovieController.MovieQueryType getMovieQueryType() {
27 | return MovieController.MovieQueryType.UPCOMING;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/fragments/WatchlistMoviesFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.fragments;
18 |
19 |
20 | import app.philm.in.controllers.MovieController;
21 | import app.philm.in.fragments.base.MovieListFragment;
22 |
23 | public class WatchlistMoviesFragment extends MovieListFragment {
24 |
25 | @Override
26 | public MovieController.MovieQueryType getMovieQueryType() {
27 | return MovieController.MovieQueryType.WATCHLIST;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/modules/ApplicationModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.modules;
18 |
19 |
20 | import app.philm.in.PhilmApplication;
21 | import app.philm.in.modules.library.AccountsProvider;
22 | import app.philm.in.modules.library.InjectorModule;
23 | import app.philm.in.modules.library.NetworkProvider;
24 | import app.philm.in.modules.library.PersistenceProvider;
25 | import app.philm.in.modules.library.StateProvider;
26 | import app.philm.in.modules.library.UtilProvider;
27 | import dagger.Module;
28 |
29 | @Module(
30 | injects = PhilmApplication.class,
31 | includes = {
32 | UtilProvider.class,
33 | AccountsProvider.class,
34 | NetworkProvider.class,
35 | StateProvider.class,
36 | PersistenceProvider.class,
37 | InjectorModule.class
38 | }
39 | )
40 | public class ApplicationModule {
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/modules/ReceiverProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.modules;
18 |
19 | import app.philm.in.AlarmReceiver;
20 | import app.philm.in.modules.library.ContextProvider;
21 | import app.philm.in.modules.library.UtilProvider;
22 | import dagger.Module;
23 |
24 | @Module(
25 | injects = {
26 | AlarmReceiver.class
27 | },
28 | includes = {
29 | ContextProvider.class,
30 | UtilProvider.class
31 | }
32 | )
33 | public class ReceiverProvider {
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/modules/library/AccountsProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.modules.library;
18 |
19 | import android.accounts.AccountManager;
20 |
21 | import javax.inject.Singleton;
22 |
23 | import app.philm.in.account.AndroidAccountManager;
24 | import app.philm.in.accounts.PhilmAccountManager;
25 | import dagger.Module;
26 | import dagger.Provides;
27 |
28 | @Module(
29 | includes = ContextProvider.class,
30 | library = true
31 | )
32 | public class AccountsProvider {
33 |
34 | @Provides @Singleton
35 | public PhilmAccountManager provideAccountManager(AccountManager androidAccountManager) {
36 | return new AndroidAccountManager(androidAccountManager);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/modules/library/InjectorModule.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.modules.library;
18 |
19 | import com.google.common.base.Preconditions;
20 |
21 | import app.philm.in.util.Injector;
22 | import dagger.Module;
23 | import dagger.Provides;
24 |
25 | @Module(
26 | library = true
27 | )
28 | public class InjectorModule {
29 |
30 | private final Injector mInjector;
31 |
32 | public InjectorModule(Injector injector) {
33 | mInjector = Preconditions.checkNotNull(injector, "injector cannot be null");
34 | }
35 |
36 | @Provides
37 | public Injector provideMainInjector() {
38 | return mInjector;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/modules/library/StateProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.modules.library;
18 |
19 | import com.squareup.otto.Bus;
20 |
21 | import javax.inject.Singleton;
22 |
23 | import app.philm.in.state.ApplicationState;
24 | import app.philm.in.state.MoviesState;
25 | import app.philm.in.state.UserState;
26 | import dagger.Module;
27 | import dagger.Provides;
28 |
29 | @Module(
30 | library = true,
31 | includes = UtilProvider.class
32 | )
33 | public class StateProvider {
34 |
35 | @Provides @Singleton
36 | public ApplicationState provideApplicationState(Bus bus) {
37 | return new ApplicationState(bus);
38 | }
39 |
40 | @Provides
41 | public MoviesState provideMovieState(ApplicationState state) {
42 | return state;
43 | }
44 |
45 | @Provides
46 | public UserState provideUserState(ApplicationState state) {
47 | return state;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/network/PhilmTmdb.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.network;
18 |
19 | import com.jakewharton.retrofit.Ok3Client;
20 | import com.uwetrottmann.tmdb.Tmdb;
21 |
22 | import java.io.File;
23 |
24 | import okhttp3.Cache;
25 | import okhttp3.OkHttpClient;
26 | import retrofit.RestAdapter;
27 |
28 | public class PhilmTmdb extends Tmdb {
29 |
30 | private static final String TAG = "PhilmTmdb";
31 |
32 | private static final int CACHE_SIZE = 10 * 1024 * 1024;
33 |
34 | private final File mCacheLocation;
35 |
36 | public PhilmTmdb(File cacheLocation) {
37 | mCacheLocation = cacheLocation;
38 | }
39 |
40 | @Override
41 | protected RestAdapter.Builder newRestAdapterBuilder() {
42 | RestAdapter.Builder b = super.newRestAdapterBuilder();
43 |
44 | if (mCacheLocation != null) {
45 | File cacheDir = new File(mCacheLocation, "tmdb_requests");
46 | Cache cache = new Cache(cacheDir, CACHE_SIZE);
47 |
48 | OkHttpClient client = new OkHttpClient.Builder()
49 | .cache(cache)
50 | .build();
51 |
52 | b.setClient(new Ok3Client(client));
53 | }
54 |
55 | return b;
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/qualifiers/ApplicationContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.qualifiers;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 |
23 | import javax.inject.Qualifier;
24 |
25 | @Qualifier
26 | @Documented
27 | @Retention(RetentionPolicy.RUNTIME)
28 | public @interface ApplicationContext {
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/qualifiers/CacheDirectory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.qualifiers;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 |
23 | import javax.inject.Qualifier;
24 |
25 | @Qualifier
26 | @Documented
27 | @Retention(RetentionPolicy.RUNTIME)
28 | public @interface CacheDirectory {
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/qualifiers/FilesDirectory.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.qualifiers;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 |
23 | import javax.inject.Qualifier;
24 |
25 | @Qualifier
26 | @Documented
27 | @Retention(RetentionPolicy.RUNTIME)
28 | public @interface FilesDirectory {
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/util/ActivityTransitions.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import android.os.Bundle;
20 | import android.view.View;
21 |
22 | public class ActivityTransitions {
23 |
24 | public static Bundle scaleUpAnimation(View view) {
25 | return null;
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/util/AndroidFileManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import com.google.common.base.Preconditions;
20 |
21 | import java.io.File;
22 |
23 | public class AndroidFileManager implements FileManager {
24 |
25 | private final File mBaseDir;
26 |
27 | public AndroidFileManager(File baseDir) {
28 | mBaseDir = Preconditions.checkNotNull(baseDir, "baseDir cannot be null");
29 | }
30 |
31 | @Override
32 | public File getFile(String filename) {
33 | return new File(mBaseDir, filename);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/util/AndroidLogger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import android.util.Log;
20 |
21 | public class AndroidLogger implements Logger {
22 |
23 | @Override
24 | public void i(String tag, String message) {
25 | Log.i(tag, message);
26 | }
27 |
28 | @Override
29 | public void d(String tag, String message) {
30 | Log.d(tag, message);
31 | }
32 |
33 | @Override
34 | public void e(String tag, String message) {
35 | Log.e(tag, message);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/util/AppUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import app.philm.in.BuildConfig;
20 |
21 | public class AppUtils {
22 |
23 | public static String getVersionName() {
24 | return BuildConfig.VERSION_NAME + "." + BuildConfig.VERSION_CODE;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/util/ColorUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import android.graphics.Color;
20 |
21 | public class ColorUtils {
22 |
23 | public static int darken(final int color, float fraction) {
24 | return android.support.v4.graphics.ColorUtils.blendARGB(Color.BLACK, color, fraction);
25 | }
26 |
27 | public static int lighten(final int color, float fraction) {
28 | return android.support.v4.graphics.ColorUtils.blendARGB(Color.WHITE, color, fraction);
29 | }
30 |
31 | public static final int changeBrightness(final int color, float fraction) {
32 | return android.support.v4.graphics.ColorUtils.calculateLuminance(color) >= 128
33 | ? darken(color, fraction)
34 | : lighten(color, fraction);
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/util/FlagUrlProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | public class FlagUrlProvider {
20 |
21 | public String getCountryFlagUrl(String countryCode) {
22 | return "http://www.geonames.org/flags/x/" + countryCode.toLowerCase() + ".gif";
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/util/ViewUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import android.widget.TextView;
20 |
21 | import com.google.common.base.Preconditions;
22 |
23 | public class ViewUtils {
24 |
25 | public static boolean isEmpty(TextView textView) {
26 | Preconditions.checkNotNull(textView, "textView cannot be null");
27 | return TextUtils.isEmpty(textView.getText());
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/view/ColorSchemable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.view;
18 |
19 | import app.philm.in.model.ColorScheme;
20 |
21 | public interface ColorSchemable {
22 |
23 | public void setColorScheme(ColorScheme colorScheme);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/app/philm/in/view/HackyViewPager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.view;
18 |
19 | import android.content.Context;
20 | import android.support.v4.view.ViewPager;
21 | import android.util.AttributeSet;
22 | import android.util.Log;
23 | import android.view.MotionEvent;
24 |
25 | public class HackyViewPager extends ViewPager {
26 |
27 | private static final String LOG_TAG = HackyViewPager.class.getSimpleName();
28 |
29 | public HackyViewPager(Context context) {
30 | super(context);
31 | }
32 |
33 | public HackyViewPager(Context context, AttributeSet attrs) {
34 | super(context, attrs);
35 | }
36 |
37 | @Override
38 | public boolean onInterceptTouchEvent(MotionEvent ev) {
39 | try {
40 | return super.onInterceptTouchEvent(ev);
41 | } catch (IllegalArgumentException e) {
42 | Log.e(LOG_TAG, "onInterceptTouchEvent in IllegalArgumentException");
43 | return false;
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/res/color/default_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/color/float_label.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/color/tab_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_action_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_action_filter.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_action_watchlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_action_watchlist.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_back.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_btn_checkin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_btn_checkin.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_btn_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_btn_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_btn_movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_btn_movie.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_btn_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_btn_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_btn_seen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_btn_seen.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_btn_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_btn_user.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_btn_watchlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_btn_watchlist.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_login.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/ic_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_off_focused_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_off_focused_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_off_normal_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_off_normal_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_off_pressed_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_off_pressed_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_on_focused_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_on_focused_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_on_normal_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_on_normal_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_on_pressed_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-hdpi/philmcolor_btn_rating_star_on_pressed_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_action_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_action_filter.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_action_watchlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_action_watchlist.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_back.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_btn_checkin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_btn_checkin.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_btn_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_btn_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_btn_movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_btn_movie.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_btn_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_btn_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_btn_seen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_btn_seen.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_btn_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_btn_user.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_btn_watchlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_btn_watchlist.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_login.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/ic_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/ic_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_off_focused_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_off_focused_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_off_normal_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_off_normal_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_off_pressed_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_off_pressed_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_on_focused_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_on_focused_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_on_normal_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_on_normal_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_on_pressed_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-mdpi/philmcolor_btn_rating_star_on_pressed_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_action_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_action_filter.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_watchlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_action_watchlist.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_back.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_btn_checkin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_btn_checkin.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_btn_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_btn_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_btn_movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_btn_movie.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_btn_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_btn_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_btn_seen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_btn_seen.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_btn_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_btn_user.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_btn_watchlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_btn_watchlist.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_login.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_profile_placeholder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/ic_profile_placeholder.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_off_focused_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_off_focused_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_off_normal_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_off_normal_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_off_pressed_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_off_pressed_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_on_focused_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_on_focused_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_on_normal_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_on_normal_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_on_pressed_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xhdpi/philmcolor_btn_rating_star_on_pressed_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/drawer_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/drawer_shadow.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_action_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_action_filter.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_action_watchlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_action_watchlist.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_back.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_btn_checkin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_btn_checkin.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_btn_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_btn_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_btn_movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_btn_movie.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_btn_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_btn_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_btn_seen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_btn_seen.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_btn_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_btn_user.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_btn_watchlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_btn_watchlist.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_login.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/ic_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_off_focused_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_off_focused_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_off_normal_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_off_normal_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_off_pressed_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_off_pressed_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_on_focused_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_on_focused_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_on_normal_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_on_normal_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_on_pressed_holo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxhdpi/philmcolor_btn_rating_star_on_pressed_holo_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_action_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_action_filter.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_action_watchlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_action_watchlist.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_back.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_btn_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_btn_collection.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_btn_movie.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_btn_movie.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_btn_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_btn_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_btn_seen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_btn_seen.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_btn_watchlist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_btn_watchlist.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_login.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxxhdpi/ic_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/app/src/main/res/drawable-xxxhdpi/ic_menu.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/black_translucent_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_search.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/philmcolor_ratingbar_full_empty_holo_light.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/philmcolor_ratingbar_full_filled_holo_light.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/philmcolor_ratingbar_full_holo_light.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout-w720dp/fragment_detail_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
23 |
24 |
30 |
31 |
35 |
36 |
37 |
38 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_account.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
24 |
25 |
26 |
27 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_no_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
23 |
24 |
28 |
29 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_cancel_checkin_movie.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_detail_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
26 |
27 |
28 |
29 |
30 |
31 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_movie_images.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/include_drawer_add_account.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
25 |
26 |
32 |
33 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/include_fragment_detail_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
23 |
24 |
31 |
32 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/include_imageview_flag.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/include_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
26 |
27 |
33 |
34 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
23 |
24 |
30 |
31 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_grid_movie.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
23 |
24 |
29 |
30 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_list_movie_section_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_movie_detail_generic_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
23 |
24 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_movie_detail_list_1line.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
27 |
28 |
33 |
34 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_movie_detail_rating.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_movie_detail_summary.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_movie_detail_title.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
25 |
26 |
32 |
33 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_movie_detail_trailers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
25 |
26 |
30 |
31 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_movie_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
22 |
23 |
28 |
29 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_movie_trailer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
24 |
25 |
30 |
31 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/simple_list_item_activated.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_grid.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_pinned_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/cab_movies.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/movies_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/movies_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/values-sw600dp/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 8
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/values-sw720dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 175dp
21 | 280dp
22 |
23 | 200dp
24 | 125dp
25 |
26 | 100dp
27 |
28 | 160dp
29 |
30 | 32dp
31 | 18dp
32 |
33 | 80dp
34 | 120dp
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/flags.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | false
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
24 |
25 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | #FF202020
21 |
22 | #FF333333
23 | #FFDDDDDD
24 | #FFAAAAAA
25 |
26 | #998BC34A
27 | #8BC34A
28 | #689F38
29 | #FF4081
30 |
31 | #FFDDDDDD
32 | #E6E6E6E6
33 | #E6FFFFFF
34 |
35 | #BB000000
36 | #70000000
37 |
38 | @color/grey_60
39 | @color/grey_30
40 |
41 | #99333333
42 | #73333333
43 | #4C333333
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/res/values/flags.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | true
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 | 5
21 |
22 | 3
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/values/plurals.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 | - 1 vote
22 | - %d votes
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/authenticator.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/main_preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
21 |
26 |
27 |
--------------------------------------------------------------------------------
/art/large_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/art/large_logo.png
--------------------------------------------------------------------------------
/art/logo.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/art/logo.psd
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Settings specified in this file will override any Gradle settings
5 | # configured through the IDE.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Jan 07 17:41:35 PST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
7 |
--------------------------------------------------------------------------------
/lib/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 |
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:2.2.3'
8 | }
9 | }
10 |
11 | apply plugin: 'com.android.library'
12 |
13 | repositories {
14 | jcenter()
15 | }
16 |
17 | android {
18 | compileSdkVersion 25
19 | buildToolsVersion "24.0.2"
20 |
21 | defaultConfig {
22 | minSdkVersion 14
23 | targetSdkVersion 25
24 | }
25 |
26 | compileOptions {
27 | sourceCompatibility JavaVersion.VERSION_1_7
28 | targetCompatibility JavaVersion.VERSION_1_7
29 | }
30 |
31 | lintOptions {
32 | // Or, if you prefer, you can continue to check for errors in release builds,
33 | // but continue the build even when errors are found:
34 | abortOnError false
35 | }
36 | }
37 |
38 | dependencies {
39 | compile 'com.squareup.retrofit:retrofit:1.9.0'
40 | compile 'com.squareup.okhttp3:okhttp:3.5.0'
41 | compile 'com.squareup:otto:1.3.8'
42 | compile 'com.squareup.dagger:dagger:1.2.5'
43 | compile 'com.google.guava:guava:20.0'
44 | compile 'com.android.support:support-v4:25.1.0'
45 | compile 'com.jakewharton.retrofit:retrofit1-okhttp3-client:1.1.0'
46 |
47 | compile fileTree(dir: 'libs', include: '*.jar')
48 | }
49 |
--------------------------------------------------------------------------------
/lib/libs/tmdb-java-philm.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/lib/libs/tmdb-java-philm.jar
--------------------------------------------------------------------------------
/lib/libs/trakt-java-philm.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/lib/libs/trakt-java-philm.jar
--------------------------------------------------------------------------------
/lib/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/accounts/PhilmAccountManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.accounts;
18 |
19 | import java.util.List;
20 |
21 | import app.philm.in.model.PhilmAccount;
22 |
23 | public interface PhilmAccountManager {
24 |
25 | public List getAccounts();
26 |
27 | public void addAccount(PhilmAccount account);
28 |
29 | public void removeAccount(PhilmAccount account);
30 |
31 | public void updatePassword(PhilmAccount account);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/model/ListItem.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.model;
18 |
19 | public interface ListItem {
20 |
21 | public static final int TYPE_ITEM = 0;
22 | public static final int TYPE_SECTION = 1;
23 |
24 | public int getListType();
25 |
26 | public T getListItem();
27 |
28 | public int getListSectionTitle();
29 | }
30 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/model/PhilmAccount.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.model;
18 |
19 | public class PhilmAccount {
20 |
21 | private final String mAccountName;
22 | private final String mPassword;
23 |
24 | private String mAuthToken;
25 | private String mAuthTokenType;
26 |
27 | public PhilmAccount(String accountName, String password) {
28 | mAccountName = accountName;
29 | mPassword = password;
30 | }
31 |
32 | public String getAccountName() {
33 | return mAccountName;
34 | }
35 |
36 | public String getPassword() {
37 | return mPassword;
38 | }
39 |
40 | public void setAuthToken(String authToken, String type) {
41 | mAuthToken = authToken;
42 | mAuthTokenType = type;
43 | }
44 |
45 | public String getAuthToken() {
46 | return mAuthToken;
47 | }
48 |
49 | public String getAuthTokenType() {
50 | return mAuthTokenType;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/network/BackgroundCallRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.network;
18 |
19 | public abstract class BackgroundCallRunnable {
20 |
21 | public void preExecute() {}
22 |
23 | public abstract R runAsync();
24 |
25 | public void postExecute(R result) {}
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/network/NetworkCallRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.network;
18 |
19 | import retrofit.RetrofitError;
20 |
21 | public abstract class NetworkCallRunnable {
22 |
23 | public void onPreTraktCall() {}
24 |
25 | public abstract R doBackgroundCall() throws RetrofitError;
26 |
27 | public abstract void onSuccess(R result);
28 |
29 | public abstract void onError(RetrofitError re);
30 |
31 | public void onFinished() {}
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/qualifiers/ForDatabase.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.qualifiers;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 |
23 | import javax.inject.Qualifier;
24 |
25 | @Qualifier
26 | @Documented
27 | @Retention(RetentionPolicy.RUNTIME)
28 | public @interface ForDatabase {
29 | }
30 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/qualifiers/GeneralPurpose.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.qualifiers;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 |
23 | import javax.inject.Qualifier;
24 |
25 | @Qualifier
26 | @Documented
27 | @Retention(RetentionPolicy.RUNTIME)
28 | public @interface GeneralPurpose {
29 | }
30 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/state/AsyncDatabaseHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.state;
18 |
19 | import java.util.Collection;
20 | import java.util.List;
21 |
22 | import app.philm.in.model.PhilmMovie;
23 | import app.philm.in.model.PhilmUserProfile;
24 |
25 | public interface AsyncDatabaseHelper {
26 |
27 | public void mergeLibrary(List library);
28 |
29 | public void mergeWatchlist(List watchlist);
30 |
31 | public void getWatchlist(Callback> callback);
32 |
33 | public void getLibrary(Callback> callback);
34 |
35 | public void put(Collection movies);
36 |
37 | public void put(PhilmMovie movie);
38 |
39 | public void delete(Collection movies);
40 |
41 | public void getUserProfile(String username, Callback callback);
42 |
43 | public void put(PhilmUserProfile profile);
44 |
45 | public void delete(PhilmUserProfile profile);
46 |
47 | public void close();
48 |
49 | public void deleteAllPhilmMovies();
50 |
51 | public interface Callback {
52 | public void onFinished(T result);
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/state/DatabaseHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.state;
18 |
19 | import java.util.Collection;
20 | import java.util.List;
21 |
22 | import app.philm.in.model.PhilmMovie;
23 | import app.philm.in.model.PhilmUserProfile;
24 |
25 | public interface DatabaseHelper {
26 |
27 | List getLibrary();
28 |
29 | List getWatchlist();
30 |
31 | void put(PhilmMovie movie);
32 |
33 | void put(Collection movies);
34 |
35 | void delete(Collection movies);
36 |
37 | PhilmUserProfile getUserProfile(String username);
38 |
39 | void put(PhilmUserProfile profile);
40 |
41 | void delete(PhilmUserProfile profile);
42 |
43 | void deleteAllPhilmMovies();
44 |
45 | void close();
46 |
47 | boolean isClosed();
48 | }
49 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/state/UserState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.state;
18 |
19 | import app.philm.in.model.PhilmAccount;
20 | import app.philm.in.model.PhilmUserProfile;
21 |
22 | public interface UserState extends BaseState {
23 |
24 | public void setUserProfile(PhilmUserProfile profile);
25 |
26 | public void setCurrentAccount(PhilmAccount account);
27 |
28 | public void setUsername(String username);
29 |
30 | public static class AccountChangedEvent {
31 | }
32 |
33 | public static class UserProfileChangedEvent {
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/state/mappers/BaseEntityMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.state.mappers;
18 |
19 | import com.google.common.base.Preconditions;
20 |
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | import app.philm.in.state.MoviesState;
25 |
26 | abstract class BaseEntityMapper {
27 | final MoviesState mMoviesState;
28 |
29 | public BaseEntityMapper(MoviesState state) {
30 | mMoviesState = Preconditions.checkNotNull(state, "state cannot be null");
31 | }
32 |
33 | public abstract R map(T entity);
34 |
35 | public List mapAll(List entities) {
36 | final ArrayList movies = new ArrayList<>(entities.size());
37 | for (T entity : entities) {
38 | movies.add(map(entity));
39 | }
40 | return movies;
41 | }
42 |
43 | abstract R getEntity(String id);
44 |
45 | abstract void putEntity(R entity);
46 | }
47 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/state/mappers/MovieEntityMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.state.mappers;
18 |
19 | import app.philm.in.model.PhilmMovie;
20 | import app.philm.in.state.MoviesState;
21 | import app.philm.in.util.TextUtils;
22 |
23 | abstract class MovieEntityMapper extends BaseEntityMapper {
24 |
25 | public MovieEntityMapper(MoviesState state) {
26 | super(state);
27 | }
28 |
29 | @Override
30 | PhilmMovie getEntity(String id) {
31 | if (mMoviesState.getImdbIdMovies().containsKey(id)) {
32 | return mMoviesState.getImdbIdMovies().get(id);
33 | } else if (mMoviesState.getTmdbIdMovies().containsKey(id)) {
34 | return mMoviesState.getTmdbIdMovies().get(id);
35 | }
36 | return null;
37 | }
38 |
39 | @Override
40 | void putEntity(PhilmMovie movie) {
41 | if (!TextUtils.isEmpty(movie.getImdbId())) {
42 | mMoviesState.getImdbIdMovies().put(movie.getImdbId(), movie);
43 | }
44 | if (movie.getTmdbId() != null) {
45 | mMoviesState.getTmdbIdMovies().put(String.valueOf(movie.getTmdbId()), movie);
46 | }
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/state/mappers/TmdbMovieEntityMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.state.mappers;
18 |
19 | import com.uwetrottmann.tmdb.entities.Movie;
20 |
21 | import javax.inject.Inject;
22 | import javax.inject.Singleton;
23 |
24 | import app.philm.in.model.PhilmMovie;
25 | import app.philm.in.state.MoviesState;
26 |
27 | @Singleton
28 | public class TmdbMovieEntityMapper extends MovieEntityMapper {
29 |
30 | @Inject
31 | public TmdbMovieEntityMapper(MoviesState state) {
32 | super(state);
33 | }
34 |
35 | @Override
36 | public PhilmMovie map(Movie entity) {
37 | PhilmMovie movie = getEntity(String.valueOf(entity.id));
38 |
39 | if (movie == null && entity.imdb_id != null) {
40 | movie = getEntity(entity.imdb_id);
41 | }
42 |
43 | if (movie == null) {
44 | // No movie, so create one
45 | movie = new PhilmMovie();
46 | }
47 | // We already have a movie, so just update it wrapped value
48 | movie.setFromMovie(entity);
49 | putEntity(movie);
50 |
51 | return movie;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/state/mappers/TraktMovieEntityMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.state.mappers;
18 |
19 | import com.jakewharton.trakt.entities.Movie;
20 |
21 | import javax.inject.Inject;
22 | import javax.inject.Singleton;
23 |
24 | import app.philm.in.model.PhilmMovie;
25 | import app.philm.in.state.MoviesState;
26 |
27 | @Singleton
28 | public class TraktMovieEntityMapper extends MovieEntityMapper {
29 |
30 | @Inject
31 | public TraktMovieEntityMapper(MoviesState state) {
32 | super(state);
33 | }
34 |
35 | @Override
36 | public PhilmMovie map(Movie entity) {
37 | PhilmMovie movie = getEntity(entity.imdb_id);
38 |
39 | if (movie == null && entity.tmdbId != 0) {
40 | movie = getEntity(String.valueOf(entity.tmdbId));
41 | }
42 |
43 | if (movie == null) {
44 | // No movie, so create one
45 | movie = new PhilmMovie();
46 | }
47 | // We already have a movie, so just update it wrapped value
48 | movie.setFromMovie(entity);
49 | putEntity(movie);
50 |
51 | return movie;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/AddToTraktCollectionRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.jakewharton.trakt.Trakt;
20 | import com.jakewharton.trakt.entities.Response;
21 | import com.jakewharton.trakt.services.MovieService;
22 |
23 | import app.philm.in.model.PhilmMovie;
24 | import retrofit.RetrofitError;
25 |
26 | public class AddToTraktCollectionRunnable extends BaseTraktActionRunnable {
27 |
28 | public AddToTraktCollectionRunnable(int callingId, String... ids) {
29 | super(callingId, ids);
30 | }
31 |
32 | @Override
33 | public Response doTraktCall(Trakt trakt, MovieService.Movies body) throws RetrofitError {
34 | return trakt.movieService().library(body);
35 | }
36 |
37 | @Override
38 | protected void movieRequiresModifying(PhilmMovie movie) {
39 | movie.setInCollection(true);
40 | }
41 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/AddToTraktWatchlistRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.jakewharton.trakt.Trakt;
20 | import com.jakewharton.trakt.entities.Response;
21 | import com.jakewharton.trakt.services.MovieService;
22 |
23 | import app.philm.in.model.PhilmMovie;
24 | import retrofit.RetrofitError;
25 |
26 | public class AddToTraktWatchlistRunnable extends BaseTraktActionRunnable {
27 |
28 | public AddToTraktWatchlistRunnable(int callingId, String... ids) {
29 | super(callingId, ids);
30 | }
31 |
32 | @Override
33 | public Response doTraktCall(Trakt trakt, MovieService.Movies body) throws RetrofitError {
34 | return trakt.movieService().watchlist(body);
35 | }
36 |
37 | @Override
38 | protected void movieRequiresModifying(PhilmMovie movie) {
39 | movie.setInWatched(true);
40 | }
41 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/BaseTmdbPaginatedMovieRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.uwetrottmann.tmdb.entities.MovieResultsPage;
20 |
21 | import app.philm.in.model.PhilmMovie;
22 | import app.philm.in.state.MoviesState;
23 |
24 | abstract class BaseTmdbPaginatedMovieRunnable extends BaseTmdbPaginatedRunnable<
25 | MoviesState.MoviePaginatedResult, PhilmMovie, MovieResultsPage> {
26 |
27 | BaseTmdbPaginatedMovieRunnable(int callingId, int page) {
28 | super(callingId, page);
29 | }
30 |
31 | @Override
32 | protected void updatePaginatedResult(
33 | MoviesState.MoviePaginatedResult result,
34 | MovieResultsPage tmdbResult) {
35 | result.items.addAll(getTmdbMovieEntityMapper().mapAll(tmdbResult.results));
36 |
37 | result.page = tmdbResult.page;
38 | if (tmdbResult.total_pages != null) {
39 | result.totalPages = tmdbResult.total_pages;
40 | }
41 | }
42 |
43 | @Override
44 | protected MoviesState.MoviePaginatedResult createPaginatedResult() {
45 | return new MoviesState.MoviePaginatedResult();
46 | }
47 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/BaseTmdbPaginatedPersonRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.uwetrottmann.tmdb.entities.PersonResultsPage;
20 |
21 | import app.philm.in.model.PhilmPerson;
22 | import app.philm.in.state.MoviesState;
23 |
24 | abstract class BaseTmdbPaginatedPersonRunnable extends BaseTmdbPaginatedRunnable<
25 | MoviesState.PersonPaginatedResult, PhilmPerson, PersonResultsPage> {
26 |
27 | BaseTmdbPaginatedPersonRunnable(int callingId, int page) {
28 | super(callingId, page);
29 | }
30 |
31 | @Override
32 | protected void updatePaginatedResult(
33 | MoviesState.PersonPaginatedResult result,
34 | PersonResultsPage tmdbResult) {
35 | result.items.addAll(getTmdbPersonEntityMapper().mapAll(tmdbResult.results));
36 |
37 | result.page = tmdbResult.page;
38 | if (tmdbResult.total_pages != null) {
39 | result.totalPages = tmdbResult.total_pages;
40 | }
41 | }
42 |
43 | @Override
44 | protected MoviesState.PersonPaginatedResult createPaginatedResult() {
45 | return new MoviesState.PersonPaginatedResult();
46 | }
47 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/CancelCheckinTraktRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.jakewharton.trakt.entities.Response;
20 |
21 | import app.philm.in.network.NetworkError;
22 | import retrofit.RetrofitError;
23 |
24 | public class CancelCheckinTraktRunnable extends BaseMovieRunnable {
25 |
26 | public CancelCheckinTraktRunnable(int callingId) {
27 | super(callingId);
28 | }
29 |
30 | @Override
31 | public Response doBackgroundCall() throws RetrofitError {
32 | return getTraktClient().movieService().cancelcheckin();
33 | }
34 |
35 | @Override
36 | public void onSuccess(Response result) {
37 | if (RESULT_TRAKT_SUCCESS.equals(result.status)) {
38 | mMoviesState.setWatchingMovie(null);
39 | } else if (RESULT_TRAKT_FAILURE.equals(result.status)) {
40 | // TODO
41 | }
42 | }
43 |
44 | @Override
45 | protected int getSource() {
46 | return NetworkError.SOURCE_TRAKT;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/FetchTmdbNowPlayingRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.uwetrottmann.tmdb.entities.MovieResultsPage;
20 |
21 | import app.philm.in.state.MoviesState;
22 | import retrofit.RetrofitError;
23 |
24 | public class FetchTmdbNowPlayingRunnable extends BaseTmdbPaginatedMovieRunnable {
25 |
26 | public FetchTmdbNowPlayingRunnable(int callingId, int page) {
27 | super(callingId, page);
28 | }
29 |
30 | @Override
31 | public MovieResultsPage doBackgroundCall() throws RetrofitError {
32 | return getTmdbClient().moviesService().nowPlaying(
33 | getPage(),
34 | getCountryProvider().getTwoLetterLanguageCode());
35 | }
36 |
37 | @Override
38 | protected MoviesState.MoviePaginatedResult getResultFromState() {
39 | return mMoviesState.getNowPlaying();
40 | }
41 |
42 | @Override
43 | protected void updateState(MoviesState.MoviePaginatedResult result) {
44 | mMoviesState.setNowPlaying(result);
45 | }
46 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/FetchTmdbPopularRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.uwetrottmann.tmdb.entities.MovieResultsPage;
20 |
21 | import app.philm.in.state.MoviesState;
22 | import retrofit.RetrofitError;
23 |
24 | public class FetchTmdbPopularRunnable extends BaseTmdbPaginatedMovieRunnable {
25 |
26 | public FetchTmdbPopularRunnable(int callingId, int page) {
27 | super(callingId, page);
28 | }
29 |
30 | @Override
31 | public MovieResultsPage doBackgroundCall() throws RetrofitError {
32 | return getTmdbClient().moviesService().popular(
33 | getPage(),
34 | getCountryProvider().getTwoLetterLanguageCode());
35 | }
36 |
37 | @Override
38 | protected MoviesState.MoviePaginatedResult getResultFromState() {
39 | return mMoviesState.getPopular();
40 | }
41 |
42 | @Override
43 | protected void updateState(MoviesState.MoviePaginatedResult result) {
44 | mMoviesState.setPopular(result);
45 | }
46 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/FetchTmdbUpcomingRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.uwetrottmann.tmdb.entities.MovieResultsPage;
20 |
21 | import app.philm.in.state.MoviesState;
22 | import retrofit.RetrofitError;
23 |
24 | public class FetchTmdbUpcomingRunnable extends BaseTmdbPaginatedMovieRunnable {
25 |
26 | public FetchTmdbUpcomingRunnable(int callingId, int page) {
27 | super(callingId, page);
28 | }
29 |
30 | @Override
31 | public MovieResultsPage doBackgroundCall() throws RetrofitError {
32 | return getTmdbClient().moviesService().upcoming(getPage(),
33 | getCountryProvider().getTwoLetterLanguageCode());
34 | }
35 |
36 | @Override
37 | protected MoviesState.MoviePaginatedResult getResultFromState() {
38 | return mMoviesState.getUpcoming();
39 | }
40 |
41 | @Override
42 | protected void updateState(MoviesState.MoviePaginatedResult result) {
43 | mMoviesState.setUpcoming(result);
44 | }
45 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/FetchTraktTrendingRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.jakewharton.trakt.entities.Movie;
20 |
21 | import java.util.List;
22 |
23 | import app.philm.in.network.NetworkError;
24 | import app.philm.in.util.PhilmCollections;
25 | import retrofit.RetrofitError;
26 |
27 | public class FetchTraktTrendingRunnable extends BaseMovieRunnable> {
28 |
29 | public FetchTraktTrendingRunnable(int callingId) {
30 | super(callingId);
31 | }
32 |
33 | @Override
34 | public List doBackgroundCall() throws RetrofitError {
35 | return getTraktClient().moviesService().trending();
36 | }
37 |
38 | @Override
39 | public void onSuccess(List result) {
40 | if (!PhilmCollections.isEmpty(result)) {
41 | mMoviesState.setTrending(getTraktMovieEntityMapper().mapAll(result));
42 | } else {
43 | mMoviesState.setTrending(null);
44 | }
45 | }
46 |
47 | @Override
48 | protected int getSource() {
49 | return NetworkError.SOURCE_TRAKT;
50 | }
51 |
52 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/MarkTraktMovieSeenRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.jakewharton.trakt.Trakt;
20 | import com.jakewharton.trakt.entities.Response;
21 | import com.jakewharton.trakt.services.MovieService;
22 |
23 | import app.philm.in.model.PhilmMovie;
24 | import app.philm.in.network.NetworkError;
25 | import retrofit.RetrofitError;
26 |
27 | public class MarkTraktMovieSeenRunnable extends BaseTraktActionRunnable {
28 |
29 | public MarkTraktMovieSeenRunnable(int callingId, String... ids) {
30 | super(callingId, ids);
31 | }
32 |
33 | @Override
34 | public Response doTraktCall(Trakt trakt, MovieService.Movies body) throws RetrofitError {
35 | return trakt.movieService().seen(body);
36 | }
37 |
38 | @Override
39 | protected void movieRequiresModifying(PhilmMovie movie) {
40 | movie.setWatched(true);
41 | }
42 |
43 | @Override
44 | protected int getSource() {
45 | return NetworkError.SOURCE_TRAKT;
46 | }
47 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/MarkTraktMovieUnseenRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.jakewharton.trakt.Trakt;
20 | import com.jakewharton.trakt.entities.Response;
21 | import com.jakewharton.trakt.services.MovieService;
22 |
23 | import app.philm.in.model.PhilmMovie;
24 | import app.philm.in.network.NetworkError;
25 | import retrofit.RetrofitError;
26 |
27 | public class MarkTraktMovieUnseenRunnable extends BaseTraktActionRunnable {
28 |
29 | public MarkTraktMovieUnseenRunnable(int callingId, String... ids) {
30 | super(callingId, ids);
31 | }
32 |
33 | @Override
34 | public Response doTraktCall(Trakt trakt, MovieService.Movies body) throws RetrofitError {
35 | return trakt.movieService().unseen(body);
36 | }
37 |
38 | @Override
39 | protected void movieRequiresModifying(PhilmMovie movie) {
40 | movie.setWatched(false);
41 | }
42 |
43 | @Override
44 | protected int getSource() {
45 | return NetworkError.SOURCE_TRAKT;
46 | }
47 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/RemoveFromTraktCollectionRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.jakewharton.trakt.Trakt;
20 | import com.jakewharton.trakt.entities.Response;
21 | import com.jakewharton.trakt.services.MovieService;
22 |
23 | import app.philm.in.model.PhilmMovie;
24 | import app.philm.in.network.NetworkError;
25 | import retrofit.RetrofitError;
26 |
27 | public class RemoveFromTraktCollectionRunnable extends BaseTraktActionRunnable {
28 |
29 | public RemoveFromTraktCollectionRunnable(int callingId, String... ids) {
30 | super(callingId, ids);
31 | }
32 |
33 | @Override
34 | public Response doTraktCall(Trakt trakt, MovieService.Movies body) throws RetrofitError {
35 | return trakt.movieService().unlibrary(body);
36 | }
37 |
38 | @Override
39 | protected void movieRequiresModifying(PhilmMovie movie) {
40 | movie.setInCollection(false);
41 | }
42 |
43 | @Override
44 | protected int getSource() {
45 | return NetworkError.SOURCE_TRAKT;
46 | }
47 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/tasks/RemoveFromTraktWatchlistRunnable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.tasks;
18 |
19 | import com.jakewharton.trakt.Trakt;
20 | import com.jakewharton.trakt.entities.Response;
21 | import com.jakewharton.trakt.services.MovieService;
22 |
23 | import app.philm.in.model.PhilmMovie;
24 | import app.philm.in.network.NetworkError;
25 | import retrofit.RetrofitError;
26 |
27 | public class RemoveFromTraktWatchlistRunnable extends BaseTraktActionRunnable {
28 |
29 | public RemoveFromTraktWatchlistRunnable(int callingId, String... ids) {
30 | super(callingId, ids);
31 | }
32 |
33 | @Override
34 | public Response doTraktCall(Trakt trakt, MovieService.Movies body) throws RetrofitError {
35 | return trakt.movieService().unwatchlist(body);
36 | }
37 |
38 | @Override
39 | protected void movieRequiresModifying(PhilmMovie movie) {
40 | movie.setInWatched(false);
41 | }
42 |
43 | @Override
44 | protected int getSource() {
45 | return NetworkError.SOURCE_TRAKT;
46 | }
47 | }
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/BackgroundExecutor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import app.philm.in.network.BackgroundCallRunnable;
20 | import app.philm.in.network.NetworkCallRunnable;
21 |
22 | public interface BackgroundExecutor {
23 |
24 | public void execute(NetworkCallRunnable runnable);
25 |
26 | public void execute(BackgroundCallRunnable runnable);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/CountryProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | public interface CountryProvider {
20 |
21 | public static final String US_TWO_LETTER_CODE = "US";
22 |
23 | /**
24 | * @return ISO 3166-1 country code
25 | */
26 | public String getTwoLetterCountryCode();
27 |
28 | /**
29 | * @return ISO 639-1 language code
30 | */
31 | public String getTwoLetterLanguageCode();
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/FileManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import java.io.File;
20 |
21 | public interface FileManager {
22 |
23 | public File getFile(String filename);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/FloatUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import com.google.common.base.Preconditions;
20 |
21 | public class FloatUtils {
22 |
23 | public static float anchor(float value, float min, float max) {
24 | return Math.max(Math.min(value, max), min);
25 | }
26 |
27 | public static float weightedAverage(float... values) {
28 | Preconditions.checkArgument(values.length % 2 == 0, "values must have a multiples of 2");
29 |
30 | float sum = 0;
31 | float sumWeight = 0;
32 |
33 | for (int i = 0; i < values.length; i += 2) {
34 | float value = values[i];
35 | float weight = values[i + 1];
36 |
37 | sum += (value * weight);
38 | sumWeight += weight;
39 | }
40 |
41 | return sum / sumWeight;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/Injector.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | public interface Injector {
20 |
21 | public void inject(Object object);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/IntUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import com.google.common.base.Preconditions;
20 |
21 | public class IntUtils {
22 |
23 | public static int anchor(int value, int min, int max) {
24 | return Math.max(Math.min(value, max), min);
25 | }
26 |
27 | public static int weightedAverage(int... values) {
28 | Preconditions.checkArgument(values.length % 2 == 0, "values must have a multiples of 2");
29 |
30 | int sum = 0;
31 | int sumWeight = 0;
32 |
33 | for (int i = 0; i < values.length; i += 2) {
34 | int value = values[i];
35 | int weight = values[i + 1];
36 |
37 | sum += (value * weight);
38 | sumWeight += weight;
39 | }
40 |
41 | return sum / sumWeight;
42 | }
43 |
44 | public static int[] toArray(int... array) {
45 | return array;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/Logger.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | public interface Logger {
20 |
21 | public void i(String tag, String message);
22 |
23 | public void d(String tag, String message);
24 |
25 | public void e(String tag, String message);
26 | }
27 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/PhilmAlarmManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | public interface PhilmAlarmManager {
20 |
21 | public void scheduleCheckinRatePrompt(String movieId, long delay);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/PhilmCollections.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import java.util.Collection;
20 |
21 | public class PhilmCollections {
22 |
23 | public static boolean isEmpty(Collection> collection) {
24 | return collection == null || collection.isEmpty();
25 | }
26 |
27 | public static int size(Collection> collection) {
28 | return collection != null ? collection.size() : 0;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/PhilmPreferences.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 |
20 | public interface PhilmPreferences {
21 |
22 | public boolean shouldRemoveFromWatchlistOnWatched();
23 |
24 | public void setRemoveFromWatchlistOnWatched(boolean remove);
25 |
26 | public boolean hasShownTraktLoginPrompt();
27 |
28 | public void setShownTraktLoginPrompt();
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/Sha1.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | import java.io.UnsupportedEncodingException;
20 | import java.security.MessageDigest;
21 | import java.security.NoSuchAlgorithmException;
22 |
23 | public class Sha1 {
24 |
25 | public static String encode(String string) {
26 | StringBuilder sb = new StringBuilder();
27 | try {
28 | MessageDigest sha = MessageDigest.getInstance("SHA-1");
29 | sha.update(string.getBytes("UTF-8"));
30 | byte[] hash = sha.digest();
31 | for (int i = 0; i < hash.length; i++) {
32 | sb.append(Integer.toString((hash[i] & 0xff) + 0x100, 16).substring(1));
33 | }
34 | return sb.toString();
35 | } catch (NoSuchAlgorithmException nsa) {
36 | nsa.printStackTrace();
37 | } catch (UnsupportedEncodingException ue) {
38 | ue.printStackTrace();
39 | }
40 | return null;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/StringFetcher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | public interface StringFetcher {
20 |
21 | public String getString(int id);
22 |
23 | public String getString(int id, Object... format);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/TextUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | public class TextUtils {
20 |
21 | public static boolean isEmpty(CharSequence text) {
22 | return null == text || text.length() == 0;
23 | }
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/lib/src/main/java/app/philm/in/util/TimeUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Chris Banes
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package app.philm.in.util;
18 |
19 | public class TimeUtils {
20 |
21 | public static boolean isAfterThreshold(final long time, final long threshold) {
22 | return isInFuture(time - threshold);
23 | }
24 |
25 | public static boolean isBeforeThreshold(final long time, final long threshold) {
26 | return isInPast(time - threshold);
27 | }
28 |
29 | public static boolean isPastThreshold(final long time, final long threshold) {
30 | return isInPast(time + threshold);
31 | }
32 |
33 | public static boolean isInPast(final long time) {
34 | return time <= System.currentTimeMillis();
35 | }
36 |
37 | public static boolean isInFuture(final long time) {
38 | return time > System.currentTimeMillis();
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/release/philm-0.6.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisbanes/philm/149259643837b33ffec25e4dac3c9fcc4e52f75a/release/philm-0.6.apk
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':lib'
2 | include ':app'
3 |
--------------------------------------------------------------------------------