diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e9e2349
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,224 @@
+
+# Created by https://www.gitignore.io/api/kotlin,android,androidstudio
+# Edit at https://www.gitignore.io/?templates=kotlin,android,androidstudio
+
+### Android ###
+# Built application files
+*.apk
+*.ap_
+*.aab
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+release/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# IntelliJ
+*.iml
+.idea/workspace.xml
+.idea/tasks.xml
+.idea/gradle.xml
+.idea/assetWizardSettings.xml
+.idea/dictionaries
+.idea/libraries
+# Android Studio 3 in .gitignore file.
+.idea/caches
+.idea/modules.xml
+# Comment next line if keeping position of elements in Navigation Editor is relevant for you
+.idea/navEditor.xml
+
+# Keystore files
+# Uncomment the following lines if you do not want to check your keystore files in.
+#*.jks
+#*.keystore
+
+# External native build folder generated in Android Studio 2.2 and later
+.externalNativeBuild
+
+# Google Services (e.g. APIs or Firebase)
+# google-services.json
+
+# Freeline
+freeline.py
+freeline/
+freeline_project_description.json
+
+# fastlane
+fastlane/report.xml
+fastlane/Preview.html
+fastlane/screenshots
+fastlane/test_output
+fastlane/readme.md
+
+# Version control
+vcs.xml
+
+# lint
+lint/intermediates/
+lint/generated/
+lint/outputs/
+lint/tmp/
+# lint/reports/
+
+### Android Patch ###
+gen-external-apklibs
+output.json
+
+# Replacement of .externalNativeBuild directories introduced
+# with Android Studio 3.5.
+.cxx/
+
+### Kotlin ###
+# Compiled class file
+
+# Log file
+
+# BlueJ files
+*.ctxt
+
+# Mobile Tools for Java (J2ME)
+.mtj.tmp/
+
+# Package Files #
+*.jar
+*.war
+*.nar
+*.ear
+*.zip
+*.tar.gz
+*.rar
+
+# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
+hs_err_pid*
+
+### AndroidStudio ###
+# Covers files to be ignored for android development using Android Studio.
+
+# Built application files
+
+# Files for the ART/Dalvik VM
+
+# Java class files
+
+# Generated files
+
+# Gradle files
+.gradle
+
+# Signing files
+.signing/
+
+# Local configuration file (sdk path, etc)
+
+# Proguard folder generated by Eclipse
+
+# Log Files
+
+# Android Studio
+/*/build/
+/*/local.properties
+/*/out
+/*/*/build
+/*/*/production
+*.ipr
+*~
+*.swp
+
+# Android Patch
+
+# External native build folder generated in Android Studio 2.2 and later
+
+# NDK
+obj/
+
+# IntelliJ IDEA
+*.iws
+/out/
+
+# User-specific configurations
+.idea/caches/
+.idea/libraries/
+.idea/shelf/
+.idea/.name
+.idea/compiler.xml
+.idea/copyright/profiles_settings.xml
+.idea/encodings.xml
+.idea/misc.xml
+.idea/scopes/scope_settings.xml
+.idea/vcs.xml
+.idea/jsLibraryMappings.xml
+.idea/datasources.xml
+.idea/dataSources.ids
+.idea/sqlDataSources.xml
+.idea/dynamic.xml
+.idea/uiDesigner.xml
+
+# OS-specific files
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
+
+# Legacy Eclipse project files
+.classpath
+.project
+.cproject
+.settings/
+
+# Mobile Tools for Java (J2ME)
+
+# Package Files #
+
+# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
+
+## Plugin-specific files:
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Mongo Explorer plugin
+.idea/mongoSettings.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+### AndroidStudio Patch ###
+
+!/gradle/wrapper/gradle-wrapper.jar
+
+# End of https://www.gitignore.io/api/kotlin,android,androidstudio
\ No newline at end of file
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..5bd63c1
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..79ee123
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 0000000..7f68460
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 0000000..3f48136
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,62 @@
+apply plugin: 'com.android.application'
+
+apply plugin: 'kotlin-android'
+
+apply plugin: 'kotlin-android-extensions'
+
+apply plugin: 'kotlin-kapt'
+
+
+android {
+ compileSdkVersion 29
+ buildToolsVersion "29.0.0"
+ defaultConfig {
+ applicationId "com.study.myapplication"
+ minSdkVersion 21
+ targetSdkVersion 29
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+ dataBinding {
+ enabled = true
+ }
+}
+
+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'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+ implementation 'androidx.core:core-ktx:1.1.0'
+ implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
+ implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0-rc03'
+ implementation 'com.squareup.retrofit2:retrofit:2.7.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
+ implementation "com.squareup.moshi:moshi:1.9.2"
+ implementation 'com.squareup.okhttp3:okhttp:4.2.2'
+ implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
+ implementation 'com.google.android.material:material:1.2.0-alpha02'
+ implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
+ implementation 'org.koin:koin-android:2.0.1'
+ implementation 'org.koin:koin-androidx-viewmodel:2.0.1'
+ implementation 'com.github.bumptech.glide:glide:4.9.0'
+ kapt "android.arch.lifecycle:compiler:1.1.1"
+ kapt 'com.github.bumptech.glide:compiler:4.9.0'
+ implementation 'androidx.room:room-runtime:2.1.0'
+ kapt 'androidx.room:room-compiler:2.1.0'
+ implementation 'com.github.bumptech.glide:glide:4.9.0'
+ kapt 'com.github.bumptech.glide:compiler:4.9.0'
+ implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2"
+ implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2"
+}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 0000000..f1b4245
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -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
diff --git a/app/src/androidTest/java/com/study/myapplication/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/study/myapplication/ExampleInstrumentedTest.kt
new file mode 100644
index 0000000..c7d2e36
--- /dev/null
+++ b/app/src/androidTest/java/com/study/myapplication/ExampleInstrumentedTest.kt
@@ -0,0 +1,24 @@
+package com.study.myapplication
+
+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.study.myapplication", appContext.packageName)
+ }
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..c0f62b9
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/KoinExt.kt b/app/src/main/java/com/study/myapplication/KoinExt.kt
new file mode 100644
index 0000000..cbb125b
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/KoinExt.kt
@@ -0,0 +1,19 @@
+package com.study.myapplication
+
+import android.content.Context
+import org.koin.android.ext.koin.androidContext
+import org.koin.android.logger.AndroidLogger
+import org.koin.core.context.startKoin
+import org.koin.core.logger.EmptyLogger
+import org.koin.core.module.Module
+
+fun setupKoin(
+ context: Context,
+ vararg module: Module
+) {
+ startKoin {
+ logger(if (BuildConfig.DEBUG) AndroidLogger() else EmptyLogger())
+ androidContext(context)
+ modules(module.asList())
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/MainApplication.kt b/app/src/main/java/com/study/myapplication/MainApplication.kt
new file mode 100644
index 0000000..cd930f3
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/MainApplication.kt
@@ -0,0 +1,30 @@
+package com.study.myapplication
+
+import android.app.Application
+import com.study.myapplication.data.di.getNetworkModule
+import com.study.myapplication.data.di.getRepositoryModule
+import com.study.myapplication.domain.di.getUseCaseModule
+import com.study.myapplication.presentation.di.getAppModule
+
+class MainApplication : Application() {
+
+ private val upbitUrl = "https://api.upbit.com"
+ private val bithumbUrl = "https://api.bithumb.com"
+ private val coinOneUrl = "https://api.coinone.co.kr"
+
+ override fun onCreate() {
+ super.onCreate()
+ setupKoin(
+ this,
+ getNetworkModule(
+ upbitUrl,
+ bithumbUrl,
+ coinOneUrl
+ ),
+ getAppModule(),
+ getRepositoryModule(),
+ getUseCaseModule()
+ )
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/data/api/BithumbApi.kt b/app/src/main/java/com/study/myapplication/data/api/BithumbApi.kt
new file mode 100644
index 0000000..cf620bf
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/api/BithumbApi.kt
@@ -0,0 +1,10 @@
+package com.study.myapplication.data.api
+
+import com.study.myapplication.data.api.model.BithumbTickerResponse
+import retrofit2.http.GET
+
+interface BithumbApi {
+
+ @GET("public/ticker/all_krw")
+ suspend fun getTickerInfo(): BithumbTickerResponse
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/data/api/CoinOneApi.kt b/app/src/main/java/com/study/myapplication/data/api/CoinOneApi.kt
new file mode 100644
index 0000000..b5158cf
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/api/CoinOneApi.kt
@@ -0,0 +1,9 @@
+package com.study.myapplication.data.api
+
+import retrofit2.http.GET
+import retrofit2.http.Query
+
+interface CoinOneApi {
+ @GET("ticker")
+ suspend fun getTickerInfo(@Query("currency") currency: String = "all"): Map
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/data/api/UpbitApi.kt b/app/src/main/java/com/study/myapplication/data/api/UpbitApi.kt
new file mode 100644
index 0000000..64cc6bb
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/api/UpbitApi.kt
@@ -0,0 +1,15 @@
+package com.study.myapplication.data.api
+
+import com.study.myapplication.data.api.model.UpbitMarketResponse
+import com.study.myapplication.data.api.model.UpbitTickerResponse
+import retrofit2.http.GET
+import retrofit2.http.Query
+
+interface UpbitApi {
+
+ @GET("v1/market/all/")
+ suspend fun getMarketList(): List
+
+ @GET("v1/ticker/")
+ suspend fun getTickerInfo(@Query("markets") markets: String): List
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/data/api/model/BithumbTicker.kt b/app/src/main/java/com/study/myapplication/data/api/model/BithumbTicker.kt
new file mode 100644
index 0000000..b4887c3
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/api/model/BithumbTicker.kt
@@ -0,0 +1,30 @@
+package com.study.myapplication.data.api.model
+
+import com.google.gson.annotations.SerializedName
+
+data class BithumbTicker(
+ @SerializedName("acc_trade_value")
+ val accTradeValue: String?,
+ @SerializedName("acc_trade_value_24H")
+ val accTradeValue24H: String?,
+ @SerializedName("closing_price")
+ val closingPrice: String?,
+ @SerializedName("date")
+ val date: String?,
+ @SerializedName("fluctate_24H")
+ val fluctate24H: String?,
+ @SerializedName("fluctate_rate_24H")
+ val fluctateRate24H: String?,
+ @SerializedName("max_price")
+ val maxPrice: String?,
+ @SerializedName("min_price")
+ val minPrice: String?,
+ @SerializedName("opening_price")
+ val openingPrice: String?,
+ @SerializedName("prev_closing_price")
+ val prevClosingPrice: String?,
+ @SerializedName("units_traded")
+ val unitsTraded: String?,
+ @SerializedName("units_traded_24H")
+ val unitsTraded24H: String?
+)
diff --git a/app/src/main/java/com/study/myapplication/data/api/model/BithumbTickerResponse.kt b/app/src/main/java/com/study/myapplication/data/api/model/BithumbTickerResponse.kt
new file mode 100644
index 0000000..e3a902a
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/api/model/BithumbTickerResponse.kt
@@ -0,0 +1,11 @@
+package com.study.myapplication.data.api.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class BithumbTickerResponse(
+ @SerializedName("data")
+ val data: Map?,
+ @SerializedName("status")
+ val status: String?
+)
diff --git a/app/src/main/java/com/study/myapplication/data/api/model/CoinOneTicker.kt b/app/src/main/java/com/study/myapplication/data/api/model/CoinOneTicker.kt
new file mode 100644
index 0000000..5e1905e
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/api/model/CoinOneTicker.kt
@@ -0,0 +1,29 @@
+package com.study.myapplication.data.api.model
+
+
+import com.google.gson.annotations.SerializedName
+
+data class CoinOneTicker(
+ @SerializedName("currency")
+ val currency: String?,
+ @SerializedName("first")
+ val first: String?,
+ @SerializedName("high")
+ val high: String?,
+ @SerializedName("last")
+ val last: String?,
+ @SerializedName("low")
+ val low: String?,
+ @SerializedName("volume")
+ val volume: String?,
+ @SerializedName("yesterday_first")
+ val yesterdayFirst: String?,
+ @SerializedName("yesterday_high")
+ val yesterdayHigh: String?,
+ @SerializedName("yesterday_last")
+ val yesterdayLast: String?,
+ @SerializedName("yesterday_low")
+ val yesterdayLow: String?,
+ @SerializedName("yesterday_volume")
+ val yesterdayVolume: String?
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/data/api/model/UpbitMarketResponse.kt b/app/src/main/java/com/study/myapplication/data/api/model/UpbitMarketResponse.kt
new file mode 100644
index 0000000..d16a995
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/api/model/UpbitMarketResponse.kt
@@ -0,0 +1,16 @@
+package com.study.myapplication.data.api.model
+
+import com.google.gson.annotations.SerializedName
+
+data class UpbitMarketResponse(
+
+ @SerializedName("english_name")
+ val englishName: String,
+
+ @SerializedName("korean_name")
+ val koreanName: String,
+
+ @SerializedName("market")
+ val market: String
+
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/data/api/model/UpbitTickerResponse.kt b/app/src/main/java/com/study/myapplication/data/api/model/UpbitTickerResponse.kt
new file mode 100644
index 0000000..691583c
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/api/model/UpbitTickerResponse.kt
@@ -0,0 +1,89 @@
+package com.study.myapplication.data.api.model
+
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+import com.google.gson.annotations.SerializedName
+
+@Entity(tableName = "ticker")
+data class UpbitTickerResponse(
+
+ @SerializedName("acc_trade_price")
+ val accTradePrice: Double,
+
+ @SerializedName("acc_trade_price_24h")
+ val accTradePrice24h: Double,
+
+ @SerializedName("acc_trade_volume")
+ val accTradeVolume: Double,
+
+ @SerializedName("acc_trade_volume_24h")
+ val accTradeVolume24h: Double,
+
+ @SerializedName("change")
+ val change: String,
+
+ @SerializedName("change_price")
+ val changePrice: Double,
+
+ @SerializedName("change_rate")
+ val changeRate: Double,
+
+ @SerializedName("high_price")
+ val highPrice: Double,
+
+ @SerializedName("highest_52_week_date")
+ val highest52WeekDate: String,
+
+ @SerializedName("highest_52_week_price")
+ val highest52WeekPrice: Double,
+
+ @SerializedName("low_price")
+ val lowPrice: Double,
+
+ @SerializedName("lowest_52_week_date")
+ val lowest52WeekDate: String,
+
+ @SerializedName("lowest_52_week_price")
+ val lowest52WeekPrice: Double,
+
+ @PrimaryKey
+ @SerializedName("market")
+ var market: String,
+
+ @SerializedName("opening_price")
+ val openingPrice: Double,
+
+ @SerializedName("prev_closing_price")
+ val prevClosingPrice: Double,
+
+ @SerializedName("signed_change_price")
+ val signedChangePrice: Double,
+
+ @SerializedName("signed_change_rate")
+ val signedChangeRate: Double,
+
+ @SerializedName("timestamp")
+ val timestamp: Long,
+
+ @SerializedName("trade_date")
+ val tradeDate: String,
+
+ @SerializedName("trade_date_kst")
+ val tradeDateKst: String,
+
+ @SerializedName("trade_price")
+ var tradePrice: Double,
+
+ @SerializedName("trade_time")
+ val tradeTime: String,
+
+ @SerializedName("trade_time_kst")
+ val tradeTimeKst: String,
+
+ @SerializedName("trade_time_stamp")
+ val tradeTimeStamp: Long,
+
+ @SerializedName("trade_volume")
+ val tradeVolume: Double
+
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/data/di/NetworkModule.kt b/app/src/main/java/com/study/myapplication/data/di/NetworkModule.kt
new file mode 100644
index 0000000..323e06d
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/di/NetworkModule.kt
@@ -0,0 +1,51 @@
+package com.study.myapplication.data.di
+
+import com.study.myapplication.BuildConfig
+import com.study.myapplication.data.api.BithumbApi
+import com.study.myapplication.data.api.CoinOneApi
+import com.study.myapplication.data.api.UpbitApi
+import okhttp3.OkHttpClient
+import okhttp3.logging.HttpLoggingInterceptor
+import org.koin.core.parameter.parametersOf
+import org.koin.dsl.module
+import retrofit2.Converter
+import retrofit2.Retrofit
+import retrofit2.converter.gson.GsonConverterFactory
+
+fun getNetworkModule(upbitUrl: String, bithumbUrl: String, coinOneUrl: String) = module {
+ single {
+ OkHttpClient.Builder()
+ .addInterceptor(HttpLoggingInterceptor().apply {
+ level = if (BuildConfig.DEBUG) {
+ HttpLoggingInterceptor.Level.BODY
+ } else {
+ HttpLoggingInterceptor.Level.NONE
+ }
+ })
+ .build()
+ }
+
+ single {
+ GsonConverterFactory.create() as Converter.Factory
+ }
+
+ factory { (url: String) ->
+ Retrofit.Builder()
+ .baseUrl(url)
+ .addConverterFactory(get())
+ .build()
+ }
+
+ single {
+ get { parametersOf(upbitUrl) }.create(UpbitApi::class.java)
+ }
+
+ single {
+ get { parametersOf(bithumbUrl) }.create(BithumbApi::class.java)
+ }
+
+ single {
+ get { parametersOf(coinOneUrl) }.create(CoinOneApi::class.java)
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/data/di/RepositoryModule.kt b/app/src/main/java/com/study/myapplication/data/di/RepositoryModule.kt
new file mode 100644
index 0000000..61aa78a
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/di/RepositoryModule.kt
@@ -0,0 +1,22 @@
+package com.study.myapplication.data.di
+
+import com.study.myapplication.data.source.CoinDataSource
+import com.study.myapplication.data.source.DefaultCoinRepository
+import com.study.myapplication.data.source.remote.CoinRemoteDataSource
+import com.study.myapplication.domain.repository.CoinRepository
+import org.koin.dsl.module
+
+fun getRepositoryModule() = module {
+
+ single {
+ CoinRemoteDataSource(
+ get(),
+ get(),
+ get()
+ )
+ }
+
+ single {
+ DefaultCoinRepository(get())
+ }
+}
diff --git a/app/src/main/java/com/study/myapplication/data/source/CoinDataSource.kt b/app/src/main/java/com/study/myapplication/data/source/CoinDataSource.kt
new file mode 100644
index 0000000..3a213e6
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/source/CoinDataSource.kt
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2017, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.study.myapplication.data.source
+
+import com.study.myapplication.data.api.model.BithumbTickerResponse
+import com.study.myapplication.data.api.model.UpbitMarketResponse
+import com.study.myapplication.data.api.model.UpbitTickerResponse
+
+interface CoinDataSource {
+
+ suspend fun getUpbitMarket(): List
+
+ suspend fun getUpbitCoin(markets: String): List
+
+ suspend fun getBithumbCoin(): BithumbTickerResponse
+
+ suspend fun getCoinOneCoin(): Map
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/data/source/DefaultCoinRepository.kt b/app/src/main/java/com/study/myapplication/data/source/DefaultCoinRepository.kt
new file mode 100644
index 0000000..c241067
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/source/DefaultCoinRepository.kt
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2017, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.study.myapplication.data.source
+
+import com.google.gson.Gson
+import com.study.myapplication.data.api.model.BithumbTicker
+import com.study.myapplication.data.api.model.CoinOneTicker
+import com.study.myapplication.domain.entity.Market
+import com.study.myapplication.domain.entity.Ticker
+import com.study.myapplication.domain.enum.CoinExchangeStation
+import com.study.myapplication.domain.repository.CoinRepository
+import java.util.*
+
+class DefaultCoinRepository(
+ private val remoteDataSource: CoinDataSource
+) : CoinRepository {
+
+ override suspend fun getUpbitMarket(): List =
+ remoteDataSource.getUpbitMarket()
+ .filter { it.market.startsWith("KRW") }
+ .map { res ->
+ Market(res.market)
+ }
+
+
+ override suspend fun getUpbitCoin(marketList: List): Map =
+ remoteDataSource.getUpbitCoin(marketList.map { it.marketName }.joinToString()).map {
+ it.market.split("-")[1].toUpperCase(Locale.US) to Ticker(
+ coinPrice = it.openingPrice, coinExchangeStation = CoinExchangeStation.UPBIT
+ )
+ }.toMap()
+
+
+ override suspend fun getBithumbCoin(): Map =
+ (remoteDataSource.getBithumbCoin().data as MutableMap)
+ .filter { it.key != "date" }
+ .map {
+ val bithumbTicker = Gson().fromJson(
+ it.value.toString(),
+ BithumbTicker::class.java
+ )
+ it.key.toUpperCase(Locale.US) to Ticker(
+ coinPrice = bithumbTicker.openingPrice?.toDouble() ?: 0.0,
+ coinExchangeStation = CoinExchangeStation.BITHUMB
+ )
+ }.toMap()
+
+ override suspend fun getCoinOneCoin(): Map {
+ return remoteDataSource.getCoinOneCoin()
+ .filter { it.key != "timestamp" && it.key != "result" && it.key != "errorCode" }
+ .map {
+ val coinOneCoinInfo = Gson().fromJson(
+ it.value.toString(), CoinOneTicker::class.java
+ )
+ it.key.toUpperCase(Locale.US) to Ticker(
+ coinPrice = coinOneCoinInfo.last?.toDouble() ?: 0.0,
+ coinExchangeStation = CoinExchangeStation.COINONE
+ )
+ }.toMap()
+ }
+
+}
diff --git a/app/src/main/java/com/study/myapplication/data/source/remote/CoinRemoteDataSource.kt b/app/src/main/java/com/study/myapplication/data/source/remote/CoinRemoteDataSource.kt
new file mode 100644
index 0000000..0ace892
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/data/source/remote/CoinRemoteDataSource.kt
@@ -0,0 +1,27 @@
+package com.study.myapplication.data.source.remote
+
+import com.study.myapplication.data.api.BithumbApi
+import com.study.myapplication.data.api.CoinOneApi
+import com.study.myapplication.data.api.UpbitApi
+import com.study.myapplication.data.api.model.BithumbTickerResponse
+import com.study.myapplication.data.api.model.UpbitMarketResponse
+import com.study.myapplication.data.api.model.UpbitTickerResponse
+import com.study.myapplication.data.source.CoinDataSource
+
+class CoinRemoteDataSource(
+ private val upbitApi: UpbitApi,
+ private val biThumbApiApi: BithumbApi,
+ private val coinOneApi: CoinOneApi
+) : CoinDataSource {
+
+ override suspend fun getUpbitMarket(): List = upbitApi.getMarketList()
+
+ override suspend fun getUpbitCoin(markets: String): List =
+ upbitApi.getTickerInfo(markets)
+
+ override suspend fun getBithumbCoin(): BithumbTickerResponse = biThumbApiApi.getTickerInfo()
+
+ override suspend fun getCoinOneCoin(): Map = coinOneApi.getTickerInfo()
+
+}
+
diff --git a/app/src/main/java/com/study/myapplication/domain/di/UseCaseModule.kt b/app/src/main/java/com/study/myapplication/domain/di/UseCaseModule.kt
new file mode 100644
index 0000000..5f2da83
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/domain/di/UseCaseModule.kt
@@ -0,0 +1,25 @@
+package com.study.myapplication.domain.di
+
+import com.study.myapplication.domain.usecase.GetBithumbCoinUseCase
+import com.study.myapplication.domain.usecase.GetCoinOneCoinUseCase
+import com.study.myapplication.domain.usecase.GetUpbitCoinListUseCase
+import com.study.myapplication.domain.usecase.GetUpbitMarketUseCase
+import org.koin.dsl.module
+
+fun getUseCaseModule() = module {
+ single {
+ GetUpbitMarketUseCase(get())
+ }
+
+ single {
+ GetUpbitCoinListUseCase(get())
+ }
+
+ single {
+ GetBithumbCoinUseCase(get())
+ }
+
+ single {
+ GetCoinOneCoinUseCase(get())
+ }
+}
diff --git a/app/src/main/java/com/study/myapplication/domain/entity/Market.kt b/app/src/main/java/com/study/myapplication/domain/entity/Market.kt
new file mode 100644
index 0000000..aa807c1
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/domain/entity/Market.kt
@@ -0,0 +1,3 @@
+package com.study.myapplication.domain.entity
+
+data class Market(var marketName: String? = "")
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/domain/entity/Ticker.kt b/app/src/main/java/com/study/myapplication/domain/entity/Ticker.kt
new file mode 100644
index 0000000..d7b62c9
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/domain/entity/Ticker.kt
@@ -0,0 +1,8 @@
+package com.study.myapplication.domain.entity
+
+import com.study.myapplication.domain.enum.CoinExchangeStation
+
+data class Ticker(
+ var coinPrice: Double = 0.0,
+ var coinExchangeStation: CoinExchangeStation
+)
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/domain/enum/CoinExchangeStation.kt b/app/src/main/java/com/study/myapplication/domain/enum/CoinExchangeStation.kt
new file mode 100644
index 0000000..d0c9341
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/domain/enum/CoinExchangeStation.kt
@@ -0,0 +1,5 @@
+package com.study.myapplication.domain.enum
+
+enum class CoinExchangeStation {
+ UPBIT, BITHUMB, COINONE
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/domain/repository/CoinRepository.kt b/app/src/main/java/com/study/myapplication/domain/repository/CoinRepository.kt
new file mode 100644
index 0000000..af4bbee
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/domain/repository/CoinRepository.kt
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2017, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.study.myapplication.domain.repository
+
+import com.study.myapplication.domain.entity.Market
+import com.study.myapplication.domain.entity.Ticker
+
+interface CoinRepository {
+
+ suspend fun getUpbitMarket(): List
+
+ suspend fun getUpbitCoin(marketList: List): Map
+
+ suspend fun getBithumbCoin(): Map
+
+ suspend fun getCoinOneCoin(): Map
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/domain/usecase/GetBithumbCoinUseCase.kt b/app/src/main/java/com/study/myapplication/domain/usecase/GetBithumbCoinUseCase.kt
new file mode 100644
index 0000000..0623121
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/domain/usecase/GetBithumbCoinUseCase.kt
@@ -0,0 +1,11 @@
+package com.study.myapplication.domain.usecase
+
+import com.study.myapplication.domain.repository.CoinRepository
+import com.study.myapplication.domain.entity.Ticker
+
+class GetBithumbCoinUseCase(private val repository: CoinRepository) {
+ suspend operator fun invoke(): Map {
+ return repository.getBithumbCoin()
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/domain/usecase/GetCoinOneCoinUseCase.kt b/app/src/main/java/com/study/myapplication/domain/usecase/GetCoinOneCoinUseCase.kt
new file mode 100644
index 0000000..5159b72
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/domain/usecase/GetCoinOneCoinUseCase.kt
@@ -0,0 +1,11 @@
+package com.study.myapplication.domain.usecase
+
+import com.study.myapplication.domain.repository.CoinRepository
+import com.study.myapplication.domain.entity.Ticker
+
+class GetCoinOneCoinUseCase(private val repository: CoinRepository) {
+ suspend operator fun invoke(): Map {
+ return repository.getCoinOneCoin()
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/domain/usecase/GetUpbitCoinListUseCase.kt b/app/src/main/java/com/study/myapplication/domain/usecase/GetUpbitCoinListUseCase.kt
new file mode 100644
index 0000000..03edd6e
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/domain/usecase/GetUpbitCoinListUseCase.kt
@@ -0,0 +1,12 @@
+package com.study.myapplication.domain.usecase
+
+import com.study.myapplication.domain.repository.CoinRepository
+import com.study.myapplication.domain.entity.Market
+import com.study.myapplication.domain.entity.Ticker
+
+class GetUpbitCoinListUseCase(private val repository: CoinRepository) {
+ suspend operator fun invoke(markeList: List): Map {
+ return repository.getUpbitCoin(markeList)
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/domain/usecase/GetUpbitMarketUseCase.kt b/app/src/main/java/com/study/myapplication/domain/usecase/GetUpbitMarketUseCase.kt
new file mode 100644
index 0000000..1a10112
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/domain/usecase/GetUpbitMarketUseCase.kt
@@ -0,0 +1,11 @@
+package com.study.myapplication.domain.usecase
+
+import com.study.myapplication.domain.repository.CoinRepository
+import com.study.myapplication.domain.entity.Market
+
+class GetUpbitMarketUseCase(private val repository: CoinRepository) {
+ suspend operator fun invoke(): List {
+ return repository.getUpbitMarket()
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/base/BaseActivity.kt b/app/src/main/java/com/study/myapplication/presentation/base/BaseActivity.kt
new file mode 100644
index 0000000..733ee49
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/base/BaseActivity.kt
@@ -0,0 +1,41 @@
+package com.study.myapplication.presentation.base
+
+import android.os.Bundle
+import android.widget.Toast
+import androidx.annotation.LayoutRes
+import androidx.appcompat.app.AppCompatActivity
+import androidx.databinding.DataBindingUtil
+import androidx.databinding.ViewDataBinding
+import androidx.lifecycle.ViewModel
+import com.study.myapplication.BR
+
+
+abstract class BaseActivity(
+ @LayoutRes private val layoutResId: Int
+) : AppCompatActivity() {
+
+ protected lateinit var binding: B
+ private set
+
+ abstract val viewModel: VM
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ binding = DataBindingUtil.inflate(layoutInflater, layoutResId, null, false)
+ binding {
+ binding.lifecycleOwner = this@BaseActivity
+ binding.setVariable(BR.vm, viewModel)
+ }
+ setContentView(binding.root)
+
+ }
+
+ protected fun binding(action: B.() -> Unit) {
+ binding.run(action)
+ }
+
+ protected fun toastM(message: String) {
+ Toast.makeText(this, message, Toast.LENGTH_LONG).show()
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/base/BaseViewModel.kt b/app/src/main/java/com/study/myapplication/presentation/base/BaseViewModel.kt
new file mode 100644
index 0000000..750e7fa
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/base/BaseViewModel.kt
@@ -0,0 +1,16 @@
+package com.study.myapplication.presentation.base
+
+import androidx.lifecycle.LiveData
+import androidx.lifecycle.MutableLiveData
+import androidx.lifecycle.ViewModel
+import com.study.myapplication.presentation.utils.event.Event
+
+abstract class BaseViewModel : ViewModel() {
+
+ protected val _isDataLoading = MutableLiveData(true)
+ val isDataLoading: LiveData get() = _isDataLoading
+
+ protected val _isDataLoadingError = MutableLiveData(Event("" to false))
+ val isDataLoadingError: LiveData>> get() = _isDataLoadingError
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/base/SimpleRecyclerView.kt b/app/src/main/java/com/study/myapplication/presentation/base/SimpleRecyclerView.kt
new file mode 100755
index 0000000..062c6ba
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/base/SimpleRecyclerView.kt
@@ -0,0 +1,81 @@
+package com.study.myapplication.presentation.base
+
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.annotation.LayoutRes
+import androidx.databinding.DataBindingUtil
+import androidx.databinding.ViewDataBinding
+import androidx.recyclerview.widget.RecyclerView
+
+abstract class SimpleRecyclerView {
+
+ abstract class Adapter- (
+ @LayoutRes private val layoutRes: Int = -1,
+ private val bindingVariableId: Int? = null,
+ private val onClicked: (Any, View, Int) -> Unit
+ ) : RecyclerView.Adapter>() {
+
+ protected val items = mutableListOf
- ()
+
+ fun replaceAll(items: List
- ?) {
+ items?.let {
+ this.items.run {
+ clear()
+ addAll(it)
+ }
+ }
+ }
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) =
+ object : ViewHolder(
+ layoutRes = layoutRes,
+ parent = parent,
+ bindingVariableId = bindingVariableId,
+ onClicked = onClicked
+ ) {}
+
+ override fun getItemCount(): Int = items.size
+
+
+ override fun onBindViewHolder(holder: ViewHolder, position: Int) {
+ holder.onBindViewHolder(items[position], position)
+ }
+ }
+
+
+ abstract class ViewHolder(
+ @LayoutRes layoutRes: Int,
+ parent: ViewGroup?,
+ private val bindingVariableId: Int?,
+ private val onClicked: (Any, View, Int) -> Unit
+ ) : RecyclerView.ViewHolder(
+ LayoutInflater.from(parent?.context)
+ .inflate(layoutRes, parent, false)
+ ) {
+
+ val binding: B = DataBindingUtil.bind(itemView)!!
+ fun onBindViewHolder(item: Any?, position: Int) {
+ try {
+ // marquee 때문에 추가
+ itemView.isSelected = true
+ binding.run {
+ bindingVariableId?.let {
+ setVariable(it, item)
+ }
+ executePendingBindings()
+ }
+ itemView.visibility = View.VISIBLE
+ itemView.setOnClickListener {
+ item?.let {
+ onClicked(it, itemView, position)
+ }
+ }
+ } catch (e: Exception) {
+ e.printStackTrace()
+ itemView.visibility = View.GONE
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/compare/CompareCoinActivity.kt b/app/src/main/java/com/study/myapplication/presentation/compare/CompareCoinActivity.kt
new file mode 100644
index 0000000..b4ca238
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/compare/CompareCoinActivity.kt
@@ -0,0 +1,31 @@
+package com.study.myapplication.presentation.compare
+
+import android.os.Bundle
+import androidx.lifecycle.Observer
+import com.study.myapplication.R
+import com.study.myapplication.presentation.base.BaseActivity
+import com.study.myapplication.databinding.ActivityCompareCoinBinding
+import com.study.myapplication.presentation.utils.event.EventObserver
+import org.koin.androidx.viewmodel.ext.android.viewModel
+
+class CompareCoinActivity :
+ BaseActivity(R.layout.activity_compare_coin) {
+
+ override val viewModel by viewModel()
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ binding {
+ compareCoinRv.adapter = CompareCoinAdapter()
+ }
+ viewModel.coinList.observe(this, Observer {
+ (binding.compareCoinRv.adapter as CompareCoinAdapter).setCoinList(it)
+ })
+ viewModel.isDataLoadingError.observe(this, EventObserver {
+ if (it.second) {
+ toastM("${it.first}")
+ }
+ })
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/compare/CompareCoinAdapter.kt b/app/src/main/java/com/study/myapplication/presentation/compare/CompareCoinAdapter.kt
new file mode 100644
index 0000000..aaf501f
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/compare/CompareCoinAdapter.kt
@@ -0,0 +1,44 @@
+package com.study.myapplication.presentation.compare
+
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.recyclerview.widget.RecyclerView
+import com.study.myapplication.databinding.ItemCompareCoinInfoBinding
+import com.study.myapplication.presentation.compare.model.CompareCoinInfo
+
+class CompareCoinAdapter : RecyclerView.Adapter() {
+
+ private val compareCoinList = arrayListOf()
+
+ override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
+ return CompareCoinViewHolder(
+ ItemCompareCoinInfoBinding.inflate(
+ LayoutInflater.from(parent.context),
+ parent,
+ false
+ )
+ )
+ }
+
+ override fun getItemCount(): Int = compareCoinList.size
+
+ override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
+ (holder as CompareCoinViewHolder).bind(compareCoinList[position])
+ }
+
+ inner class CompareCoinViewHolder(private val binding: ItemCompareCoinInfoBinding) :
+ RecyclerView.ViewHolder(binding.root) {
+ fun bind(compareCoinInfo: CompareCoinInfo) {
+ binding.run {
+ item = compareCoinInfo
+ }
+ }
+ }
+
+ fun setCoinList(list: List) {
+ compareCoinList.clear()
+ compareCoinList.addAll(list)
+ notifyDataSetChanged()
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/compare/CompareCoinViewModel.kt b/app/src/main/java/com/study/myapplication/presentation/compare/CompareCoinViewModel.kt
new file mode 100644
index 0000000..4b577d9
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/compare/CompareCoinViewModel.kt
@@ -0,0 +1,144 @@
+package com.study.myapplication.presentation.compare
+
+import android.util.Log
+import androidx.lifecycle.LiveData
+import androidx.lifecycle.MutableLiveData
+import androidx.lifecycle.viewModelScope
+import com.study.myapplication.domain.entity.Ticker
+import com.study.myapplication.domain.usecase.GetBithumbCoinUseCase
+import com.study.myapplication.domain.usecase.GetCoinOneCoinUseCase
+import com.study.myapplication.domain.usecase.GetUpbitCoinListUseCase
+import com.study.myapplication.domain.usecase.GetUpbitMarketUseCase
+import com.study.myapplication.presentation.base.BaseViewModel
+import com.study.myapplication.presentation.compare.model.CompareCoinInfo
+import com.study.myapplication.presentation.utils.StringUtil
+import com.study.myapplication.presentation.utils.event.Event
+import kotlinx.coroutines.async
+import kotlinx.coroutines.launch
+import kotlin.math.max
+import kotlin.math.min
+
+
+class CompareCoinViewModel(
+ private val getUpbitMarketUseCase: GetUpbitMarketUseCase,
+ private val getUpbitCoinListUseCase: GetUpbitCoinListUseCase,
+ private val getBithumbCoinUseCase: GetBithumbCoinUseCase,
+ private val getCoinOneCoinUseCase: GetCoinOneCoinUseCase
+) : BaseViewModel() {
+
+ private val upbitTickerList by lazy {
+ viewModelScope.async {
+ getUpbitCoinListUseCase(getUpbitMarketUseCase())
+ }
+ }
+
+ private val bithumbTickerList by lazy {
+ viewModelScope.async {
+ getBithumbCoinUseCase()
+ }
+ }
+
+ private val coinOneTickerList by lazy {
+ viewModelScope.async {
+ getCoinOneCoinUseCase()
+ }
+ }
+
+ private val _coinList = MutableLiveData
>()
+ val coinList: LiveData> get() = _coinList
+
+ init {
+ getCoinList()
+ }
+
+ private fun getCoinList() {
+ viewModelScope.launch {
+ val upbitTickerList = try {
+ upbitTickerList.await()
+ } catch (e: Exception) {
+ Log.d("CompareCoinViewModel", "${e.message}")
+ _isDataLoadingError.value = Event("업비트 데이터 로딩 에러 발생" to true)
+ _isDataLoading.value = false
+ mapOf()
+ }
+
+ val bithumbTickerList = try {
+ bithumbTickerList.await()
+ } catch (e: Exception) {
+ Log.d("CompareCoinViewModel", "${e.message}")
+ _isDataLoadingError.value = Event("빗썸 데이터 로딩 에러 발생" to true)
+ _isDataLoading.value = false
+ mapOf()
+ }
+
+ val coinOneTickerList = try {
+ coinOneTickerList.await()
+ } catch (e: Exception) {
+ Log.d("CompareCoinViewModel", "${e.message}")
+ _isDataLoadingError.value = Event("코인원 데이터 로딩 에러 발생" to true)
+ _isDataLoading.value = false
+ mapOf()
+ }
+
+ _coinList.value = getCompareCoinList(
+ upbitTickerList,
+ bithumbTickerList,
+ coinOneTickerList
+ )
+
+ _isDataLoading.value = false
+ }
+ }
+
+ private fun getCompareCoinList(
+ upbitTickerMap: Map,
+ bithumbTickerMap: Map,
+ coinOneTickerMap: Map
+ ): MutableList {
+ val compareCoinInfoList = mutableListOf()
+ bithumbTickerMap.forEach {
+ Log.d("bithumbTickerMap", "key : ${it.key}")
+ Log.d("coinOneTickerMap", "value : ${coinOneTickerMap[it.key]}")
+ Log.d("upbitTickerMap", "value : ${upbitTickerMap[it.key]}")
+ if (coinOneTickerMap[it.key] == null || upbitTickerMap[it.key] == null) {
+ return@forEach
+ }
+ val upbitPrice = upbitTickerMap[it.key]?.coinPrice ?: 0.0
+ val bithumbPrice = coinOneTickerMap[it.key]?.coinPrice ?: 0.0
+ val coinOnePrice = bithumbTickerMap[it.key]?.coinPrice ?: 0.0
+
+ val maxPrice = max(
+ upbitPrice,
+ max(bithumbPrice, coinOnePrice)
+ )
+ val minPrice = min(
+ upbitPrice,
+ min(bithumbPrice, coinOnePrice)
+ )
+ val compareCoinInfo = CompareCoinInfo(
+ coinName = it.key,
+ coinonePrice = StringUtil.getKrwCommaPrice(coinOnePrice),
+ upbitPrice = StringUtil.getKrwCommaPrice(upbitPrice),
+ bithumbPrice = StringUtil.getKrwCommaPrice(bithumbPrice),
+ recommendMarket = when (maxPrice) {
+ upbitPrice -> {
+ "UPBIT"
+ }
+ bithumbPrice -> {
+ "BITHUMB"
+ }
+ coinOnePrice -> {
+ "COINONE"
+ }
+ else -> {
+ "NOTHING"
+ }
+ },
+ differRatio = StringUtil.getPercent(maxPrice, minPrice)
+ )
+ compareCoinInfoList.add(compareCoinInfo)
+ }
+ return compareCoinInfoList
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/compare/model/CompareCoinInfo.kt b/app/src/main/java/com/study/myapplication/presentation/compare/model/CompareCoinInfo.kt
new file mode 100644
index 0000000..ab75226
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/compare/model/CompareCoinInfo.kt
@@ -0,0 +1,10 @@
+package com.study.myapplication.presentation.compare.model
+
+data class CompareCoinInfo(
+ var coinName: String = "",
+ var coinonePrice: String = "",
+ var upbitPrice: String = "",
+ var bithumbPrice: String = "",
+ var recommendMarket: String = "",
+ var differRatio: String = ""
+)
diff --git a/app/src/main/java/com/study/myapplication/presentation/di/AppModule.kt b/app/src/main/java/com/study/myapplication/presentation/di/AppModule.kt
new file mode 100644
index 0000000..78055aa
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/di/AppModule.kt
@@ -0,0 +1,16 @@
+package com.study.myapplication.presentation.di
+
+import com.study.myapplication.presentation.compare.CompareCoinViewModel
+import org.koin.androidx.viewmodel.dsl.viewModel
+import org.koin.dsl.module
+
+fun getAppModule() = module {
+ viewModel {
+ CompareCoinViewModel(
+ get(),
+ get(),
+ get(),
+ get()
+ )
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/ext/ImageViewExt.kt b/app/src/main/java/com/study/myapplication/presentation/ext/ImageViewExt.kt
new file mode 100644
index 0000000..fadcd5b
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/ext/ImageViewExt.kt
@@ -0,0 +1,15 @@
+package com.study.myapplication.presentation.ext
+
+import android.widget.ImageView
+import androidx.databinding.BindingAdapter
+import com.bumptech.glide.Glide
+
+
+@BindingAdapter("bind:imageUrl")
+fun ImageView.bindImageUrl(imageUrl: String?) {
+ imageUrl?.let {
+ Glide.with(this.context)
+ .load(it)
+ .into(this)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/ext/TextExt.kt b/app/src/main/java/com/study/myapplication/presentation/ext/TextExt.kt
new file mode 100644
index 0000000..632fc5a
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/ext/TextExt.kt
@@ -0,0 +1,19 @@
+package com.study.myapplication.presentation.ext
+
+import android.os.Build
+import android.text.Html
+import android.widget.ImageView
+import android.widget.TextView
+import androidx.databinding.BindingAdapter
+import com.bumptech.glide.Glide
+import com.bumptech.glide.request.RequestOptions
+
+
+@BindingAdapter("bind:html")
+fun TextView.html(title: String?) {
+ text = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ Html.fromHtml(title,Html.FROM_HTML_MODE_COMPACT)
+ } else{
+ Html.fromHtml(title)
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/utils/StringUtil.kt b/app/src/main/java/com/study/myapplication/presentation/utils/StringUtil.kt
new file mode 100644
index 0000000..8cbae48
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/utils/StringUtil.kt
@@ -0,0 +1,23 @@
+package com.study.myapplication.presentation.utils
+
+import kotlin.math.abs
+
+object StringUtil {
+
+ fun getKrwCommaPrice(price: Double): String {
+ return if (price > 1_000) {
+ "${String.format("%,d", (price / 1_000).toInt())}천"
+ } else if (price < 1) {
+ "${String.format("%,.2f", price)}"
+ } else {
+ "${String.format("%,d", price.toInt())}"
+
+ }
+ }
+
+ fun getPercent(firstCompanyPrice: Double, seconCompanyPrice: Double): String {
+ var percent = abs(seconCompanyPrice - firstCompanyPrice) / firstCompanyPrice
+ percent *= 100
+ return "-${String.format("%.2f", percent)}%"
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/utils/event/Event.kt b/app/src/main/java/com/study/myapplication/presentation/utils/event/Event.kt
new file mode 100644
index 0000000..59387a6
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/utils/event/Event.kt
@@ -0,0 +1,17 @@
+package com.study.myapplication.presentation.utils.event
+
+open class Event(private val content: T) {
+
+ private var hasBeenHandled = false
+ private set
+
+ fun getContentIfNotHandled(): T? {
+ return if (hasBeenHandled) {
+ null
+ } else {
+ hasBeenHandled = true
+ content
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/study/myapplication/presentation/utils/event/EventObserver.kt b/app/src/main/java/com/study/myapplication/presentation/utils/event/EventObserver.kt
new file mode 100644
index 0000000..a05a625
--- /dev/null
+++ b/app/src/main/java/com/study/myapplication/presentation/utils/event/EventObserver.kt
@@ -0,0 +1,11 @@
+package com.study.myapplication.presentation.utils.event
+
+import androidx.lifecycle.Observer
+
+class EventObserver(private val onEventUnhandledContent: (T) -> Unit) : Observer> {
+ override fun onChanged(event: Event?) {
+ event?.getContentIfNotHandled()?.let {
+ onEventUnhandledContent(it)
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..1f6bb29
--- /dev/null
+++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..0d025f9
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/layout/activity_compare_coin.xml b/app/src/main/res/layout/activity_compare_coin.xml
new file mode 100644
index 0000000..7b5b556
--- /dev/null
+++ b/app/src/main/res/layout/activity_compare_coin.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/item_compare_coin_info.xml b/app/src/main/res/layout/item_compare_coin_info.xml
new file mode 100644
index 0000000..f6d0ca9
--- /dev/null
+++ b/app/src/main/res/layout/item_compare_coin_info.xml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..eca70cf
--- /dev/null
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..898f3ed
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..dffca36
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..64ba76f
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..dae5e08
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..e5ed465
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..14ed0af
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..b0907ca
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..d8ae031
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..2c18de9
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..beed3cd
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..3e7d2bf
--- /dev/null
+++ b/app/src/main/res/values/colors.xml
@@ -0,0 +1,13 @@
+
+
+ #F2D6AE
+ #34558b
+ #F5B895
+ #eeeeee
+ #000000
+ #ffffff
+ #ff0000
+ #00ff00
+ #0000ff
+ #666666
+
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..b42672b
--- /dev/null
+++ b/app/src/main/res/values/dimens.xml
@@ -0,0 +1,8 @@
+
+
+ 4dp
+ 8dp
+ 12dp
+ 16dp
+ 20dp
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..5186be2
--- /dev/null
+++ b/app/src/main/res/values/strings.xml
@@ -0,0 +1,9 @@
+
+ 코인추천
+ 코인이름
+ Coinone\n가격(원)
+ Upbit\n가격(원)
+ Bithumb\n가격(원)
+ 추천\n거래소
+ 가격차이
+
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..3f5e15c
--- /dev/null
+++ b/app/src/main/res/values/styles.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/test/java/com/study/myapplication/ExampleUnitTest.kt b/app/src/test/java/com/study/myapplication/ExampleUnitTest.kt
new file mode 100644
index 0000000..aac1d68
--- /dev/null
+++ b/app/src/test/java/com/study/myapplication/ExampleUnitTest.kt
@@ -0,0 +1,17 @@
+package com.study.myapplication
+
+import org.junit.Test
+
+import org.junit.Assert.*
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * See [testing documentation](http://d.android.com/tools/testing).
+ */
+class ExampleUnitTest {
+ @Test
+ fun addition_isCorrect() {
+ assertEquals(4, 2 + 2)
+ }
+}
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..f47abbe
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+ ext.kotlin_version = '1.3.60'
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.5.2'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..23339e0
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,21 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Automatically convert third-party libraries to use AndroidX
+android.enableJetifier=true
+# Kotlin code style for this project: "official" or "obsolete":
+kotlin.code.style=official
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..adb6fd2
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue Dec 17 00:26:03 JST 2019
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..cccdd3d
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..e95643d
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..e9b2b1e
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,2 @@
+include ':app'
+rootProject.name='My Application'