Permalink
Browse files

Initial commit

  • Loading branch information...
chrisbanes committed Aug 17, 2017
0 parents commit 504ada3c397fce2b25748ec40dd7f51c615dabe4
Showing with 5,070 additions and 0 deletions.
  1. +9 −0 .gitignore
  2. +238 −0 .idea/codeStyleSettings.xml
  3. +6 −0 .idea/copyright/Google_Apache_v2_0.xml
  4. +3 −0 .idea/copyright/profiles_settings.xml
  5. +6 −0 .idea/encodings.xml
  6. +18 −0 .idea/gradle.xml
  7. +33 −0 .idea/misc.xml
  8. +9 −0 .idea/modules.xml
  9. +12 −0 .idea/runConfigurations.xml
  10. +6 −0 .idea/vcs.xml
  11. +23 −0 CONTRIBUTING.md
  12. +202 −0 LICENSE
  13. +70 −0 README.md
  14. +1 −0 app/.gitignore
  15. +102 −0 app/build.gradle
  16. +25 −0 app/proguard-rules.pro
  17. +39 −0 app/src/androidTest/java/me/banes/chris/tivi/ExampleInstrumentedTest.kt
  18. +49 −0 app/src/main/AndroidManifest.xml
  19. +36 −0 app/src/main/java/Extensions.kt
  20. +32 −0 app/src/main/java/me/banes/chris/tivi/AppNavigator.kt
  21. +23 −0 app/src/main/java/me/banes/chris/tivi/Constants.kt
  22. +46 −0 app/src/main/java/me/banes/chris/tivi/TiviActivity.kt
  23. +29 −0 app/src/main/java/me/banes/chris/tivi/TiviApplication.kt
  24. +44 −0 app/src/main/java/me/banes/chris/tivi/TiviFragment.kt
  25. +24 −0 app/src/main/java/me/banes/chris/tivi/api/Resource.kt
  26. +31 −0 app/src/main/java/me/banes/chris/tivi/api/Status.kt
  27. +140 −0 app/src/main/java/me/banes/chris/tivi/calls/PaginatedTraktCall.kt
  28. +82 −0 app/src/main/java/me/banes/chris/tivi/calls/PopularCall.kt
  29. +65 −0 app/src/main/java/me/banes/chris/tivi/calls/TraktCall.kt
  30. +77 −0 app/src/main/java/me/banes/chris/tivi/calls/TrendingCall.kt
  31. +64 −0 app/src/main/java/me/banes/chris/tivi/calls/UserMeCall.kt
  32. +20 −0 app/src/main/java/me/banes/chris/tivi/data/Page.kt
  33. +38 −0 app/src/main/java/me/banes/chris/tivi/data/PopularEntry.kt
  34. +35 −0 app/src/main/java/me/banes/chris/tivi/data/TiviDatabase.kt
  35. +57 −0 app/src/main/java/me/banes/chris/tivi/data/TiviShow.kt
  36. +91 −0 app/src/main/java/me/banes/chris/tivi/data/TiviShowDao.kt
  37. +29 −0 app/src/main/java/me/banes/chris/tivi/data/TiviTypeConverters.kt
  38. +33 −0 app/src/main/java/me/banes/chris/tivi/data/TraktUser.kt
  39. +38 −0 app/src/main/java/me/banes/chris/tivi/data/TrendingEntry.kt
  40. +35 −0 app/src/main/java/me/banes/chris/tivi/data/UserDao.kt
  41. +230 −0 app/src/main/java/me/banes/chris/tivi/home/HomeActivity.kt
  42. +71 −0 app/src/main/java/me/banes/chris/tivi/home/HomeActivityViewModel.kt
  43. +44 −0 app/src/main/java/me/banes/chris/tivi/home/HomeBuilder.kt
  44. +29 −0 app/src/main/java/me/banes/chris/tivi/home/HomeModule.kt
  45. +30 −0 app/src/main/java/me/banes/chris/tivi/home/HomeNavigator.kt
  46. +40 −0 app/src/main/java/me/banes/chris/tivi/home/discover/DiscoverBuilder.kt
  47. +121 −0 app/src/main/java/me/banes/chris/tivi/home/discover/DiscoverFragment.kt
  48. +93 −0 app/src/main/java/me/banes/chris/tivi/home/discover/DiscoverViewModel.kt
  49. +38 −0 app/src/main/java/me/banes/chris/tivi/home/library/LibraryBuilder.kt
  50. +24 −0 app/src/main/java/me/banes/chris/tivi/home/library/LibraryFragment.kt
  51. +27 −0 app/src/main/java/me/banes/chris/tivi/home/library/LibraryViewModel.kt
  52. +40 −0 app/src/main/java/me/banes/chris/tivi/home/popular/PopularBuilder.kt
  53. +25 −0 app/src/main/java/me/banes/chris/tivi/home/popular/PopularShowsFragment.kt
  54. +29 −0 app/src/main/java/me/banes/chris/tivi/home/popular/PopularShowsViewModel.kt
  55. +40 −0 app/src/main/java/me/banes/chris/tivi/home/trending/TrendingBuilder.kt
  56. +24 −0 app/src/main/java/me/banes/chris/tivi/home/trending/TrendingShowsFragment.kt
  57. +29 −0 app/src/main/java/me/banes/chris/tivi/home/trending/TrendingShowsViewModel.kt
  58. +41 −0 app/src/main/java/me/banes/chris/tivi/inject/AppComponent.kt
  59. +99 −0 app/src/main/java/me/banes/chris/tivi/inject/AppModule.kt
  60. +64 −0 app/src/main/java/me/banes/chris/tivi/inject/TiviViewModelFactory.java
  61. +31 −0 app/src/main/java/me/banes/chris/tivi/inject/ViewModelBuilder.kt
  62. +27 −0 app/src/main/java/me/banes/chris/tivi/inject/ViewModelKey.kt
  63. +123 −0 app/src/main/java/me/banes/chris/tivi/trakt/TraktManager.kt
  64. +99 −0 app/src/main/java/me/banes/chris/tivi/trakt/TraktModule.kt
  65. +89 −0 app/src/main/java/me/banes/chris/tivi/ui/EndlessRecyclerViewScrollListener.kt
  66. +32 −0 app/src/main/java/me/banes/chris/tivi/ui/SpacingItemDecorator.kt
  67. +79 −0 app/src/main/java/me/banes/chris/tivi/ui/TiviShowGridAdapter.kt
  68. +47 −0 app/src/main/java/me/banes/chris/tivi/ui/TiviShowGridViewHolder.kt
  69. +41 −0 app/src/main/java/me/banes/chris/tivi/ui/groupieitems/ShowPosterItem.kt
  70. +35 −0 app/src/main/java/me/banes/chris/tivi/ui/groupieitems/ShowPosterUpdatingSection.kt
  71. +44 −0 app/src/main/java/me/banes/chris/tivi/ui/groupieitems/UpdatingItem.kt
  72. +26 −0 app/src/main/java/me/banes/chris/tivi/util/AppRxExecutors.kt
  73. +28 −0 app/src/main/java/me/banes/chris/tivi/util/DatabaseTxRunner.kt
  74. +98 −0 app/src/main/java/me/banes/chris/tivi/util/PaginatedGridFragment.kt
  75. +74 −0 app/src/main/java/me/banes/chris/tivi/util/PaginatedTraktViewModel.kt
  76. +28 −0 app/src/main/res/drawable/ic_default_avatar_toolbar.xml
  77. +62 −0 app/src/main/res/drawable/ic_launcher_background.xml
  78. +57 −0 app/src/main/res/drawable/ic_launcher_foreground.xml
  79. +27 −0 app/src/main/res/drawable/ic_popular.xml
  80. +27 −0 app/src/main/res/drawable/ic_video_library_24dp.xml
  81. +61 −0 app/src/main/res/drawable/tv_test.xml
  82. +82 −0 app/src/main/res/layout/activity_home.xml
  83. +30 −0 app/src/main/res/layout/fragment_discover.xml
  84. +40 −0 app/src/main/res/layout/fragment_rv_grid.xml
  85. +49 −0 app/src/main/res/layout/grid_item.xml
  86. +35 −0 app/src/main/res/layout/header_item.xml
  87. +30 −0 app/src/main/res/menu/home_navigation.xml
  88. +33 −0 app/src/main/res/menu/home_toolbar.xml
  89. +22 −0 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  90. BIN app/src/main/res/mipmap-hdpi/ic_launcher.png
  91. BIN app/src/main/res/mipmap-mdpi/ic_launcher.png
  92. BIN app/src/main/res/mipmap-xhdpi/ic_launcher.png
  93. BIN app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  94. BIN app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  95. +23 −0 app/src/main/res/values-w480dp/integers.xml
  96. +23 −0 app/src/main/res/values-w600dp/integers.xml
  97. +23 −0 app/src/main/res/values-w720dp/integers.xml
  98. +30 −0 app/src/main/res/values/colors.xml
  99. +23 −0 app/src/main/res/values/integers.xml
  100. +26 −0 app/src/main/res/values/strings.xml
  101. +32 −0 app/src/main/res/values/styles.xml
  102. +33 −0 app/src/test/java/me/banes/chris/tivi/ExampleUnitTest.kt
  103. BIN art/ic_launcher-web.png
  104. BIN art/tivi-launcher-icon.sketch
  105. +52 −0 build.gradle
  106. +17 −0 gradle.properties
  107. BIN gradle/wrapper/gradle-wrapper.jar
  108. +6 −0 gradle/wrapper/gradle-wrapper.properties
  109. +160 −0 gradlew
  110. +90 −0 gradlew.bat
  111. +18 −0 settings.gradle
@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
@@ -0,0 +1,238 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="android" withSubpackages="true" static="false" />
<emptyLine />
<package name="com" withSubpackages="true" static="false" />
<emptyLine />
<package name="junit" withSubpackages="true" static="false" />
<emptyLine />
<package name="net" withSubpackages="true" static="false" />
<emptyLine />
<package name="org" withSubpackages="true" static="false" />
<emptyLine />
<package name="java" withSubpackages="true" static="false" />
<emptyLine />
<package name="javax" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
<emptyLine />
</value>
</option>
<option name="RIGHT_MARGIN" value="100" />
<AndroidXmlCodeStyleSettings>
<option name="USE_CUSTOM_SETTINGS" value="true" />
</AndroidXmlCodeStyleSettings>
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
</value>
</option>
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="10" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2" />
</JetCodeStyleSettings>
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="h" />
<pair source="c" header="h" />
</extensions>
</Objective-C-extensions>
<XML>
<option name="XML_KEEP_LINE_BREAKS" value="false" />
<option name="XML_ALIGN_ATTRIBUTES" value="false" />
<option name="XML_SPACE_INSIDE_EMPTY_TAG" value="true" />
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_width</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_height</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_.*</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:width</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:height</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>
@@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright &amp;#36;today.year Google, Inc.&#10;&#10;Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);&#10;you may not use this file except in compliance with the License.&#10;You may obtain a copy of the License at&#10;&#10; http://www.apache.org/licenses/LICENSE-2.0&#10;&#10;Unless required by applicable law or agreed to in writing, software&#10;distributed under the License is distributed on an &quot;AS IS&quot; BASIS,&#10;WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&#10;See the License for the specific language governing permissions and&#10;limitations under the License.&#10;" />
<option name="myName" value="Google Apache v2.0" />
</copyright>
</component>
@@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="Google Apache v2.0" />
</component>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/tivi.iml" filepath="$PROJECT_DIR$/tivi.iml" />
</modules>
</component>
</project>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
@@ -0,0 +1,23 @@
# How to Contribute

We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution,
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.
Oops, something went wrong.

0 comments on commit 504ada3

Please sign in to comment.