{"id":23075167,"url":"https://github.com/imaginativeshohag/simple-mvvm","last_synced_at":"2025-04-19T22:49:52.980Z","repository":{"id":47244600,"uuid":"225951395","full_name":"ImaginativeShohag/Simple-MVVM","owner":"ImaginativeShohag","description":"A simple Android MVVM pattern example","archived":false,"fork":false,"pushed_at":"2024-08-21T23:33:41.000Z","size":17346,"stargazers_count":69,"open_issues_count":0,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T13:51:09.405Z","etag":null,"topics":["android","android-sample","dagger-android","jetpack","kotlin","kotlin-android","kotlin-coroutines","mvvm-android","navigation-architecture-component","retorfit","retrofit2","room","room-persistence-library"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ImaginativeShohag.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.buymeacoffee.com/ImShohag"]}},"created_at":"2019-12-04T20:29:53.000Z","updated_at":"2025-01-29T19:48:37.000Z","dependencies_parsed_at":"2024-04-11T21:46:22.652Z","dependency_job_id":"11d6e57e-c074-4505-93b6-4990b7692209","html_url":"https://github.com/ImaginativeShohag/Simple-MVVM","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImaginativeShohag%2FSimple-MVVM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImaginativeShohag%2FSimple-MVVM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImaginativeShohag%2FSimple-MVVM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImaginativeShohag%2FSimple-MVVM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ImaginativeShohag","download_url":"https://codeload.github.com/ImaginativeShohag/Simple-MVVM/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249824003,"owners_count":21330243,"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":["android","android-sample","dagger-android","jetpack","kotlin","kotlin-android","kotlin-coroutines","mvvm-android","navigation-architecture-component","retorfit","retrofit2","room","room-persistence-library"],"created_at":"2024-12-16T08:40:01.357Z","updated_at":"2025-04-19T22:49:52.935Z","avatar_url":"https://github.com/ImaginativeShohag.png","language":"Kotlin","funding_links":["https://www.buymeacoffee.com/ImShohag"],"categories":[],"sub_categories":[],"readme":"# Simple MVVM\n\nA simple Android MVVM pattern example and template.\n\n[![Developer](https://img.shields.io/badge/Maintainer-ImaginativeShohag-green)](https://github.com/ImaginativeShohag)\n[![Buy Me A Coffee](https://img.shields.io/badge/-buy_me_a_coffee-gray?logo=buy-me-a-coffee)](https://www.buymeacoffee.com/ImShohag)\n\n## Screenshots\n\n|                                                         | \u003cimg src=\"images/home.png\" style=\"width:320px\"\u003e |                                                              |\n|:-------------------------------------------------------:|:-----------------------------------------------:|:------------------------------------------------------------:|\n| \u003cimg src=\"images/awesome-todo.gif\" style=\"width:320px\"\u003e | \u003cimg src=\"images/cms.gif\" style=\"width:320px\"\u003e  | \u003cimg src=\"images/service-broadcast.gif\" style=\"width:320px\"\u003e |\n\n\n## Used Components/Libraries\n\n- Kotlin\n- Kotlin Coroutines (https://developer.android.com/kotlin/coroutines)\n- View Binding (https://developer.android.com/topic/libraries/view-binding)\n- Data Binding (https://developer.android.com/topic/libraries/data-binding)\n- Retrofit (https://github.com/square/retrofit) with Moshi (https://github.com/square/moshi)\n- Room Persistence Library (https://developer.android.com/topic/libraries/architecture/room)\n- Shared Preferences (https://developer.android.com/training/data-storage/shared-preferences)\n- Navigation Component (https://developer.android.com/guide/navigation)\n- Glide (https://github.com/bumptech/glide)\n- Timber (https://github.com/JakeWharton/timber)\n- Custom Fonts (https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml)\n- Shimmer for Android (https://github.com/facebook/shimmer-android)\n- Hilt (https://dagger.dev/hilt/)\n- Paging 3 (https://developer.android.com/topic/libraries/architecture/paging)\n\n## Others\n\n- Splash Screen (Introduced in Android 12)\n- Custom Build variant (https://developer.android.com/studio/build/build-variants)\n- Environment variable based on Build variant\n- Custom Snackbar\n- Dark Mode\n- Awesome module naming example (see `AwesomeModuleConstants`)\n- Dynamic accent color from image (see `calculatePaletteInImage()`)\n- Simple Encryption Utils (see `EncryptionUtils`)\n- Data pass and receive example between Activities\n  - Pass data on `Activity` start (`startActivity()`)\n  - Start `Activity` for result (`registerForActivityResult()`)\n- Data pass and receive example between Fragments\n  - Pass data between child `Fragment` using parent `ViewModel`\n  - Pass data between child `Fragment` using `FragmentResultListener`\n  - Pass data on `Fragment` transaction\n- Simple Todo app (for beginner)\n  - Single Activity approach\n  - Used [Go REST](https://gorest.co.in) API (Just Todo API)\n  - Offline support\n- Simple CMS app\n  - Single Activity approach\n  - Used [Go REST](https://gorest.co.in) API\n  - Sections: User, Post, Todo and Comment\n  - Navigation Component\n  - Hilt\n  - Material 3\n- Service example\n  - Foreground service\n  - Data-pass using Broadcast\n- GitHub Actions\n  - [CodeQL Analysis](https://github.com/github/codeql-action)\n  - [Run ktlint with reviewdog](https://github.com/marketplace/actions/run-ktlint-with-reviewdog)\n- Send test push notification to self using OneSignal\n\n## Extension Functions (see `utils/extensions`)\n\n- DateTime\n- Dialog\n- Dimension\n- Flow\n- General Spinner\n- Miscellaneous: show/hide keyboard, download file, open permission settings, open url, send mail\n  etc.\n- Retrofit\n- Snackbar\n- String\n- Toast\n\n## Common Binding Adapters\n\n- RecyclerView\n- Spinner\n- ImageView\n- TextView (for Date() to formatted date-time)\n\n# Utilities\n\n- `SharedPref`\n- `AlarmUtils`\n- `LocationProviderUtilClient`\n- `Event` Class: Get notified for identical values in LiveData, Channel, Flow etc.\n- `ignoreCrash { }`: Ignore exceptions for a block.\n\n## Todo\n\n- [ ] UI/Unit Testing\n- [ ] Example of `LocationProviderUtilClient`\n- [ ] Migrate full app to Material 3\n\n# Note\n\n- For dependency version check I am currently using [Gradle Versions Plugin](https://github.com/ben-manes/gradle-versions-plugin#using-a-gradle-init-script). I added this in the Gradle init script and can check versions using the following commend.\n\n```bash\n./gradlew dependencyUpdates\n```\n\n- The project using [spotless](https://github.com/diffplug/spotless/tree/main/plugin-gradle) with [klint](https://github.com/pinterest/ktlint). Apply spotless using the following command.\n\n```bash\n./gradlew spotlessApply\n```\n\n## Setup\n\n### Go REST API Key\n\nOpen the `local.properties` in your project level directory, and then add the following code. Replace `YOUR_API_KEY` with your [Go REST](https://gorest.co.in) API key.\n\n```groovy\nAPI_KEY=YOUR_API_KEY\n```\n\n# My Other Projects\n\n- [Oops! No Internet!](https://github.com/ImaginativeShohag/Oops-No-Internet) - A simple no Internet dialog and snackbar, which will automatically appear and disappear based on Internet connectivity status.\n- [Why Not! Image Carousel!](https://github.com/ImaginativeShohag/Why-Not-Image-Carousel) - An easy, super simple and customizable image carousel view for Android.\n- [Why Not Compose!](https://github.com/ImaginativeShohag/Why-Not-Compose) - A collection of animations, compositions, UIs using Jetpack Compose. You can say Jetpack Compose cookbook or play-ground if you want!\n- [Why Not SwiftUI!](https://github.com/ImaginativeShohag/Why-Not-SwiftUI) - A collection of Swift, SwiftUI and iOS goodies.\n\n## Licence\n\n```\nCopyright 2023 Md. Mahmudul Hasan Shohag\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimaginativeshohag%2Fsimple-mvvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimaginativeshohag%2Fsimple-mvvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimaginativeshohag%2Fsimple-mvvm/lists"}