diff --git a/Coroutine/.gitignore b/Coroutine/.gitignore
deleted file mode 100644
index bccbf0f..0000000
--- a/Coroutine/.gitignore
+++ /dev/null
@@ -1,224 +0,0 @@
-
-# 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
diff --git a/Coroutine/.idea/codeStyles/Project.xml b/Coroutine/.idea/codeStyles/Project.xml
deleted file mode 100644
index 681f41a..0000000
--- a/Coroutine/.idea/codeStyles/Project.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 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/Coroutine/.idea/gradle.xml b/Coroutine/.idea/gradle.xml
deleted file mode 100644
index 169fd0d..0000000
--- a/Coroutine/.idea/gradle.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Coroutine/.idea/misc.xml b/Coroutine/.idea/misc.xml
deleted file mode 100644
index 37a7509..0000000
--- a/Coroutine/.idea/misc.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Coroutine/.idea/runConfigurations.xml b/Coroutine/.idea/runConfigurations.xml
deleted file mode 100644
index 7f68460..0000000
--- a/Coroutine/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Coroutine/.idea/vcs.xml b/Coroutine/.idea/vcs.xml
deleted file mode 100644
index 6c0b863..0000000
--- a/Coroutine/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Coroutine/app/.gitignore b/Coroutine/app/.gitignore
deleted file mode 100644
index 796b96d..0000000
--- a/Coroutine/app/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/Coroutine/app/build.gradle b/Coroutine/app/build.gradle
deleted file mode 100644
index 5c08ea7..0000000
--- a/Coroutine/app/build.gradle
+++ /dev/null
@@ -1,37 +0,0 @@
-apply plugin: 'com.android.application'
-
-apply plugin: 'kotlin-android'
-
-apply plugin: 'kotlin-android-extensions'
-
-apply plugin: 'kotlin-kapt'
-
-android {
- compileSdkVersion 28
- buildToolsVersion "29.0.2"
- defaultConfig {
- applicationId "com.example.coroutineproject"
- minSdkVersion 23
- targetSdkVersion 28
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- }
- 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.0.2'
- implementation 'androidx.core:core-ktx:1.0.2'
- implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
- testImplementation 'junit:junit:4.12'
- androidTestImplementation 'androidx.test.ext:junit:1.1.0'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
-}
diff --git a/Coroutine/app/proguard-rules.pro b/Coroutine/app/proguard-rules.pro
deleted file mode 100644
index f1b4245..0000000
--- a/Coroutine/app/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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/Coroutine/app/src/androidTest/java/com/example/coroutineproject/ExampleInstrumentedTest.kt b/Coroutine/app/src/androidTest/java/com/example/coroutineproject/ExampleInstrumentedTest.kt
deleted file mode 100644
index e25c93d..0000000
--- a/Coroutine/app/src/androidTest/java/com/example/coroutineproject/ExampleInstrumentedTest.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.example.coroutineproject
-
-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.coroutineproject", appContext.packageName)
- }
-}
diff --git a/Coroutine/app/src/main/AndroidManifest.xml b/Coroutine/app/src/main/AndroidManifest.xml
deleted file mode 100644
index 49e55aa..0000000
--- a/Coroutine/app/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Coroutine/app/src/main/java/com/example/coroutineproject/MainActivity.kt b/Coroutine/app/src/main/java/com/example/coroutineproject/MainActivity.kt
deleted file mode 100644
index 4eb8801..0000000
--- a/Coroutine/app/src/main/java/com/example/coroutineproject/MainActivity.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.example.coroutineproject
-
-import androidx.appcompat.app.AppCompatActivity
-import android.os.Bundle
-
-class MainActivity : AppCompatActivity() {
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_main)
- }
-}
diff --git a/Coroutine/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Coroutine/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
deleted file mode 100644
index 1f6bb29..0000000
--- a/Coroutine/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Coroutine/app/src/main/res/drawable/ic_launcher_background.xml b/Coroutine/app/src/main/res/drawable/ic_launcher_background.xml
deleted file mode 100644
index 0d025f9..0000000
--- a/Coroutine/app/src/main/res/drawable/ic_launcher_background.xml
+++ /dev/null
@@ -1,170 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Coroutine/app/src/main/res/layout/activity_main.xml b/Coroutine/app/src/main/res/layout/activity_main.xml
deleted file mode 100644
index 4fc2444..0000000
--- a/Coroutine/app/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Coroutine/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Coroutine/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
deleted file mode 100644
index eca70cf..0000000
--- a/Coroutine/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Coroutine/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Coroutine/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
deleted file mode 100644
index eca70cf..0000000
--- a/Coroutine/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Coroutine/app/src/main/res/mipmap-hdpi/ic_launcher.png b/Coroutine/app/src/main/res/mipmap-hdpi/ic_launcher.png
deleted file mode 100644
index 898f3ed..0000000
Binary files a/Coroutine/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ
diff --git a/Coroutine/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/Coroutine/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
deleted file mode 100644
index dffca36..0000000
Binary files a/Coroutine/app/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ
diff --git a/Coroutine/app/src/main/res/mipmap-mdpi/ic_launcher.png b/Coroutine/app/src/main/res/mipmap-mdpi/ic_launcher.png
deleted file mode 100644
index 64ba76f..0000000
Binary files a/Coroutine/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ
diff --git a/Coroutine/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/Coroutine/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
deleted file mode 100644
index dae5e08..0000000
Binary files a/Coroutine/app/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ
diff --git a/Coroutine/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/Coroutine/app/src/main/res/mipmap-xhdpi/ic_launcher.png
deleted file mode 100644
index e5ed465..0000000
Binary files a/Coroutine/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ
diff --git a/Coroutine/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/Coroutine/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
deleted file mode 100644
index 14ed0af..0000000
Binary files a/Coroutine/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/Coroutine/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Coroutine/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
deleted file mode 100644
index b0907ca..0000000
Binary files a/Coroutine/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ
diff --git a/Coroutine/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/Coroutine/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
deleted file mode 100644
index d8ae031..0000000
Binary files a/Coroutine/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/Coroutine/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Coroutine/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
deleted file mode 100644
index 2c18de9..0000000
Binary files a/Coroutine/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ
diff --git a/Coroutine/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/Coroutine/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
deleted file mode 100644
index beed3cd..0000000
Binary files a/Coroutine/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ
diff --git a/Coroutine/app/src/main/res/values/colors.xml b/Coroutine/app/src/main/res/values/colors.xml
deleted file mode 100644
index 69b2233..0000000
--- a/Coroutine/app/src/main/res/values/colors.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- #008577
- #00574B
- #D81B60
-
diff --git a/Coroutine/app/src/main/res/values/strings.xml b/Coroutine/app/src/main/res/values/strings.xml
deleted file mode 100644
index 7e5936e..0000000
--- a/Coroutine/app/src/main/res/values/strings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- CoroutineProject
-
diff --git a/Coroutine/app/src/main/res/values/styles.xml b/Coroutine/app/src/main/res/values/styles.xml
deleted file mode 100644
index 5885930..0000000
--- a/Coroutine/app/src/main/res/values/styles.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
diff --git a/Coroutine/app/src/test/java/com/example/coroutineproject/ExampleUnitTest.kt b/Coroutine/app/src/test/java/com/example/coroutineproject/ExampleUnitTest.kt
deleted file mode 100644
index 1a9e4f7..0000000
--- a/Coroutine/app/src/test/java/com/example/coroutineproject/ExampleUnitTest.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.example.coroutineproject
-
-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/Coroutine/build.gradle b/Coroutine/build.gradle
deleted file mode 100644
index 819d034..0000000
--- a/Coroutine/build.gradle
+++ /dev/null
@@ -1,28 +0,0 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-
-buildscript {
- ext.kotlin_version = '1.3.61'
- repositories {
- google()
- jcenter()
-
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:3.5.3'
- 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/Coroutine/gradle.properties b/Coroutine/gradle.properties
deleted file mode 100644
index 23339e0..0000000
--- a/Coroutine/gradle.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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/Coroutine/gradle/wrapper/gradle-wrapper.jar b/Coroutine/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index f6b961f..0000000
Binary files a/Coroutine/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/Coroutine/gradle/wrapper/gradle-wrapper.properties b/Coroutine/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 0f362d1..0000000
--- a/Coroutine/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#Wed Jan 22 06:12:00 KST 2020
-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/Coroutine/gradlew b/Coroutine/gradlew
deleted file mode 100644
index cccdd3d..0000000
--- a/Coroutine/gradlew
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/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/Coroutine/gradlew.bat b/Coroutine/gradlew.bat
deleted file mode 100644
index f955316..0000000
--- a/Coroutine/gradlew.bat
+++ /dev/null
@@ -1,84 +0,0 @@
-@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/Coroutine/settings.gradle b/Coroutine/settings.gradle
deleted file mode 100644
index e9f9b33..0000000
--- a/Coroutine/settings.gradle
+++ /dev/null
@@ -1,2 +0,0 @@
-include ':app'
-rootProject.name='CoroutineProject'
diff --git a/ToyProject/.idea/codeStyles/Project.xml b/ToyProject/.idea/codeStyles/Project.xml
index 681f41a..88ea3aa 100644
--- a/ToyProject/.idea/codeStyles/Project.xml
+++ b/ToyProject/.idea/codeStyles/Project.xml
@@ -1,5 +1,8 @@
+
+
+
@@ -112,5 +115,8 @@
+
+
+
\ No newline at end of file
diff --git a/ToyProject/.idea/gradle.xml b/ToyProject/.idea/gradle.xml
index 169fd0d..674414f 100644
--- a/ToyProject/.idea/gradle.xml
+++ b/ToyProject/.idea/gradle.xml
@@ -1,8 +1,11 @@
+
+
+
@@ -12,7 +15,6 @@
-
diff --git a/ToyProject/app/build.gradle b/ToyProject/app/build.gradle
index df77026..af4a64e 100644
--- a/ToyProject/app/build.gradle
+++ b/ToyProject/app/build.gradle
@@ -16,6 +16,8 @@ android {
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+
+ buildConfigField "String", "APP_KEY" , "\"e29f73abf94a892a99c8df777d038279\""
}
buildTypes {
release {
@@ -23,15 +25,36 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
+ dataBinding {
+ enabled = true
+ }
+ kotlinOptions {
+ jvmTarget = JavaVersion.VERSION_1_8.toString()
+ }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
- implementation 'androidx.appcompat:appcompat:1.0.2'
- implementation 'androidx.core:core-ktx:1.0.2'
+ implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation 'androidx.core:core-ktx:1.2.0'
+ implementation 'androidx.activity:activity-ktx:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
- androidTestImplementation 'androidx.test.ext:junit:1.1.0'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+ implementation 'com.google.code.gson:gson:2.8.5'
+ implementation 'com.squareup.retrofit2:retrofit:2.6.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
+ implementation 'com.github.bumptech.glide:glide:4.10.0'
+ annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
+
+ implementation 'com.squareup.okhttp3:okhttp:3.12.0'
+ implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
+
+ implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
+ implementation 'androidx.recyclerview:recyclerview:1.1.0'
+
+ implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.4'
}
diff --git a/ToyProject/app/src/main/AndroidManifest.xml b/ToyProject/app/src/main/AndroidManifest.xml
index 24d6ddc..f1c3830 100644
--- a/ToyProject/app/src/main/AndroidManifest.xml
+++ b/ToyProject/app/src/main/AndroidManifest.xml
@@ -1,6 +1,7 @@
+
-
+
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/MainActivity.kt b/ToyProject/app/src/main/java/com/example/toyproject/MainActivity.kt
deleted file mode 100644
index 53a9108..0000000
--- a/ToyProject/app/src/main/java/com/example/toyproject/MainActivity.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.example.toyproject
-
-import androidx.appcompat.app.AppCompatActivity
-import android.os.Bundle
-
-class MainActivity : AppCompatActivity() {
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_main)
- }
-}
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/adapter/DataBindingAdapter.kt b/ToyProject/app/src/main/java/com/example/toyproject/adapter/DataBindingAdapter.kt
new file mode 100644
index 0000000..362150d
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/adapter/DataBindingAdapter.kt
@@ -0,0 +1,33 @@
+package com.example.toyproject.adapter
+
+import android.view.View
+import android.widget.ImageView
+import android.widget.ProgressBar
+import androidx.databinding.BindingAdapter
+import androidx.recyclerview.widget.RecyclerView
+import com.bumptech.glide.Glide
+import com.example.toyproject.data.entity.SearchMovieData
+import com.example.toyproject.ui.main.MainMoviePostingRecyclerAdapter
+
+@BindingAdapter("bind:replace")
+fun RecyclerView.replaceAll(item: List?) {
+ if (!item.isNullOrEmpty()) {
+ (adapter as? MainMoviePostingRecyclerAdapter)?.setItemList(item as ArrayList)
+ }
+}
+
+@BindingAdapter("bind:bindImage")
+fun ImageView.bindImage(imageUri: String) {
+ if (imageUri.isNotEmpty()) {
+ Glide.with(this.context).load(imageUri).into(this)
+ }
+}
+
+@BindingAdapter("bind:bindLoading")
+fun ProgressBar.bindLoading(isLoading : Boolean) {
+ if(isLoading) {
+ this.visibility = View.VISIBLE
+ } else {
+ this.visibility = View.GONE
+ }
+}
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/data/entity/MovieResponse.kt b/ToyProject/app/src/main/java/com/example/toyproject/data/entity/MovieResponse.kt
new file mode 100644
index 0000000..55ae6b4
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/data/entity/MovieResponse.kt
@@ -0,0 +1,22 @@
+package com.example.toyproject.data.entity
+
+import com.example.toyproject.network.NetworkConstant
+import com.google.gson.annotations.SerializedName
+
+data class SearchMovieResponse(
+ @SerializedName("results")
+ val searchMovieResults: List
+)
+
+data class SearchMovieData(
+ @SerializedName("id")
+ val movieId: String,
+ @SerializedName("poster_path")
+ val posterPath: String
+) {
+ fun getPosterUrl(): String = "${NetworkConstant.IMAGE_PATH}$posterPath"
+
+ fun onClickItem() {
+ // TODO: 2020-03-23
+ }
+}
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/data/remote/MovieRemoteDataSource.kt b/ToyProject/app/src/main/java/com/example/toyproject/data/remote/MovieRemoteDataSource.kt
new file mode 100644
index 0000000..5e47c1f
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/data/remote/MovieRemoteDataSource.kt
@@ -0,0 +1,11 @@
+package com.example.toyproject.data.remote
+
+import com.example.toyproject.data.entity.SearchMovieResponse
+
+interface MovieRemoteDataSource {
+ fun getMovieData(
+ query: String,
+ success: (SearchMovieResponse) -> Unit,
+ fail: (Throwable) -> Unit
+ )
+}
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/data/remote/MovieRemoteDataSourceImpl.kt b/ToyProject/app/src/main/java/com/example/toyproject/data/remote/MovieRemoteDataSourceImpl.kt
new file mode 100644
index 0000000..f9d3000
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/data/remote/MovieRemoteDataSourceImpl.kt
@@ -0,0 +1,33 @@
+package com.example.toyproject.data.remote
+
+import com.example.toyproject.BuildConfig
+import com.example.toyproject.data.entity.SearchMovieResponse
+import com.example.toyproject.network.retrofitService
+import retrofit2.Call
+import retrofit2.Callback
+import retrofit2.Response
+
+class MovieRemoteDataSourceImpl() : MovieRemoteDataSource {
+ override fun getMovieData(
+ query: String,
+ success: (SearchMovieResponse) -> Unit,
+ fail: (Throwable) -> Unit
+ ) {
+ retrofitService()
+ .requestSearchMovie(BuildConfig.APP_KEY, "space", 1)
+ .enqueue(object : Callback {
+ override fun onResponse(
+ call: Call,
+ response: Response
+ ) {
+ response.body()?.let { success(it) }
+ }
+
+ override fun onFailure(call: Call, t: Throwable) {
+ fail(t)
+ }
+
+ })
+ }
+
+}
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/data/repository/MovieRepository.kt b/ToyProject/app/src/main/java/com/example/toyproject/data/repository/MovieRepository.kt
new file mode 100644
index 0000000..b08baf8
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/data/repository/MovieRepository.kt
@@ -0,0 +1,11 @@
+package com.example.toyproject.data.repository
+
+import com.example.toyproject.data.entity.SearchMovieResponse
+
+interface MovieRepository {
+ fun getMovieData (
+ query: String,
+ success: (SearchMovieResponse) -> Unit,
+ fail: (Throwable) -> Unit
+ )
+}
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/data/repository/MovieRepositoryImpl.kt b/ToyProject/app/src/main/java/com/example/toyproject/data/repository/MovieRepositoryImpl.kt
new file mode 100644
index 0000000..432cdc6
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/data/repository/MovieRepositoryImpl.kt
@@ -0,0 +1,16 @@
+package com.example.toyproject.data.repository
+
+import com.example.toyproject.data.entity.SearchMovieResponse
+import com.example.toyproject.data.remote.MovieRemoteDataSource
+import com.example.toyproject.data.remote.MovieRemoteDataSourceImpl
+
+object MovieRepositoryImpl : MovieRepository {
+ val movieRemoteDataSource: MovieRemoteDataSource = MovieRemoteDataSourceImpl()
+ override fun getMovieData(
+ query: String,
+ success: (SearchMovieResponse) -> Unit,
+ fail: (Throwable) -> Unit
+ ) = movieRemoteDataSource.getMovieData(query, success, fail)
+
+
+}
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/network/NetworkConstant.kt b/ToyProject/app/src/main/java/com/example/toyproject/network/NetworkConstant.kt
new file mode 100644
index 0000000..11d0346
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/network/NetworkConstant.kt
@@ -0,0 +1,5 @@
+package com.example.toyproject.network
+
+object NetworkConstant {
+ const val IMAGE_PATH = "https://image.tmdb.org/t/p/w200/"
+}
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/network/NetworkInterceptor.kt b/ToyProject/app/src/main/java/com/example/toyproject/network/NetworkInterceptor.kt
new file mode 100644
index 0000000..e6021f7
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/network/NetworkInterceptor.kt
@@ -0,0 +1,5 @@
+package com.example.toyproject.network
+
+import okhttp3.logging.HttpLoggingInterceptor
+
+fun createLogInterceptor() = HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/network/RetrofitHelper.kt b/ToyProject/app/src/main/java/com/example/toyproject/network/RetrofitHelper.kt
new file mode 100644
index 0000000..043aa07
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/network/RetrofitHelper.kt
@@ -0,0 +1,22 @@
+package com.example.toyproject.network
+
+import okhttp3.OkHttpClient
+import retrofit2.Retrofit
+import retrofit2.converter.gson.GsonConverterFactory
+
+object BaseOkHttpClient {
+ val okHttpClient = OkHttpClient.Builder()
+ .addInterceptor(createLogInterceptor())
+ .build()
+}
+
+object BuildRetrofit {
+ private val URL = "https://api.themoviedb.org/3/"
+ val retrofit: Retrofit = Retrofit.Builder()
+ .baseUrl(URL)
+ .addConverterFactory(GsonConverterFactory.create())
+ .client(BaseOkHttpClient.okHttpClient)
+ .build()
+}
+
+fun retrofitService() = BuildRetrofit.retrofit.create(RetrofitService::class.java)
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/network/RetrofitService.kt b/ToyProject/app/src/main/java/com/example/toyproject/network/RetrofitService.kt
new file mode 100644
index 0000000..6f1ddef
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/network/RetrofitService.kt
@@ -0,0 +1,16 @@
+package com.example.toyproject.network
+
+import com.example.toyproject.data.entity.SearchMovieResponse
+import retrofit2.Call
+import retrofit2.http.GET
+import retrofit2.http.Query
+
+interface RetrofitService {
+
+ @GET("search/movie")
+ fun requestSearchMovie(
+ @Query("api_key") apiKey: String,
+ @Query("query") query: String,
+ @Query("page") page: Int
+ ): Call
+}
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/ui/main/MainActivity.kt b/ToyProject/app/src/main/java/com/example/toyproject/ui/main/MainActivity.kt
new file mode 100644
index 0000000..12ba86e
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/ui/main/MainActivity.kt
@@ -0,0 +1,42 @@
+package com.example.toyproject.ui.main
+
+import android.os.Bundle
+import androidx.activity.viewModels
+import androidx.appcompat.app.AppCompatActivity
+import androidx.databinding.DataBindingUtil
+import androidx.recyclerview.widget.GridLayoutManager
+import com.example.toyproject.R
+import com.example.toyproject.databinding.ActivityMainBinding
+
+class MainActivity : AppCompatActivity() {
+ private lateinit var binding: ActivityMainBinding
+ private val adapter: MainMoviePostingRecyclerAdapter = MainMoviePostingRecyclerAdapter()
+ private val mainViewModel: MainViewModel by viewModels()
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ binding = DataBindingUtil.setContentView(
+ this, R.layout.activity_main
+ )
+
+ initailize()
+ initBinding()
+ loadingMovies()
+ }
+
+ private fun initailize() {
+ binding.rcvPoster.layoutManager = GridLayoutManager(this@MainActivity, 3)
+ }
+
+ private fun initBinding() {
+ binding.apply {
+ binding.vm = mainViewModel
+ binding.lifecycleOwner = this@MainActivity
+ binding.rcvPoster.adapter = adapter
+ }
+ }
+
+ private fun loadingMovies() {
+ mainViewModel.searchMovie()
+ }
+}
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/ui/main/MainMoviePostingRecyclerAdapter.kt b/ToyProject/app/src/main/java/com/example/toyproject/ui/main/MainMoviePostingRecyclerAdapter.kt
new file mode 100644
index 0000000..a26c022
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/ui/main/MainMoviePostingRecyclerAdapter.kt
@@ -0,0 +1,52 @@
+package com.example.toyproject.ui.main
+
+import android.view.LayoutInflater
+import android.view.ViewGroup
+import androidx.databinding.DataBindingUtil
+import androidx.recyclerview.widget.RecyclerView
+import com.example.toyproject.R
+import com.example.toyproject.data.entity.SearchMovieData
+import com.example.toyproject.databinding.ItemMainBinding
+
+class MainMoviePostingRecyclerAdapter :
+ RecyclerView.Adapter() {
+ private val movies: ArrayList = ArrayList()
+
+ fun setItemList(movies: ArrayList) {
+ this.movies.clear()
+ this.movies.addAll(movies)
+ notifyDataSetChanged()
+ }
+
+ override fun onCreateViewHolder(
+ parent: ViewGroup,
+ viewType: Int
+ ): ViewHolder {
+ val binding = DataBindingUtil.inflate(
+ LayoutInflater.from(parent.context),
+ R.layout.item_main,
+ parent,
+ false
+ )
+ return ViewHolder(binding)
+ }
+
+ override fun getItemCount() = movies.size
+
+
+ override fun onBindViewHolder(
+ holder: ViewHolder,
+ position: Int
+ ) {
+ val item = movies[position]
+ holder.bind(item)
+ }
+
+
+ inner class ViewHolder(private val binding: ItemMainBinding) :
+ RecyclerView.ViewHolder(binding.root) {
+ fun bind(movieData: SearchMovieData) {
+ binding.movieData = movieData
+ }
+ }
+}
\ No newline at end of file
diff --git a/ToyProject/app/src/main/java/com/example/toyproject/ui/main/MainViewModel.kt b/ToyProject/app/src/main/java/com/example/toyproject/ui/main/MainViewModel.kt
new file mode 100644
index 0000000..74540e9
--- /dev/null
+++ b/ToyProject/app/src/main/java/com/example/toyproject/ui/main/MainViewModel.kt
@@ -0,0 +1,37 @@
+package com.example.toyproject.ui.main
+
+import android.util.Log
+import androidx.lifecycle.MutableLiveData
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewModelScope
+import com.example.toyproject.data.entity.SearchMovieData
+import com.example.toyproject.data.repository.MovieRepositoryImpl
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.runBlocking
+
+class MainViewModel() : ViewModel() {
+ private val TAG = this.javaClass.name
+ val movieData = MutableLiveData>()
+ val query = MutableLiveData()
+ val isLoading = MutableLiveData()
+
+ fun searchMovie() {
+ showLoading()
+ viewModelScope.launch {
+ MovieRepositoryImpl.getMovieData(query.value!!, success = {
+ movieData.value = it.searchMovieResults
+ }, fail = {
+ Log.e(TAG, it.message)
+ })
+ }
+ hideLoading()
+ }
+
+ private fun showLoading() {
+ isLoading.value = true
+ }
+
+ private fun hideLoading() {
+ isLoading.value = false
+ }
+}
\ No newline at end of file
diff --git a/ToyProject/app/src/main/res/layout/activity_main.xml b/ToyProject/app/src/main/res/layout/activity_main.xml
index 4fc2444..d8694d4 100644
--- a/ToyProject/app/src/main/res/layout/activity_main.xml
+++ b/ToyProject/app/src/main/res/layout/activity_main.xml
@@ -1,18 +1,41 @@
-
+ xmlns:bind="http://schemas.android.com/tools"
+ xmlns:tools="http://schemas.android.com/tools">
-
+
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ToyProject/app/src/main/res/layout/item_main.xml b/ToyProject/app/src/main/res/layout/item_main.xml
new file mode 100644
index 0000000..a3a7563
--- /dev/null
+++ b/ToyProject/app/src/main/res/layout/item_main.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ToyProject/app/src/main/res/values/strings.xml b/ToyProject/app/src/main/res/values/strings.xml
index 5842ad4..02f6ab9 100644
--- a/ToyProject/app/src/main/res/values/strings.xml
+++ b/ToyProject/app/src/main/res/values/strings.xml
@@ -1,3 +1,4 @@
ToyProject
+ commons_image