├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ ├── ic_download.png │ │ │ │ ├── gradient.xml │ │ │ │ ├── bg_white_round_top.xml │ │ │ │ ├── ic_close.xml │ │ │ │ ├── ic_photo.xml │ │ │ │ ├── ic_save.xml │ │ │ │ ├── ic_image_error.xml │ │ │ │ ├── ic_search.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── menu │ │ │ │ ├── menu_details.xml │ │ │ │ └── menu_gallery.xml │ │ │ ├── layout │ │ │ │ ├── footer_photo_load_state.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── item_photo.xml │ │ │ │ ├── fragment_gallery.xml │ │ │ │ ├── bottom_sheet_loading.xml │ │ │ │ └── fragment_details.xml │ │ │ ├── navigation │ │ │ │ └── nav_graph.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── raw │ │ │ │ ├── download2.json │ │ │ │ └── download.json │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── myphotoloaderapp │ │ │ │ ├── Util │ │ │ │ ├── Common │ │ │ │ │ ├── CommonUtils.kt │ │ │ │ │ ├── FragmentUtils.kt │ │ │ │ │ ├── StringUtils.kt │ │ │ │ │ ├── TextviewUtils.kt │ │ │ │ │ ├── ActivityUtils.kt │ │ │ │ │ ├── ViewUtils.kt │ │ │ │ │ ├── Other.kt │ │ │ │ │ └── ContextUtils.kt │ │ │ │ └── StorageUtil.kt │ │ │ │ ├── UI │ │ │ │ ├── details │ │ │ │ │ ├── DetailsViewModel.kt │ │ │ │ │ └── DetailsFragment.kt │ │ │ │ └── gallery │ │ │ │ │ ├── GalleryViewModel.kt │ │ │ │ │ ├── PhotoLoadStateAdapter.kt │ │ │ │ │ ├── PhotoAdapter.kt │ │ │ │ │ └── GalleryFragment.kt │ │ │ │ ├── MyApp.kt │ │ │ │ ├── network │ │ │ │ ├── PhotoResponse.kt │ │ │ │ └── PhotoApi.kt │ │ │ │ ├── data │ │ │ │ ├── PhotoRepository.kt │ │ │ │ ├── MyPhoto.kt │ │ │ │ └── PhotoPagingSource.kt │ │ │ │ ├── di │ │ │ │ └── AppModule.kt │ │ │ │ └── MainActivity.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── myphotoloaderapp │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── example │ │ └── myphotoloaderapp │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── screenshots ├── .gitkeep ├── photo5803347900867130566.jpg ├── photo5803347900867130568.jpg ├── photo5803347900867130569.jpg └── photo5803347900867130570.jpg ├── settings.gradle ├── .idea ├── .gitignore ├── codeStyles │ ├── codeStyleConfig.xml │ └── Project.xml ├── compiler.xml ├── vcs.xml ├── runConfigurations.xml ├── $PROJECT_FILE$ ├── qaplug_profiles.xml ├── misc.xml ├── gradle.xml └── jarRepositories.xml ├── Apk └── MyPhotoLoader.apk ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── gradle.properties ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /screenshots/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name = "MyPhotoLoaderApp" -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /Apk/MyPhotoLoader.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/Apk/MyPhotoLoader.apk -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MyPhotoLoaderApp 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/drawable/ic_download.png -------------------------------------------------------------------------------- /screenshots/photo5803347900867130566.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/screenshots/photo5803347900867130566.jpg -------------------------------------------------------------------------------- /screenshots/photo5803347900867130568.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/screenshots/photo5803347900867130568.jpg -------------------------------------------------------------------------------- /screenshots/photo5803347900867130569.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/screenshots/photo5803347900867130569.jpg -------------------------------------------------------------------------------- /screenshots/photo5803347900867130570.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/screenshots/photo5803347900867130570.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/Util/Common/CommonUtils.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp.Util 2 | 3 | fun Any?.isNull() = this == null 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/behnawwm/MyPhotoLoaderApp/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/UI/details/DetailsViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp.UI.details 2 | 3 | import androidx.lifecycle.ViewModel 4 | 5 | 6 | class DetailsViewModel : ViewModel() { 7 | 8 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/MyApp.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp 2 | 3 | import android.app.Application 4 | import dagger.hilt.android.HiltAndroidApp 5 | 6 | 7 | @HiltAndroidApp 8 | class MyApp : Application() { 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/network/PhotoResponse.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp.network 2 | 3 | import com.example.myphotoloaderapp.data.MyPhoto 4 | 5 | data class PhotoResponse( 6 | var results: List 7 | ) { 8 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun May 02 10:29:36 IRDT 2021 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.5-all.zip 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/Util/StorageUtil.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp.Util 2 | 3 | import android.os.Build 4 | 5 | inline fun sdk29AndUp(onSdk29: () -> T): T? { 6 | return if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { 7 | onSdk29() 8 | } else null 9 | } -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/Util/Common/FragmentUtils.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp.Util.Common 2 | 3 | import android.widget.Toast 4 | import androidx.fragment.app.Fragment 5 | 6 | /** 7 | * Extension method to display toast text for SupportFragment. 8 | */ 9 | fun Fragment.toast(text: CharSequence, duration: Int = Toast.LENGTH_LONG) = this?.let { activity.toast(text, duration) } -------------------------------------------------------------------------------- /.idea/$PROJECT_FILE$: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_details.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_white_round_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /.idea/qaplug_profiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/com/example/myphotoloaderapp/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_gallery.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_close.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_photo.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_save.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_image_error.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | 11 | 12 | #6200EE 13 | #3700B3 14 | #03DAC5 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/data/PhotoRepository.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp.data 2 | 3 | import androidx.paging.Pager 4 | import androidx.paging.PagingConfig 5 | import androidx.paging.liveData 6 | import com.example.myphotoloaderapp.network.PhotoApi 7 | import javax.inject.Inject 8 | import javax.inject.Singleton 9 | 10 | @Singleton 11 | class PhotoRepository @Inject constructor(var api: PhotoApi) { 12 | 13 | fun getSearchResults(query: String) = 14 | Pager( 15 | config = PagingConfig( 16 | pageSize = 10, 17 | maxSize = 50, 18 | enablePlaceholders = false 19 | ), 20 | pagingSourceFactory = { PhotoPagingSource(api, query) } 21 | ).liveData 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/network/PhotoApi.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp.network 2 | 3 | import com.example.myphotoloaderapp.BuildConfig 4 | import retrofit2.http.GET 5 | import retrofit2.http.Header 6 | import retrofit2.http.Headers 7 | import retrofit2.http.Query 8 | 9 | interface PhotoApi { 10 | 11 | companion object { 12 | const val ACCESS_KEY = BuildConfig.UNSPLASH_ACCESS_KEY 13 | const val BASE_URL = "https://api.unsplash.com/" 14 | } 15 | 16 | @Headers("Accept-Version: v1", "Authorization: Client-ID $ACCESS_KEY") 17 | @GET("search/photos") 18 | suspend fun searchPhoto( 19 | @Query("query") query: String, 20 | @Query("page") page: Int, 21 | @Query("per_page") perPage: Int 22 | ): PhotoResponse 23 | 24 | 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/data/MyPhoto.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp.data 2 | 3 | import android.os.Parcelable 4 | import kotlinx.android.parcel.Parcelize 5 | 6 | @Parcelize 7 | data class MyPhoto( 8 | var id: String, 9 | var desc: String?, 10 | var urls: PhotoUrls, 11 | var user: User 12 | ) : Parcelable { 13 | 14 | @Parcelize 15 | data class PhotoUrls( 16 | var raw: String, 17 | var full: String, 18 | var regular: String, 19 | var thumb: String 20 | ) : Parcelable 21 | 22 | @Parcelize 23 | data class User( 24 | var username: String, 25 | var name: String 26 | ) : Parcelable { 27 | val attributionUrl get() = "https://unsplash.com/$username?utm_source=MyImageLoader&utm_medium=referral" 28 | } 29 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/androidTest/java/com/example/myphotoloaderapp/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.example.myphotoloaderapp", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/Util/Common/StringUtils.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp.Util.Common 2 | 3 | 4 | /** 5 | * Extension method to check if String is Phone Number. 6 | */ 7 | fun String.isPhone(): Boolean { 8 | val p = "^1([34578])\\d{9}\$".toRegex() 9 | return matches(p) 10 | } 11 | 12 | /** 13 | * Extension method to check if String is Email. 14 | */ 15 | fun String.isEmail(): Boolean { 16 | val p = "^(\\w)+(\\.\\w+)*@(\\w)+((\\.\\w+)+)\$".toRegex() 17 | return matches(p) 18 | } 19 | 20 | /** 21 | * Extension method to check if String is Number. 22 | */ 23 | fun String.isNumeric(): Boolean { 24 | val p = "^[0-9]+$".toRegex() 25 | return matches(p) 26 | } 27 | /** 28 | * Extension method to check String equalsIgnoreCase 29 | */ 30 | fun String.equalsIgnoreCase(other: String) = this.toLowerCase().contentEquals(other.toLowerCase()) -------------------------------------------------------------------------------- /app/src/main/java/com/example/myphotoloaderapp/di/AppModule.kt: -------------------------------------------------------------------------------- 1 | package com.example.myphotoloaderapp.di 2 | 3 | import com.example.myphotoloaderapp.network.PhotoApi 4 | import dagger.Module 5 | import dagger.Provides 6 | import dagger.hilt.InstallIn 7 | import dagger.hilt.android.components.ApplicationComponent 8 | import retrofit2.Retrofit 9 | import retrofit2.converter.gson.GsonConverterFactory 10 | import javax.inject.Singleton 11 | 12 | 13 | @Module 14 | @InstallIn(ApplicationComponent::class) 15 | object AppModule { 16 | 17 | @Provides 18 | @Singleton 19 | fun provideRetrofit(): Retrofit = 20 | Retrofit.Builder() 21 | .baseUrl(PhotoApi.BASE_URL) 22 | .addConverterFactory(GsonConverterFactory.create()) 23 | .build() 24 | 25 | @Provides 26 | @Singleton 27 | fun provideApi(retrofit: Retrofit): PhotoApi = 28 | retrofit.create(PhotoApi::class.java) 29 | 30 | 31 | } -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/footer_photo_load_state.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 19 | 20 |