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
dependencies { | |
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | |
implementation 'androidx.core:core-ktx:1.3.2' | |
implementation 'androidx.appcompat:appcompat:1.2.0' | |
implementation 'androidx.activity:activity-ktx:1.2.2' | |
implementation 'androidx.fragment:fragment-ktx:1.3.2' | |
// UI Components | |
implementation 'com.google.android.material:material:1.3.0' | |
implementation 'androidx.constraintlayout:constraintlayout:2.0.4' |
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
plugins { | |
id 'com.android.application' | |
id 'kotlin-android' | |
id 'kotlin-kapt' | |
id 'kotlin-parcelize' | |
id 'dagger.hilt.android.plugin' | |
id 'androidx.navigation.safeargs.kotlin' | |
} |
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
buildFeatures { | |
viewBinding 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
buildscript { | |
ext.kotlin_version = "1.4.21" | |
ext.nav_version = "2.3.4" | |
repositories { | |
google() | |
jcenter() | |
} | |
dependencies { | |
classpath "com.android.tools.build:gradle:4.1.1" | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" |
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
@HiltAndroidApp | |
class App : Application() |
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
<application | |
android:name=".di.App" | |
... | |
... > |
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
@Module | |
@InstallIn(SingletonComponent::class) | |
class ApplicationModule { | |
@Provides | |
fun provideBaseUrl() = "https://api-mobilespecs.azharimm.tk/" | |
@Provides | |
@Singleton | |
fun provideRetrofit(BASE_URL: String): Retrofit = | |
Retrofit.Builder() |
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
interface ApiService { | |
@GET("brands") | |
suspend fun getBrands( | |
@Query("page") page: Int, | |
@Query("limit") limit: Int | |
): Response<BrandResponse> | |
@GET("brands/{brandSlug}") | |
suspend fun getPhones( | |
@Path("brandSlug") brandSlug: String, |
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
{ | |
"status": true, | |
"data": { | |
"page": 1, | |
"limit": 10, | |
"last_page": 12, | |
"brands": [ | |
{ | |
"_id": "5f9918722082abf7d569d671", | |
"brand_slug": "att", |
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
data class BrandResponse( | |
@Json(name = "status") | |
val status: Boolean, | |
@Json(name = "data") | |
val data: BrandDataResponse | |
) |
OlderNewer