├── app_java ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── reload.png │ │ │ │ ├── sample_00.png │ │ │ │ ├── sample_01.png │ │ │ │ ├── sample_02.png │ │ │ │ ├── sample_03.png │ │ │ │ ├── sample_04.png │ │ │ │ ├── sample_05.png │ │ │ │ ├── sample_06.png │ │ │ │ ├── sample_07.png │ │ │ │ ├── sample_08.png │ │ │ │ ├── sample_09.png │ │ │ │ ├── sample_10.png │ │ │ │ ├── sample_11.png │ │ │ │ ├── sample_12.png │ │ │ │ ├── sample_13.png │ │ │ │ └── sample_14.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── themes.xml │ │ │ ├── layout │ │ │ │ ├── item_image.xml │ │ │ │ ├── content_main.xml │ │ │ │ └── activity_main.xml │ │ │ └── menu │ │ │ │ └── menu_main.xml │ │ ├── java │ │ │ └── tech │ │ │ │ └── thdev │ │ │ │ └── android_mvp_sample │ │ │ │ ├── listener │ │ │ │ └── OnItemClickListener.java │ │ │ │ ├── data │ │ │ │ ├── ImageItem.java │ │ │ │ └── source │ │ │ │ │ └── image │ │ │ │ │ ├── SampleImageSource.java │ │ │ │ │ ├── SampleImageLocalDataSource.java │ │ │ │ │ └── SampleImageRepository.java │ │ │ │ ├── adapter │ │ │ │ ├── contract │ │ │ │ │ └── ImageAdapterContract.java │ │ │ │ ├── holder │ │ │ │ │ └── ImageViewHolder.java │ │ │ │ └── ImageAdapter.java │ │ │ │ ├── view │ │ │ │ └── main │ │ │ │ │ ├── presenter │ │ │ │ │ ├── MainContract.java │ │ │ │ │ └── MainPresenter.java │ │ │ │ │ └── MainActivity.java │ │ │ │ └── util │ │ │ │ └── ImageAsync.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── tech │ │ │ └── thdev │ │ │ └── android_mvp_sample │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── tech │ │ └── thdev │ │ └── android_mvp_sample │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── app_kotlin ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── reload.png │ │ │ │ ├── sample_00.png │ │ │ │ ├── sample_01.png │ │ │ │ ├── sample_02.png │ │ │ │ ├── sample_03.png │ │ │ │ ├── sample_04.png │ │ │ │ ├── sample_05.png │ │ │ │ ├── sample_06.png │ │ │ │ ├── sample_07.png │ │ │ │ ├── sample_08.png │ │ │ │ ├── sample_09.png │ │ │ │ ├── sample_10.png │ │ │ │ ├── sample_11.png │ │ │ │ ├── sample_12.png │ │ │ │ ├── sample_13.png │ │ │ │ └── sample_14.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── themes.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ └── layout │ │ │ │ ├── item_image.xml │ │ │ │ ├── content_main.xml │ │ │ │ └── activity_main.xml │ │ ├── java │ │ │ └── tech │ │ │ │ └── thdev │ │ │ │ └── app_kotlin │ │ │ │ ├── data │ │ │ │ ├── ImageItem.kt │ │ │ │ └── source │ │ │ │ │ └── image │ │ │ │ │ ├── SampleImageSource.kt │ │ │ │ │ ├── SampleImageRepository.kt │ │ │ │ │ └── SampleImageLocalDataSource.kt │ │ │ │ ├── view │ │ │ │ └── main │ │ │ │ │ ├── presenter │ │ │ │ │ ├── MainContract.kt │ │ │ │ │ └── MainPresenter.kt │ │ │ │ │ └── MainActivity.kt │ │ │ │ ├── adapter │ │ │ │ ├── contract │ │ │ │ │ └── ImageAdapterContract.kt │ │ │ │ ├── ImageViewHolder.kt │ │ │ │ └── ImageAdapter.kt │ │ │ │ └── util │ │ │ │ └── ImageAsync.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── tech │ │ │ └── thdev │ │ │ └── app_kotlin │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── tech │ │ └── thdev │ │ └── app_kotlin │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── images └── device-2016-10-23-174436.png ├── .gitignore ├── gradle.properties ├── README.md ├── gradlew.bat └── gradlew /app_java/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app_kotlin/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app_java', ':app_kotlin' 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /images/device-2016-10-23-174436.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/images/device-2016-10-23-174436.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/reload.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_00.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_01.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_02.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_03.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_04.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_05.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_06.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_07.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_08.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_09.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_10.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_11.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_12.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_13.png -------------------------------------------------------------------------------- /app_java/src/main/res/drawable/sample_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/drawable/sample_14.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/reload.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_00.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_01.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_02.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_03.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_04.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_05.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_06.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_07.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_08.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_09.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_10.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_11.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_12.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_13.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/drawable/sample_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/drawable/sample_14.png -------------------------------------------------------------------------------- /app_java/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app_java/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app_java/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app_java/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app_java/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_java/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app_kotlin/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/taehwandev/AndroidMVPSample/HEAD/app_kotlin/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app_kotlin/src/main/java/tech/thdev/app_kotlin/data/ImageItem.kt: -------------------------------------------------------------------------------- 1 | package tech.thdev.app_kotlin.data 2 | 3 | /** 4 | * Created by tae-hwan on 10/23/16. 5 | */ 6 | data class ImageItem(val resource:Int, val title: String) -------------------------------------------------------------------------------- /app_java/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AndroidMVPSample-Java 3 | Settings 4 | Reload 5 | 6 | -------------------------------------------------------------------------------- /app_kotlin/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AndroidMVPSample-Kotlin 3 | Settings 4 | Reload 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu May 07 23:18:01 KST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip -------------------------------------------------------------------------------- /app_java/src/main/java/tech/thdev/android_mvp_sample/listener/OnItemClickListener.java: -------------------------------------------------------------------------------- 1 | package tech.thdev.android_mvp_sample.listener; 2 | 3 | /** 4 | * Created by tae-hwan on 12/26/16. 5 | */ 6 | public interface OnItemClickListener { 7 | 8 | void onItemClick(int position); 9 | } 10 | -------------------------------------------------------------------------------- /app_java/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #BB86FC 4 | #6200EE 5 | #3700B3 6 | #03DAC5 7 | -------------------------------------------------------------------------------- /app_kotlin/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #BB86FC 4 | #6200EE 5 | #3700B3 6 | #03DAC5 7 | -------------------------------------------------------------------------------- /app_java/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /app_kotlin/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /app_kotlin/src/main/java/tech/thdev/app_kotlin/view/main/presenter/MainContract.kt: -------------------------------------------------------------------------------- 1 | package tech.thdev.app_kotlin.view.main.presenter 2 | 3 | import android.content.Context 4 | 5 | /** 6 | * Created by tae-hwan on 12/23/16. 7 | */ 8 | interface MainContract { 9 | 10 | interface View { 11 | 12 | fun showToast(title: String) 13 | } 14 | 15 | interface Presenter { 16 | 17 | fun loadItems(context: Context, isClear: Boolean) 18 | } 19 | } -------------------------------------------------------------------------------- /app_java/src/main/res/layout/item_image.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /app_kotlin/src/test/java/tech/thdev/app_kotlin/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package tech.thdev.app_kotlin; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app_java/src/test/java/tech/thdev/android_mvp_sample/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package tech.thdev.android_mvp_sample; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app_java/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /app_kotlin/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /app_kotlin/src/main/java/tech/thdev/app_kotlin/data/source/image/SampleImageSource.kt: -------------------------------------------------------------------------------- 1 | package tech.thdev.app_kotlin.data.source.image 2 | 3 | import android.content.Context 4 | import tech.thdev.app_kotlin.data.ImageItem 5 | import java.util.* 6 | 7 | /** 8 | * Created by tae-hwan on 1/30/17. 9 | */ 10 | 11 | interface SampleImageSource { 12 | 13 | interface LoadImageCallback { 14 | 15 | fun onLoadImages(list: ArrayList) 16 | } 17 | 18 | fun getImages(context: Context, size: Int, loadImageCallback: LoadImageCallback?) 19 | } -------------------------------------------------------------------------------- /app_java/src/main/java/tech/thdev/android_mvp_sample/data/ImageItem.java: -------------------------------------------------------------------------------- 1 | package tech.thdev.android_mvp_sample.data; 2 | 3 | /** 4 | * Created by tae-hwan on 10/23/16. 5 | */ 6 | public class ImageItem { 7 | 8 | private int imageRes; 9 | private String title; 10 | 11 | public ImageItem(int imageRes, String title) { 12 | this.imageRes = imageRes; 13 | this.title = title; 14 | } 15 | 16 | public int getImageRes() { 17 | return imageRes; 18 | } 19 | 20 | public String getTitle() { 21 | return title; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app_java/src/main/java/tech/thdev/android_mvp_sample/data/source/image/SampleImageSource.java: -------------------------------------------------------------------------------- 1 | package tech.thdev.android_mvp_sample.data.source.image; 2 | 3 | import android.content.Context; 4 | 5 | import java.util.ArrayList; 6 | 7 | import tech.thdev.android_mvp_sample.data.ImageItem; 8 | 9 | /** 10 | * Created by tae-hwan on 1/30/17. 11 | */ 12 | public interface SampleImageSource { 13 | 14 | interface LoadImageCallback { 15 | 16 | void onImageLoaded(ArrayList list); 17 | } 18 | 19 | void getImages(Context context, int size, LoadImageCallback loadImageCallback); 20 | } 21 | -------------------------------------------------------------------------------- /app_kotlin/src/main/java/tech/thdev/app_kotlin/adapter/contract/ImageAdapterContract.kt: -------------------------------------------------------------------------------- 1 | package tech.thdev.app_kotlin.adapter.contract 2 | 3 | import tech.thdev.app_kotlin.data.ImageItem 4 | import java.util.* 5 | 6 | /** 7 | * Created by tae-hwan on 12/27/16. 8 | */ 9 | interface ImageAdapterContract { 10 | 11 | interface View { 12 | 13 | var onClickFunc : ((Int) -> Unit)? 14 | 15 | fun notifyAdapter() 16 | } 17 | 18 | interface Model { 19 | 20 | fun addItems(imageItems: ArrayList) 21 | 22 | fun clearItem() 23 | 24 | fun getItem(position: Int): ImageItem 25 | } 26 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /captures 3 | .externalNativeBuild 4 | ### Android template 5 | # Built application files 6 | *.apk 7 | *.ap_ 8 | 9 | # Files for the ART/Dalvik VM 10 | *.dex 11 | 12 | # Java class files 13 | *.class 14 | 15 | # Generated files 16 | bin/ 17 | gen/ 18 | out/ 19 | 20 | # Gradle files 21 | .gradle/ 22 | build/ 23 | .idea/ 24 | 25 | # Local configuration file (sdk path, etc) 26 | local.properties 27 | 28 | # Proguard folder generated by Eclipse 29 | proguard/ 30 | 31 | # Log Files 32 | *.log 33 | 34 | # Android Studio Navigation editor temp files 35 | .navigation/ 36 | 37 | # Android Studio captures folder 38 | captures/ 39 | 40 | # Intellij 41 | *.iml 42 | .idea/workspace.xml 43 | 44 | # Keystore files 45 | *.jks 46 | 47 | -------------------------------------------------------------------------------- /app_java/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/tae-hwan/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app_kotlin/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/tae-hwan/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app_kotlin/src/main/res/layout/item_image.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 20 | -------------------------------------------------------------------------------- /app_java/src/main/java/tech/thdev/android_mvp_sample/adapter/contract/ImageAdapterContract.java: -------------------------------------------------------------------------------- 1 | package tech.thdev.android_mvp_sample.adapter.contract; 2 | 3 | import java.util.ArrayList; 4 | 5 | import tech.thdev.android_mvp_sample.data.ImageItem; 6 | import tech.thdev.android_mvp_sample.listener.OnItemClickListener; 7 | 8 | /** 9 | * Created by tae-hwan on 12/27/16. 10 | */ 11 | public interface ImageAdapterContract { 12 | 13 | interface View { 14 | 15 | void setOnClickListener(OnItemClickListener clickListener); 16 | 17 | void notifyAdapter(); 18 | } 19 | 20 | interface Model { 21 | 22 | void addItems(ArrayList imageItems); 23 | 24 | void clearItem(); 25 | 26 | ImageItem getItem(int position); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app_java/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 16 | 17 | -------------------------------------------------------------------------------- /app_kotlin/src/main/java/tech/thdev/app_kotlin/data/source/image/SampleImageRepository.kt: -------------------------------------------------------------------------------- 1 | package tech.thdev.app_kotlin.data.source.image 2 | 3 | import android.content.Context 4 | import tech.thdev.app_kotlin.data.ImageItem 5 | import java.util.* 6 | 7 | /** 8 | * Created by tae-hwan on 1/30/17. 9 | */ 10 | object SampleImageRepository : SampleImageSource { 11 | 12 | private val sampleImageLocalDataSource = SampleImageLocalDataSource 13 | 14 | override fun getImages(context: Context, size: Int, loadImageCallback: SampleImageSource.LoadImageCallback?) { 15 | sampleImageLocalDataSource.getImages(context, size, object : SampleImageSource.LoadImageCallback { 16 | override fun onLoadImages(list: ArrayList) { 17 | loadImageCallback?.onLoadImages(list) 18 | } 19 | }) 20 | } 21 | } -------------------------------------------------------------------------------- /app_kotlin/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /app_java/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 | 10 | 11 | 15 | 16 |