Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Asim Latif committed Sep 3, 2021
0 parents commit ede1a65
Show file tree
Hide file tree
Showing 59 changed files with 1,743 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
103 changes: 103 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id 'androidx.navigation.safeargs.kotlin'
}

android {
compileSdk 30

defaultConfig {
applicationId "com.example.akmovies"
minSdk 22
targetSdk 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}

buildFeatures{
viewBinding = true
}


}

dependencies {

implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

//Paging
implementation "androidx.paging:paging-runtime-ktx:3.0.0-beta03"

// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation "com.squareup.okhttp3:okhttp:4.9.0"

// Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'

// Coroutine Lifecycle Scopes
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"
implementation "androidx.activity:activity-ktx:1.3.1"




implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.4.0-alpha03"
kapt "androidx.lifecycle:lifecycle-compiler:2.3.1"



//dagger-hilt
implementation "com.google.dagger:hilt-android:2.37"
kapt "com.google.dagger:hilt-android-compiler:2.37"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
kapt "androidx.hilt:hilt-compiler:1.0.0"

//coil
implementation("io.coil-kt:coil:1.1.1")

// Navigation Components
implementation "androidx.navigation:navigation-fragment-ktx:2.2.1"
implementation "androidx.navigation:navigation-ui-ktx:2.3.5"

// Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
kapt 'com.github.bumptech.glide:compiler:4.11.0'

implementation "androidx.browser:browser:1.3.0"

// Room
implementation "androidx.room:room-runtime:2.3.0"
kapt "androidx.room:room-compiler:2.3.0"
implementation 'androidx.room:room-ktx:2.3.0'

}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.akmovies

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("com.example.akmovies", appContext.packageName)
}
}
24 changes: 24 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.akmovies">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name=".MovieApplication"
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/Theme.AKMovies">
<activity
android:name=".ui.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
9 changes: 9 additions & 0 deletions app/src/main/java/com/example/akmovies/MovieApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.example.akmovies

import android.app.Application
import dagger.hilt.android.HiltAndroidApp


@HiltAndroidApp
class MovieApplication: Application() {
}
24 changes: 24 additions & 0 deletions app/src/main/java/com/example/akmovies/data/api/MovieAPI.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.akmovies.data.api

import com.example.akmovies.data.models.Movie
import com.example.akmovies.data.models.MovieDetails
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query

interface MovieAPI {




@GET("/api/most-popular")
suspend fun getPopularMovies(
@Query("page") pageNumber:Int
):Response<Movie>

@GET("/api/show-details")
suspend fun getMovieDetails(
@Query("q") query:Int
):Response<MovieDetails>

}
8 changes: 8 additions & 0 deletions app/src/main/java/com/example/akmovies/data/models/Episode.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.akmovies.data.models

data class Episode(
val air_date: String,
val episode: Int,
val name: String,
val season: Int
)
8 changes: 8 additions & 0 deletions app/src/main/java/com/example/akmovies/data/models/Movie.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.akmovies.data.models

data class Movie(
val page: Int,
val pages: Int,
val total: String,
val tv_shows: List<TvShow>
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.example.akmovies.data.models

data class MovieDetails(
val tvShow: TvShowX
)
16 changes: 16 additions & 0 deletions app/src/main/java/com/example/akmovies/data/models/TvShow.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.example.akmovies.data.models

import java.io.Serializable


data class TvShow(
val country: String,
val end_date: Any,
val id: Int,
val image_thumbnail_path: String,
val name: String,
val network: String,
val permalink: String,
val start_date: String,
val status: String
):Serializable
25 changes: 25 additions & 0 deletions app/src/main/java/com/example/akmovies/data/models/TvShowX.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.example.akmovies.data.models

data class TvShowX(
val countdown: Any,
val country: String,
val description: String,
val description_source: String,
val end_date: Any,
val episodes: List<Episode>,
val genres: List<String>,
val id: Int,
val image_path: String,
val image_thumbnail_path: String,
val name: String,
val network: String,
val permalink: String,
val pictures: List<String>,
val rating: String,
val rating_count: String,
val runtime: Int,
val start_date: String,
val status: String,
val url: String,
val youtube_link: Any
)
Loading

0 comments on commit ede1a65

Please sign in to comment.