{"id":13339531,"url":"https://github.com/islamarr/shutterstock_image_list","last_synced_at":"2025-03-11T14:31:36.384Z","repository":{"id":103910697,"uuid":"405338966","full_name":"islamarr/shutterstock_image_list","owner":"islamarr","description":"🚀 List of awesome pictures from ShutterStock.","archived":false,"fork":false,"pushed_at":"2021-11-05T14:09:11.000Z","size":379,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T02:30:14.473Z","etag":null,"topics":["clean-code","coroutines","dagger2","databinding","flow","glide","hilt","livedata","mvvm","navigation-component","paging3","repository","retrofit","unit-testing","viewmodel"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/islamarr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-11T09:36:53.000Z","updated_at":"2022-05-18T08:15:04.000Z","dependencies_parsed_at":"2023-11-22T23:45:14.818Z","dependency_job_id":null,"html_url":"https://github.com/islamarr/shutterstock_image_list","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamarr%2Fshutterstock_image_list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamarr%2Fshutterstock_image_list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamarr%2Fshutterstock_image_list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/islamarr%2Fshutterstock_image_list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/islamarr","download_url":"https://codeload.github.com/islamarr/shutterstock_image_list/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243051879,"owners_count":20228284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clean-code","coroutines","dagger2","databinding","flow","glide","hilt","livedata","mvvm","navigation-component","paging3","repository","retrofit","unit-testing","viewmodel"],"created_at":"2024-07-29T19:20:21.596Z","updated_at":"2025-03-11T14:31:36.355Z","avatar_url":"https://github.com/islamarr.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ShutterStock\n\n![GitHub followers][40]     ![GitHub Repo stars][41]     ![GitHub forks][42]\n\nAbout this project\n--------------\n🚀 List of awesome pictures from ShutterStock.\n\n🛠 Simple implementation for MVVM architecture pattern and clean code.\n\n🛠 SOLID principles.\n\n🛠 Unit tests included.\n\n🛠 Standard Coding Style.\n\n🛠 Support Tablet screens.\n\n\nChallenges\n--------------\n- Performance and smooth scrolling:\n  I was in need to pagination to keep the app in high performance by reducing server overhead and improve response time.\n  I have used Glide which is a fast and efficient image loading library uses memory and disk caching by default to avoid unnecessary network calls.\n\n\nArchitecture pattern Used\n--------------\n[MVVM][1]\n\n![architecture pattern][2]\n\nLibraries \u0026 Tools Used\n--------------\n\n* [Foundation][0] - Components for core system capabilities, Kotlin extensions and support for\n  multidex and automated testing.\n* [Test][4] - An Android testing framework for unit and runtime UI tests.\n* [Architecture][10] - A collection of libraries that help you design robust, testable, and\n  maintainable apps. Start with classes for managing your UI component lifecycle and handling data\n  persistence.\n    * [Data Binding][11] - Declaratively bind observable data to UI elements.\n    * [Lifecycles][12] - Create a UI that automatically responds to lifecycle events.\n    * [LiveData][13] - Build data objects that notify views when the underlying database changes.\n    * [Navigation][14] - Handle everything needed for in-app navigation.\n    * [ViewModel][17] - Store UI-related data that isn't destroyed on app rotations. Easily schedule\n      asynchronous tasks for optimal execution.\n    * [Repository][3] - A Module that handle data operations, You can consider repositories to be mediators between different data sources.\n    * [Kotlin Flows][21] - A stream of data that can be computed asynchronously.\n    * [Paging 3][22] - For loading and display pages of data from a larger dataset from local storage or over network.\n* Third party and miscellaneous libraries\n    * [Retrofit][20] - A simple library that is used for network transaction.\n    * [Glide][90] For image loading.\n    * [Hilt][92]: For [dependency injection][93]\n    * [Kotlin Coroutines][91] For managing background threads with simplified code and reducing needs for callbacks.\n* Other tools/plugins   \n    * [SonarLint plugin][50] - Static Code Analysis that identifies and helps you fix quality and security issues as you code.\n    * [Espresso test recorder][51] - Tool lets you create UI tests for your app without writing any test code.\n\nTechnical choices\n--------------\n\n**MVVM vs MVP**\n\n- Loose coupling between View \u0026 ViewModel, ViewModel has no reference to the View. So it isn't affected by configuration changes.\n- Aware by lifecycle. ViewModel save data even after rotate mobile.\n- Easy to Test.\n\n**RecyclerView vs listview**\n\n- In RecyclerView, it is mandatory to use ViewHolder pattern Which optimize the performance.\n- DiffUtil callback Which optimize the performance.\n\n**Activities vs Fragments**\n\n- I have used a single-activity architecture which allowed me to take full advantage of the Navigation component, which mean that a single activity that manages and host multiple fragments.\n- The fragment is more lite weight than Activity.\n\n**Hilt vs Dagger2 vs Koin**\n\n- Hilt is built on top of the Dagger, and it comes with some advantages like simplify Dagger code and create a standard set of components and scopes to ease setup.\n- As this project is simple, Hilt is the best one. For more complex projects I will go with Dagger2 to avoid some limitation of hilt.\n- Hilt does not need factories for ViewModel, koin need.\n- Hilt generate the code in the compile time, while koin in runtime. \n\n**Coroutines vs RxJava**\n\n- For me, Coroutines are simpler \u0026 readable than RxJava, and it is working very well in a small projects like that.\n  In more complex projects may be RxJava is better to get benefit of their operators, and to handle a complex data flow. \n  However, Coroutines have some advantages over RxJava like Channel.\n  \n**Retrofit vs Volley**\n  \n- For me, Retrofit has a well-designed code, more readable.\n- Recommended by Google. \n\n**Glide**\n\n- Glide very effective for almost any case where you need to fetch, resize, cache and display a remote image.\n- Support round pictures, thumbnail and placeholder which I needed in this project.\n\n\nWhat's next\n--------------\n- I wish I could have implemented caching data, but found problems that will take some time, \n  so maybe complete it in the coming iteration.\n- Also the UI needs to be much fancier.\n- Unit tests are still need to be written.\n- I wish I could have extend it to Clean Architecture, maybe update it in the coming iteration.\n\n\nOther Projects\n--------------\n[Sona3][30]\n[Recorder][31]\n[Prayer Now][32]\n[Mn Ahyaha][33]\n\n\n[0]: https://developer.android.com/jetpack/components\n[1]: https://developer.android.com/jetpack/guide\n[2]: https://github.com/islamarr/GitHubRepos/blob/master/app/src/main/res/drawable/mvvm_diagram.png\n[3]: https://developer.android.com/jetpack/guide#fetch-data\n[4]: https://developer.android.com/training/testing/\n[10]: https://developer.android.com/jetpack/arch/\n[11]: https://developer.android.com/topic/libraries/data-binding/\n[12]: https://developer.android.com/topic/libraries/architecture/lifecycle\n[13]: https://developer.android.com/topic/libraries/architecture/livedata\n[14]: https://developer.android.com/topic/libraries/architecture/navigation/\n[17]: https://developer.android.com/topic/libraries/architecture/viewmodel\n[20]: https://square.github.io/retrofit\n[21]: https://developer.android.com/kotlin/flow\n[22]: https://developer.android.com/topic/libraries/architecture/paging/v3-overview\n[30]: https://github.com/islamarr/Sona3\n[31]: https://github.com/islamarr/recorder\n[32]: https://play.google.com/store/apps/details?id=com.AppRocks.now.prayer\n[33]: https://play.google.com/store/apps/details?id=com.Ihsan.Ahyaha\n[40]: https://img.shields.io/github/followers/islamarr?style=social\n[41]: https://img.shields.io/github/stars/islamarr/shutterstock_image_list?style=social\n[42]: https://img.shields.io/github/forks/islamarr/shutterstock_image_list?style=social\n[50]: https://www.sonarlint.org/\n[51]: https://developer.android.com/studio/test/espresso-test-recorder\n[90]: https://bumptech.github.io/glide/\n[91]: https://kotlinlang.org/docs/reference/coroutines-overview.html\n[92]: https://developer.android.com/training/dependency-injection/hilt-android\n[93]: https://developer.android.com/training/dependency-injection\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislamarr%2Fshutterstock_image_list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fislamarr%2Fshutterstock_image_list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislamarr%2Fshutterstock_image_list/lists"}