-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b8bf0de
Showing
108 changed files
with
3,871 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
apply plugin: 'com.android.application' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-android-extensions' | ||
|
||
android { | ||
compileSdkVersion 29 | ||
buildToolsVersion "29.0.1" | ||
defaultConfig { | ||
applicationId "alfatih.me.moviecatalogue" | ||
minSdkVersion 16 | ||
targetSdkVersion 29 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables.useSupportLibrary = true // This line here | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
implementation 'androidx.appcompat:appcompat:1.1.0' | ||
implementation 'androidx.core:core-ktx:1.1.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' | ||
implementation 'androidx.legacy:legacy-support-v4:1.0.0' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'androidx.test:runner:1.2.0' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' | ||
|
||
// Hawk | ||
implementation "com.orhanobut:hawk:2.0.1" | ||
|
||
// Timber | ||
implementation 'com.jakewharton.timber:timber:4.7.1' | ||
|
||
//Retrofit2 | ||
implementation "com.squareup.retrofit2:retrofit:$retrofit2_version" | ||
implementation "com.squareup.retrofit2:converter-moshi:$retrofit2_version" | ||
implementation "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2" | ||
|
||
// Glide | ||
implementation 'com.github.bumptech.glide:glide:4.9.0' | ||
|
||
// RecyclerView | ||
implementation 'androidx.recyclerview:recyclerview:1.0.0' | ||
implementation 'com.google.android.material:material:1.0.0' | ||
|
||
// View Model | ||
implementation "android.arch.lifecycle:extensions:1.1.1" | ||
implementation "android.arch.lifecycle:viewmodel:1.1.1" | ||
|
||
// Spink Kit Indicator | ||
implementation 'com.github.ybq:Android-SpinKit:1.4.0' | ||
|
||
// Koin AndroidX Scope features | ||
implementation "org.koin:koin-androidx-scope:$koin_version" | ||
// Koin AndroidX ViewModel features | ||
implementation "org.koin:koin-androidx-viewmodel:$koin_version" | ||
// Koin AndroidX Experimental features | ||
implementation "org.koin:koin-androidx-ext:$koin_version" | ||
|
||
} | ||
|
||
androidExtensions { | ||
experimental = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
app/src/androidTest/java/alfatih/me/moviecatalogue/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package alfatih.me.moviecatalogue | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("alfatih.me.moviecatalogue", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:dist="http://schemas.android.com/apk/distribution" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="alfatih.me.moviecatalogue"> | ||
|
||
<!-- https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted --> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
<uses-permission android:name="android.permission.VIBRATE" /> | ||
|
||
<permission | ||
android:name="alfatih.me.moviecatalogue.READ_DATABASE" | ||
android:protectionLevel="normal" /> | ||
<permission | ||
android:name="alfatih.me.moviecatalogue.WRITE_DATABASE" | ||
android:protectionLevel="normal" /> | ||
|
||
<dist:module dist:instant="true" /> | ||
|
||
<application | ||
android:name=".App" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme" | ||
android:usesCleartextTraffic="true" | ||
tools:ignore="GoogleAppIndexingWarning"> | ||
<provider | ||
android:name=".data.source.local.movie.MovieProvider" | ||
android:authorities="alfatih.me.moviecatalogue" | ||
android:enabled="true" | ||
android:exported="true" /> | ||
|
||
<receiver | ||
android:name=".feature.reminder.AlarmReceiver" | ||
android:enabled="true" | ||
android:exported="true" /> | ||
|
||
<activity | ||
android:name=".feature.reminder.ReminderActivity" | ||
android:parentActivityName=".feature.list.ListActivity" /> | ||
|
||
<receiver android:name=".widget.FavoriteMovieWidget"> | ||
<intent-filter> | ||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> | ||
</intent-filter> | ||
|
||
<meta-data | ||
android:name="android.appwidget.provider" | ||
android:resource="@xml/favorite_movie_widget_info" /> | ||
</receiver> | ||
|
||
<activity android:name=".feature.favorite.FavoriteActivity" /> | ||
<activity | ||
android:name=".feature.detail.movie.DetailMovieActivity" | ||
android:parentActivityName=".feature.list.ListActivity" /> | ||
<activity | ||
android:name=".feature.detail.tv.DetailTVShowActivity" | ||
android:parentActivityName=".feature.list.ListActivity" /> | ||
<activity android:name=".feature.list.ListActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<service | ||
android:name=".widget.StackWidgetService" | ||
android:permission="android.permission.BIND_REMOTEVIEWS" /> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package alfatih.me.moviecatalogue | ||
|
||
import alfatih.me.moviecatalogue.feature.detail.movie.module.DetailMovieModule | ||
import alfatih.me.moviecatalogue.feature.detail.tv.module.DetailTVShowModule | ||
import alfatih.me.moviecatalogue.feature.list.module.ListModule | ||
import android.app.Application | ||
import com.orhanobut.hawk.Hawk | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.core.context.startKoin | ||
import timber.log.Timber | ||
import timber.log.Timber.DebugTree | ||
|
||
class App : Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
setupTimber() | ||
setupKoin() | ||
setupHawk() | ||
} | ||
|
||
private fun setupHawk() { | ||
Hawk.init(this).build() | ||
} | ||
|
||
private fun setupKoin() { | ||
startKoin { | ||
androidContext(this@App) | ||
ListModule.module | ||
DetailMovieModule.module | ||
DetailTVShowModule.module | ||
} | ||
} | ||
|
||
private fun setupTimber(){ | ||
if (BuildConfig.DEBUG) { | ||
Timber.plant(DebugTree()) | ||
} | ||
} | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
app/src/main/java/alfatih/me/moviecatalogue/data/model/movie/MovieItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package alfatih.me.moviecatalogue.data.model.movie | ||
|
||
import android.os.Parcel | ||
import android.os.Parcelable | ||
|
||
data class MovieItem( | ||
val adult: Boolean? = false, | ||
val backdrop_path: String? = "", | ||
val genre_ids: List<Int?>? = listOf(), | ||
val id: Int? = 0, | ||
val original_language: String? = "", | ||
val original_title: String? = "", | ||
val overview: String? = "", | ||
val popularity: Double? = 0.0, | ||
val poster_path: String? = "", | ||
val release_date: String? = "", | ||
val title: String? = "", | ||
val video: Boolean? = false, | ||
val vote_average: Double? = 0.0, | ||
val vote_count: Int? = 0, | ||
val base64_image: String? = "" | ||
) : Parcelable { | ||
constructor(source: Parcel) : this( | ||
source.readValue(Boolean::class.java.classLoader) as Boolean?, | ||
source.readString(), | ||
ArrayList<Int?>().apply { source.readList(this as List<*>, Int::class.java.classLoader) }, | ||
source.readValue(Int::class.java.classLoader) as Int?, | ||
source.readString(), | ||
source.readString(), | ||
source.readString(), | ||
source.readValue(Double::class.java.classLoader) as Double?, | ||
source.readString(), | ||
source.readString(), | ||
source.readString(), | ||
source.readValue(Boolean::class.java.classLoader) as Boolean?, | ||
source.readValue(Double::class.java.classLoader) as Double?, | ||
source.readValue(Int::class.java.classLoader) as Int?, | ||
source.readString() | ||
) | ||
|
||
override fun describeContents() = 0 | ||
|
||
override fun writeToParcel(dest: Parcel, flags: Int) = with(dest) { | ||
writeValue(adult) | ||
writeString(backdrop_path) | ||
writeList(genre_ids) | ||
writeValue(id) | ||
writeString(original_language) | ||
writeString(original_title) | ||
writeString(overview) | ||
writeValue(popularity) | ||
writeString(poster_path) | ||
writeString(release_date) | ||
writeString(title) | ||
writeValue(video) | ||
writeValue(vote_average) | ||
writeValue(vote_count) | ||
writeValue(base64_image) | ||
} | ||
|
||
companion object { | ||
@JvmField | ||
val CREATOR: Parcelable.Creator<MovieItem> = object : Parcelable.Creator<MovieItem> { | ||
override fun createFromParcel(source: Parcel): MovieItem = MovieItem(source) | ||
override fun newArray(size: Int): Array<MovieItem?> = arrayOfNulls(size) | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
app/src/main/java/alfatih/me/moviecatalogue/data/model/movie/MovieResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package alfatih.me.moviecatalogue.data.model.movie | ||
|
||
data class MovieResponse( | ||
val page: Int? = 0, | ||
val results: List<MovieItem> = listOf(), | ||
val total_pages: Int? = 0, | ||
val total_results: Int? = 0 | ||
) |
29 changes: 29 additions & 0 deletions
29
app/src/main/java/alfatih/me/moviecatalogue/data/model/movie/detail/DetailResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package alfatih.me.moviecatalogue.data.model.movie.detail | ||
|
||
data class DetailResponse( | ||
val original_language: String? = null, | ||
val imdb_id: String? = null, | ||
val video: Boolean? = null, | ||
val title: String? = null, | ||
val backdrop_path: String? = null, | ||
val revenue: Int? = null, | ||
val genres: List<GenresItem?>? = null, | ||
val popularity: Double? = null, | ||
val production_countries: List<ProductionCountriesItem?>? = null, | ||
val id: Int? = null, | ||
val vote_count: Int? = null, | ||
val budget: Int? = null, | ||
val overview: String? = null, | ||
val original_title: String? = null, | ||
val runtime: Int? = null, | ||
val poster_path: String? = null, | ||
val spoken_languages: List<SpokenLanguagesItem?>? = null, | ||
val production_companies: List<ProductionCompaniesItem?>? = null, | ||
val release_date: String? = null, | ||
val vote_average: Double? = null, | ||
val belongs_to_collection: Any? = null, | ||
val tagline: String? = null, | ||
val adult: Boolean? = null, | ||
val homepage: String? = null, | ||
val status: String? = null | ||
) |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/alfatih/me/moviecatalogue/data/model/movie/detail/GenresItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package alfatih.me.moviecatalogue.data.model.movie.detail | ||
|
||
data class GenresItem( | ||
val name: String? = null, | ||
val id: Int? = null | ||
) |
8 changes: 8 additions & 0 deletions
8
...rc/main/java/alfatih/me/moviecatalogue/data/model/movie/detail/ProductionCompaniesItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package alfatih.me.moviecatalogue.data.model.movie.detail | ||
|
||
data class ProductionCompaniesItem( | ||
val logo_path: String? = null, | ||
val name: String? = null, | ||
val id: Int? = null, | ||
val origin_country: String? = null | ||
) |
6 changes: 6 additions & 0 deletions
6
...rc/main/java/alfatih/me/moviecatalogue/data/model/movie/detail/ProductionCountriesItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package alfatih.me.moviecatalogue.data.model.movie.detail | ||
|
||
data class ProductionCountriesItem( | ||
val iso_3166_1: String? = null, | ||
val name: String? = null | ||
) |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/alfatih/me/moviecatalogue/data/model/movie/detail/SpokenLanguagesItem.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package alfatih.me.moviecatalogue.data.model.movie.detail | ||
|
||
data class SpokenLanguagesItem( | ||
val name: String? = null, | ||
val iso_639_1: String? = null | ||
) |
Oops, something went wrong.