-
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.
Merge pull request #15 from kooroshMa/develop
Develop
- Loading branch information
Showing
90 changed files
with
2,093 additions
and
282 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
-dontobfuscate |
This file was deleted.
Oops, something went wrong.
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,108 @@ | ||
import com.example.buildsrc.Android | ||
import com.example.buildsrc.Libs | ||
|
||
plugins { | ||
id("com.android.application") | ||
id("org.jetbrains.kotlin.android") | ||
id("kotlin-kapt") | ||
id ("dagger.hilt.android.plugin") | ||
} | ||
|
||
android { | ||
namespace = "com.example.composecodechallenge" | ||
compileSdk = Android.compileSdkVersion | ||
|
||
defaultConfig { | ||
applicationId = Android.applicationId | ||
minSdk = Android.minSdkVersion | ||
targetSdk = Android.targetSdkVersion | ||
versionCode = Android.versionCode | ||
versionName = Android.versionName | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
buildConfigField("String", "BASE_URL", "\"https://api.github.com\"") | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
} | ||
create("benchmark") { | ||
signingConfig = signingConfigs.getByName("debug") | ||
matchingFallbacks += listOf("release") | ||
isDebuggable = false | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "17" | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.4.6" | ||
} | ||
packaging { | ||
resources { | ||
excludes.add("/META-INF/{AL2.0,LGPL2.1}") | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(Libs.Modules.data)) | ||
implementation(project(Libs.Modules.domain)) | ||
//--------------------------------------------------------------------------------------------- | ||
implementation(Libs.Jetpack.androidxCore) | ||
implementation (platform(Libs.Common.kotlinBom)) | ||
implementation(Libs.Jetpack.lifecycleRuntime) | ||
implementation(Libs.Jetpack.activityCompose) | ||
implementation (platform(Libs.Jetpack.composeBom)) | ||
implementation(Libs.Jetpack.composeUi) | ||
implementation(Libs.Jetpack.composeUiGraphics) | ||
implementation(Libs.Jetpack.composeUiToolingPreview) | ||
implementation(Libs.Jetpack.composeMaterial3) | ||
implementation(Libs.Jetpack.composeMaterial3WindowSzeClass) | ||
implementation(Libs.Jetpack.lifecycleRuntimeCompose) | ||
implementation(Libs.Jetpack.navigationCompose) | ||
implementation(Libs.Jetpack.trace) | ||
|
||
testImplementation(Libs.Testing.junit) | ||
testImplementation(Libs.Testing.mockitoKotlin) | ||
testImplementation(Libs.Testing.coroutinesTest) | ||
|
||
androidTestImplementation(Libs.Testing.junitEx) | ||
androidTestImplementation(Libs.Testing.espresso) | ||
androidTestImplementation (platform(Libs.Jetpack.composeBom)) | ||
androidTestImplementation(Libs.Testing.composeUiTestJunit4) | ||
debugImplementation(Libs.Jetpack.composeTooling) | ||
debugImplementation(Libs.Testing.composeUiTestManifest) | ||
implementation (Libs.Jetpack.workRuntime) | ||
//---------------------------------------------------------------------------------------------- | ||
implementation(Libs.Jetpack.hiltAndroid) | ||
kapt(Libs.Jetpack.hiltAndroidCompiler) | ||
implementation(Libs.Jetpack.hiltWork) | ||
kapt(Libs.Jetpack.hiltCompiler) | ||
implementation(Libs.Jetpack.hiltNavCompose) | ||
//---------------------------------------------------------------------------------------------- | ||
implementation(Libs.Common.stetho) | ||
implementation(Libs.Common.stetho_OkHttp) | ||
implementation(Libs.Common.okHttpInterceptor) | ||
//---------------------------------------------------------------------------------------------- | ||
implementation(Libs.Common.retrofit) | ||
implementation(Libs.Common.retrofitGson) | ||
//---------------------------------------------------------------------------------------------- | ||
implementation(Libs.Common.arrowCore) | ||
//---------------------------------------------------------------------------------------------- | ||
implementation(Libs.Common.coil) | ||
//---------------------------------------------------------------------------------------------- | ||
implementation(Libs.Common.material) | ||
} |
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
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
17 changes: 0 additions & 17 deletions
17
app/src/main/java/com/example/composecodechallenge/MainActivity.kt
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
app/src/main/java/com/example/composecodechallenge/app/App.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,7 @@ | ||
package com.example.composecodechallenge.app | ||
|
||
import android.app.Application | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
@HiltAndroidApp | ||
class App : Application() |
77 changes: 77 additions & 0 deletions
77
app/src/main/java/com/example/composecodechallenge/di/NetworkModule.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,77 @@ | ||
package com.example.composecodechallenge.di | ||
|
||
import com.example.composecodechallenge.BuildConfig | ||
import com.example.data.di.Cloud | ||
import com.example.data.di.Mock | ||
import com.example.data.restful.API | ||
import com.example.data.source.cloud.BaseCloudRepository | ||
import com.example.data.source.cloud.CloudMockRepository | ||
import com.example.data.source.cloud.CloudRepository | ||
import com.facebook.stetho.okhttp3.StethoInterceptor | ||
import com.google.gson.Gson | ||
import com.google.gson.GsonBuilder | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.Reusable | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import okhttp3.OkHttpClient | ||
import okhttp3.logging.HttpLoggingInterceptor | ||
import retrofit2.Retrofit | ||
import retrofit2.converter.gson.GsonConverterFactory | ||
import java.util.concurrent.TimeUnit | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object NetworkModule { | ||
|
||
@Reusable | ||
@Provides | ||
fun provideGson(): Gson { | ||
return GsonBuilder().create() | ||
} | ||
|
||
@Reusable | ||
@Provides | ||
fun provideOkHttpClient(): OkHttpClient { | ||
val builder = OkHttpClient.Builder() | ||
if (BuildConfig.DEBUG) { | ||
val loggingInterceptor = HttpLoggingInterceptor() | ||
loggingInterceptor.level = HttpLoggingInterceptor.Level.BODY | ||
builder.addInterceptor(loggingInterceptor) | ||
builder.addNetworkInterceptor(StethoInterceptor()) | ||
} | ||
builder.connectTimeout(20L, TimeUnit.SECONDS) | ||
builder.readTimeout(20L, TimeUnit.SECONDS) | ||
builder.writeTimeout(20L, TimeUnit.SECONDS) | ||
return builder.build() | ||
} | ||
|
||
@Reusable | ||
@Provides | ||
fun provideRetrofit(okHttpClient: OkHttpClient, gson: Gson): Retrofit { | ||
return Retrofit.Builder().client(okHttpClient) | ||
.addConverterFactory(GsonConverterFactory.create(gson)) | ||
.baseUrl(BuildConfig.BASE_URL) | ||
.build() | ||
} | ||
|
||
@Reusable | ||
@Provides | ||
fun provideService(retrofit: Retrofit): API { | ||
return retrofit.create(API::class.java) | ||
} | ||
|
||
@Cloud | ||
@Provides | ||
fun provideCloudRepository(apIs: API): BaseCloudRepository { | ||
return CloudRepository(apIs) | ||
} | ||
|
||
@Mock | ||
@Provides | ||
fun provideCloudMockRepository(): BaseCloudRepository { | ||
return CloudMockRepository() | ||
} | ||
|
||
} |
Oops, something went wrong.