Skip to content

Commit

Permalink
Merge pull request #29 from Sharkaboi/v1.2
Browse files Browse the repository at this point in the history
V1.2
  • Loading branch information
Sharkaboi authored Jul 15, 2021
2 parents b1faa77 + cb99022 commit c9b3393
Show file tree
Hide file tree
Showing 51 changed files with 5,214 additions and 248 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
<a href="https://github.com/Sharkaboi/MediaHub/actions" alt="CI">
<img alt="CI" src="https://github.com/Sharkaboi/MediaHub/actions/workflows/android.yaml/badge.svg">
</a><br>
A simple, easy to use MyAnimeList client alternative. Uses the <a href="https://myanimelist.net/apiconfig/references/api/v2">MAL Api.</a>
A simple, easy to use MyAnimeList client alternative. Uses the <a href="https://myanimelist.net/apiconfig/references/api/v2">MAL Api</a> & <a href="https://anilist.gitbook.io/anilist-apiv2-docs/">Anilist Api</a>.
</p>

## Uses
* [Kotlin](https://kotlinlang.org/)
* MVI/MVVM Architecture
* [Retrofit](https://square.github.io/retrofit/)
* [Apollo Android](https://github.com/apollographql/apollo-android)
* [Coroutines](https://kotlinlang.org/docs/coroutines-overview.html)
* [Hilt](https://dagger.dev/hilt/)
* [Datastore](https://developer.android.com/topic/libraries/architecture/datastore)
Expand Down Expand Up @@ -57,23 +58,27 @@ Anime | Manga
![](assets/screenshots/anime.png) | ![](assets/screenshots/manga.png)
Anime details | Manga details
![](assets/screenshots/anime_details.png) | ![](assets/screenshots/manga_details.png)
Anime details | Manga details
![](assets/screenshots/anime_details2.png) | ![](assets/screenshots/manga_details2.png)
Anime ranking | Manga ranking
![](assets/screenshots/anime_ranking.png) | ![](assets/screenshots/manga_ranking.png)
Anime search | Manga search
![](assets/screenshots/anime_search.png) | ![](assets/screenshots/manga_search.png)
Discover | Profile
![](assets/screenshots/discover.png) | ![](assets/screenshots/profile.png)
Anime suggestions | Anime seasonals
![](assets/screenshots/anime_suggestions.png) | ![](assets/screenshots/anime_seasonal.png)
Settings | Share
![](assets/screenshots/settings.png) | ![](assets/screenshots/share.png)
Discover | Anime suggestions
![](assets/screenshots/discover.png) | ![](assets/screenshots/anime_suggestions.png)
Anime seasonals | Profile
![](assets/screenshots/anime_seasonal.png) | ![](assets/screenshots/profile.png)
Profile | Share
![](assets/screenshots/profile2.png) | ![](assets/screenshots/share.png)
Settings | Update
![](assets/screenshots/settings.png) | ![](assets/screenshots/update.png)

## Build instructions
* Install Gradle and Kotlin.
* Clone project.
* Register your app with MyAnimeList as show [here](https://myanimelist.net/blog.php?eid=835707)
* In the project root, add `clientId=<CLIENT ID>` to the `local.properties` file. Create if not found.
* Open in Android studio or Intellij and build and sync project.
* Open in Android studio or Intellij and build and sync project (Be sure the generated classes of Hilt, ViewBinding and Apollo are generated).
* Run on any device and perform OAuth login to give access to your account.

## Credits
Expand Down
31 changes: 15 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ plugins {
id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
id 'com.google.android.gms.oss-licenses-plugin'
id 'androidx.navigation.safeargs.kotlin'
id 'org.jlleitschuh.gradle.ktlint' version "10.1.0"
id 'org.jlleitschuh.gradle.ktlint' version '10.1.0'
id 'com.apollographql.apollo' version '2.5.5'
}

android {
Expand Down Expand Up @@ -44,15 +45,6 @@ android {
viewBinding true
}

kapt {
correctErrorTypes = true
javacOptions {
// FIXME : Remove after kotlin 1.5.20 support in dagger-hilt
option("-Adagger.fastInit=ENABLED")
option("-Adagger.hilt.android.internal.disableAndroidSuperclassValidation=true")
}
}

secrets {
propertiesFileName 'secrets.properties'
defaultPropertiesFileName = 'secrets.defaults.properties'
Expand All @@ -69,32 +61,35 @@ dependencies {
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.fragment:fragment-ktx:1.3.5"
implementation 'androidx.fragment:fragment-ktx:1.4.0-alpha04'
//hilt
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-compiler:$hilt_version"
//networking
//retrofit
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2'
implementation "com.squareup.retrofit2:converter-moshi:2.9.0"
//apollo grahql client
implementation 'com.apollographql.apollo:apollo-runtime:2.5.5'
implementation 'com.apollographql.apollo:apollo-coroutines-support:2.5.5'
//network util
implementation "com.github.haroldadmin:NetworkResponseAdapter:4.1.0"
//moshi
implementation 'com.squareup.moshi:moshi:1.12.0'
implementation "com.squareup.moshi:moshi-kotlin:1.12.0"
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.12.0"
implementation "com.squareup.retrofit2:converter-moshi:2.9.0"
//navigation
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
//datastore
implementation "androidx.datastore:datastore-preferences:1.0.0-rc01"
//coil
implementation 'io.coil-kt:coil:1.2.2'
implementation 'io.coil-kt:coil:1.3.0'
//paging
implementation "androidx.paging:paging-runtime-ktx:$paging_version"
//design
implementation 'com.github.razir.progressbutton:progressbutton:2.1.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation "com.airbnb.android:lottie:3.7.0"
implementation 'com.airbnb.android:lottie:3.7.1'
//util
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
Expand All @@ -107,6 +102,10 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

apollo {
generateKotlinModels.set(true)
}

ktlint {
disabledRules.set(["no-wildcard-imports"])
}
7 changes: 5 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
tools:ignore="LockedOrientationActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

Expand All @@ -47,12 +48,14 @@
</intent-filter>
</activity>
<activity
android:name=".modules.MainActivity"
android:name=".modules.main.ui.MainActivity"
android:launchMode="singleInstance"
android:screenOrientation="sensorPortrait"
android:theme="@style/Theme.MediaHub"
android:windowSoftInputMode="adjustPan"
tools:ignore="LockedOrientationActivity" />
tools:ignore="LockedOrientationActivity">
<nav-graph android:value="@navigation/bottom_nav_graph" />
</activity>
<activity
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
android:theme="@style/Theme.MediaHub.ActionBar" />
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/graphql/nextAiringAnimeEpisode.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
query GetNextAiringAnimeEpisode(
$idMal: Int!
) {
Media(idMal: $idMal, type: ANIME) {
id
idMal
nextAiringEpisode {
id
episode
timeUntilAiring
airingAt
}
}
}
Loading

0 comments on commit c9b3393

Please sign in to comment.